edu.nrao.sss.util
Class XmlWrapper
java.lang.Object
edu.nrao.sss.util.XmlWrapper
- All Implemented Interfaces:
- InvocationHandler
public class XmlWrapper
- extends Object
- implements InvocationHandler
This is a base class for simple Java POJOs that reflect an XML file.
Method Summary |
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
void |
commit()
|
protected void |
fillParameters(String[][] stringArray)
|
List<String> |
get(String parameter)
|
protected boolean |
getBool(String key)
If the key points to a Tuple with multiple values in its list, this uses the first one. |
protected Date |
getDate(String key)
If the key points to a Tuple with multiple values in its list, this uses the first one. |
static
|
getInstanceOf(Class<T> interFace,
InputSource is,
String root,
String[][] stringArray)
|
static
|
getInstanceOf(Class<T> interFace,
String uri,
String root,
String[][] stringArray)
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
|
void |
set(String parameter,
List<String> list)
|
protected void |
setBool(String key,
boolean value)
|
protected void |
setDate(String key,
Date value)
|
String |
toString()
|
ISO_8601
public static final SimpleDateFormat ISO_8601
ISO_8601_s
public static final SimpleDateFormat ISO_8601_s
XmlWrapper
public XmlWrapper(String uri)
throws SAXException,
IOException,
ParserConfigurationException
- Throws:
SAXException
IOException
ParserConfigurationException
XmlWrapper
public XmlWrapper(String uri,
String root)
throws SAXException,
IOException,
ParserConfigurationException,
XPathExpressionException
- Throws:
SAXException
IOException
ParserConfigurationException
XPathExpressionException
XmlWrapper
public XmlWrapper(String uri,
String root,
String[][] stringArray)
throws SAXException,
IOException,
ParserConfigurationException,
XPathExpressionException
- Throws:
SAXException
IOException
ParserConfigurationException
XPathExpressionException
XmlWrapper
public XmlWrapper()
XmlWrapper
public XmlWrapper(InputSource source)
throws SAXException,
IOException,
ParserConfigurationException
- Throws:
SAXException
IOException
ParserConfigurationException
XmlWrapper
public XmlWrapper(InputSource source,
String root)
throws SAXException,
IOException,
ParserConfigurationException,
XPathExpressionException
- Throws:
SAXException
IOException
ParserConfigurationException
XPathExpressionException
XmlWrapper
public XmlWrapper(InputSource source,
String root,
String[][] stringArray)
throws SAXException,
IOException,
ParserConfigurationException,
XPathExpressionException
- Throws:
SAXException
IOException
ParserConfigurationException
XPathExpressionException
get
public List<String> get(String parameter)
set
public void set(String parameter,
List<String> list)
commit
public void commit()
throws XPathExpressionException
- Throws:
XPathExpressionException
fillParameters
protected void fillParameters(String[][] stringArray)
throws XPathExpressionException
- Throws:
XPathExpressionException
toString
public String toString()
- Overrides:
toString
in class Object
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Specified by:
invoke
in interface InvocationHandler
- Throws:
Throwable
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
getDate
protected Date getDate(String key)
- If the key points to a Tuple with multiple values in its list, this uses the first one.
setDate
protected void setDate(String key,
Date value)
getBool
protected boolean getBool(String key)
- If the key points to a Tuple with multiple values in its list, this uses the first one.
setBool
protected void setBool(String key,
boolean value)
getInstanceOf
public static <T> T getInstanceOf(Class<T> interFace,
String uri,
String root,
String[][] stringArray)
getInstanceOf
public static <T> T getInstanceOf(Class<T> interFace,
InputSource is,
String root,
String[][] stringArray)
Copyright © 2009. All Rights Reserved.