|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.OutputRepresentation
org.restlet.resource.XmlRepresentation
org.restlet.resource.SaxRepresentation
public class SaxRepresentation
XML representation for SAX events processing. The purpose is to create a
streamable content based on a custom Java object model instead of a neutral
DOM tree. This domain object can then be directly modified and efficiently
serialized at a later time.
Subclasses only need to override the
ContentHandler methods required for the reading and also the write(XmlWriter
writer) method when serialization is requested.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Variant |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
SaxRepresentation(MediaType mediaType)
Constructor. |
|
SaxRepresentation(MediaType mediaType,
Document xmlDocument)
Constructor. |
|
SaxRepresentation(Representation xmlRepresentation)
Constructor. |
Method Summary | |
---|---|
Object |
evaluate(String expression,
QName returnType)
Evaluates an XPath expression and returns the result as in the given return type. |
void |
parse(ContentHandler contentHandler)
Parses the source and sends SAX events to a content handler. |
void |
write(OutputStream outputStream)
Writes the representation to a byte stream. |
void |
write(XmlWriter writer)
Writes the representation to a XML writer. |
Methods inherited from class org.restlet.resource.XmlRepresentation |
---|
getBoolean, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getText, isNamespaceAware, putNamespace, setNamespaceAware |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, write |
Methods inherited from class org.restlet.resource.Representation |
---|
getText, isAvailable, isTransient, setAvailable, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SaxRepresentation(MediaType mediaType)
mediaType
- The representation media type.public SaxRepresentation(MediaType mediaType, Document xmlDocument)
mediaType
- The representation's media type.xmlDocument
- A source DOM representation to parse.public SaxRepresentation(Representation xmlRepresentation) throws IOException
xmlRepresentation
- A source XML representation to parse.
IOException
Method Detail |
---|
public void parse(ContentHandler contentHandler) throws IOException
contentHandler
- The SAX content handler to use for parsing.
IOException
public void write(OutputStream outputStream) throws IOException
write
in class OutputRepresentation
outputStream
- The output stream.
IOException
public void write(XmlWriter writer) throws IOException
writer
- The XML writer to write to.
IOException
public Object evaluate(String expression, QName returnType) throws Exception
XmlRepresentation
evaluate
in class XmlRepresentation
returnType
- The qualified name of the return type.
Exception
XPathException
,
XPathConstants
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |