Package hec.data
Class JDomDataObjectFactory<T1>
java.lang.Object
hec.data.JDomDataObjectFactory<T1>
A factory class for instantiating JDom data object from input. The JDom data
object that this factory builds must have a constructor that accepts a JDom
Element instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildDataObject
(Reader reader) builds a single instance of a JDom data object from the root element of the xml content.buildDataObject
(String xmlContent) Builds a single JDom data object instance from the root element of xml content.buildDataObject
(org.jdom.Element element) Builds a single JDom data object from the argument element.buildDataObjectList
(Reader reader) buildDataObjectList
(Reader reader, String xpathString) Build a list of child JDom data object from the root element of an xml document.buildDataObjectList
(String xmlString) Build a a list of child JDom data objects from a parent element.buildDataObjectList
(List<org.jdom.Element> children) static Reader
getDocumentReader
(String xmlString) static org.jdom.Element
getRootElement
(Reader reader) static org.jdom.Element
getRootElement
(String xmlString)
-
Constructor Details
-
JDomDataObjectFactory
-
-
Method Details
-
newDataObject
public T1 newDataObject() throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException -
buildDataObjectList
public List<T1> buildDataObjectList(String xmlString) throws org.jdom.JDOMException, IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Build a a list of child JDom data objects from a parent element.- Parameters:
xmlString
- the xml content.- Returns:
- Throws:
org.jdom.JDOMException
IOException
SecurityException
IllegalArgumentException
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
-
getDocumentReader
-
getRootElement
public static org.jdom.Element getRootElement(Reader reader) throws org.jdom.JDOMException, IOException - Throws:
org.jdom.JDOMException
IOException
-
getRootElement
-
buildDataObjectList
public List<T1> buildDataObjectList(Reader reader, String xpathString) throws org.jdom.JDOMException, IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Build a list of child JDom data object from the root element of an xml document.- Parameters:
reader
- has the XML content.xpathString
- if not null, a string that will be used to restrict the xml elements from which the child objects will be built.- Returns:
- Throws:
org.jdom.JDOMException
IOException
SecurityException
IllegalArgumentException
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
-
buildDataObjectList
public List<T1> buildDataObjectList(Reader reader) throws org.jdom.JDOMException, IOException, SecurityException, IllegalArgumentException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException - Throws:
org.jdom.JDOMException
IOException
SecurityException
IllegalArgumentException
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
-
buildDataObjectList
public List<T1> buildDataObjectList(List<org.jdom.Element> children) throws InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException -
buildDataObject
public T1 buildDataObject(Reader reader) throws org.jdom.JDOMException, IOException, IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException builds a single instance of a JDom data object from the root element of the xml content.- Parameters:
reader
- has the xml content.- Returns:
- Throws:
org.jdom.JDOMException
IOException
IllegalArgumentException
SecurityException
InstantiationException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
-
buildDataObject
public T1 buildDataObject(String xmlContent) throws org.jdom.JDOMException, IOException, IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException Builds a single JDom data object instance from the root element of xml content.- Parameters:
xmlContent
- the xml content string.- Returns:
- Throws:
org.jdom.JDOMException
IOException
IllegalArgumentException
SecurityException
InstantiationException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
-
buildDataObject
public T1 buildDataObject(org.jdom.Element element) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException Builds a single JDom data object from the argument element.- Parameters:
element
-- Returns:
- Throws:
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
SecurityException
NoSuchMethodException
-