T
- the type of the object to convert the XML Object intopublic class XmlInputConverter<T> extends InputStreamInputConverter<T>
Constructor and Description |
---|
XmlInputConverter(java.lang.Class<T> targetClass)
Construct a new instance of a XmlInputConverter that is able to convert the data read from the InputStream into
objects of the specified
targetClass . |
XmlInputConverter(java.lang.Class<T> targetClass,
java.lang.String tag)
Construct a new instance of a XmlInputConverter that is able to convert the data read from the InputStream into
objects of the specified
targetClass . |
Modifier and Type | Method and Description |
---|---|
T |
read()
Reads an object from a certain input source and returns it.
|
getInputStream, setInputStream
public XmlInputConverter(java.lang.Class<T> targetClass)
targetClass
.targetClass
- The class defining the objects being converted from XML.public XmlInputConverter(java.lang.Class<T> targetClass, java.lang.String tag)
targetClass
.
Often, the XML returned by web services has the relevant information nested or wrapped in rootnodes.
If there is a 1-1 mapping between the data and the Object, we would end up with unused wrapper classes.
By specifying the name of the node that contains the relevant information, the wrapping data is ignored.targetClass
- The class defining the objects being converted from XML.tag
- the nodename of the rootnode containing the relevant information.public T read()
InputConverter