T - The typepublic abstract class AbstractXmlReader<T> extends AbstractReader<T,name.pehl.totoe.xml.client.Element> implements XmlReader<T>
| Modifier and Type | Field and Description |
|---|---|
protected XmlRegistry |
xmlRegistry |
handlerManager, idMap, logger| Modifier | Constructor and Description |
|---|---|
protected |
AbstractXmlReader() |
| Modifier and Type | Method and Description |
|---|---|
protected List<name.pehl.totoe.xml.client.Element> |
filterElements(List<name.pehl.totoe.xml.client.Node> nodes) |
protected List<T> |
internalReadList(List<name.pehl.totoe.xml.client.Element> elements) |
T |
read(name.pehl.totoe.xml.client.Document document)
Convert the data in the specified document to an instance of T according
to the annotated properties in T.
|
T |
read(name.pehl.totoe.xml.client.Element element)
Convert the data in the specified element to an instance of T according
to the annotated properties in T.
|
T |
read(String xml)
Convert the data in the specified document to an instance of T according
to the annotated properties in T.
|
List<T> |
readList(name.pehl.totoe.xml.client.Document document)
Convert the direct children of the documents root element to a list of Ts
according to the annotated properties in T.
|
List<T> |
readList(name.pehl.totoe.xml.client.Document document,
String xpath)
Convert the data in the specified document to a list of Ts according to
the annotated properties in T.
|
List<T> |
readList(name.pehl.totoe.xml.client.Element element)
Convert the direct children of the specified element to a list of Ts
according to the annotated properties in T.
|
List<T> |
readList(name.pehl.totoe.xml.client.Element element,
String xpath)
Convert the data in the specified element to a list of Ts according to
the annotated properties in T.
|
List<T> |
readList(String xml)
Convert the direct children of the root element from the specified XML to
a list of Ts according to the annotated properties in T.
|
addModelReadHandler, fireEvent, idRef, newModel, readId, readIdRefs, readPropertiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddModelReadHandlerprotected final XmlRegistry xmlRegistry
public List<T> readList(String xml) throws name.pehl.totoe.xml.client.XmlParseException
XmlReader
Please note: Use this method only if your XML does not contain
namespaces. Othherwise you have to parse the xml yourself and call
XmlReader.readList(Document):
String xmlWithNamespaces = "..."; Document document = new XmlParser().parse(xmlWithNamespaces, "..."); List<T> models = reader.readList(document);
public List<T> readList(name.pehl.totoe.xml.client.Document document)
XmlReaderpublic List<T> readList(name.pehl.totoe.xml.client.Document document, String xpath)
XmlReaderreadList in interface XmlReader<T>document - The XML document used as input. May be null.xpath - An xpath expression which should result in a list of elements
which in turn is used to generate the instances of Tnull if the document is null.public List<T> readList(name.pehl.totoe.xml.client.Element element)
XmlReaderpublic List<T> readList(name.pehl.totoe.xml.client.Element element, String xpath)
XmlReaderprotected List<T> internalReadList(List<name.pehl.totoe.xml.client.Element> elements)
public T read(String xml) throws name.pehl.totoe.xml.client.XmlParseException
XmlReader
Please note: Use this method only if your XML does not contain
namespaces. Othherwise you have to parse the xml yourself and call
XmlReader.read(Document):
String xmlWithNamespaces = "..."; Document document = new XmlParser().parse(xmlWithNamespaces, "..."); T model = reader.read(document);
public T read(name.pehl.totoe.xml.client.Document document)
XmlReaderpublic T read(name.pehl.totoe.xml.client.Element element)
XmlReaderCopyright © 2013 Harald Pehl. All Rights Reserved.