T - The model typepublic class PiritiXmlRepresentation<T> extends org.restlet.client.ext.xml.DomRepresentation implements PiritiRepresentation<T>
XmlReader for converting XML to an
instance of T.
TODO Namespace support!
| Constructor and Description |
|---|
PiritiXmlRepresentation(XmlReader<T> xmlReader,
org.restlet.client.data.MediaType mediaType)
Constructor for an empty document.
|
PiritiXmlRepresentation(XmlReader<T> xmlReader,
org.restlet.client.data.MediaType mediaType,
name.pehl.totoe.xml.client.Document document)
Constructor from an existing DOM document.
|
PiritiXmlRepresentation(XmlReader<T> xmlReader,
org.restlet.client.representation.Representation xmlRepresentation)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.xml.client.Document |
getDocument()
Returns always
null. |
T |
getModel()
Converts the XML to an instance of T using the
XmlReader given as
constructor argument. |
List<T> |
getModels()
Converts the XML to a list of Ts using the
XmlReader given as
constructor argument. |
XmlReader<T> |
getXmlReader() |
protected name.pehl.totoe.xml.client.Document |
lazyGetDocument()
Returns the wrapped document instance.
|
getReader, getStream, getText, release, setDocumentappend, exhaust, getAvailableSize, getDisposition, getExpirationDate, getRange, getSize, hasKnownSize, isAvailable, isEmpty, isTransient, setAvailable, setDisposition, setExpirationDate, setRange, setSize, setTransientgetModificationDate, getTag, setModificationDate, setTagpublic PiritiXmlRepresentation(XmlReader<T> xmlReader, org.restlet.client.data.MediaType mediaType)
xmlReader - The XmlReader for converting the XML to an instance of T.mediaType - The representation's media type.public PiritiXmlRepresentation(XmlReader<T> xmlReader, org.restlet.client.data.MediaType mediaType, name.pehl.totoe.xml.client.Document document)
xmlReader - The XmlReader for converting the XML to an instance of T.mediaType - The representation's media type.document - The source DOM document.public XmlReader<T> getXmlReader()
public T getModel() throws IOException
XmlReader given as
constructor argument. Returns null if getDocument() or
XmlReader is null.getModel in interface PiritiRepresentation<T>getDocument() or
XmlReader is null.IOExceptionpublic List<T> getModels() throws IOException
XmlReader given as
constructor argument. Returns null if getDocument() or
XmlReader is null. More precisely the child elements of the
documents root element are converted to instances of T.getModels in interface PiritiRepresentation<T>getDocument() or
XmlReader is null.IOExceptionprotected name.pehl.totoe.xml.client.Document lazyGetDocument()
throws IOException
null.IOExceptionpublic com.google.gwt.xml.client.Document getDocument()
throws IOException
null.getDocument in class org.restlet.client.ext.xml.DomRepresentationnullIOExceptionDomRepresentation.getDocument()Copyright © 2012 Harald Pehl. All Rights Reserved.