|
||||||||||
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.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
SaxRepresentation(MediaType mediaType)
Constructor. |
|
SaxRepresentation(MediaType mediaType,
Document xmlDocument)
Constructor. |
|
SaxRepresentation(MediaType mediaType,
InputSource xmlSource)
Constructor. |
|
SaxRepresentation(MediaType mediaType,
SAXSource xmlSource)
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. |
SAXSource |
getSaxSource()
Returns the SAX source that can be parsed by the parse(ContentHandler) method or used for an XSLT transformation. |
void |
parse(ContentHandler contentHandler)
Parses the source and sends SAX events to a content handler. |
void |
release()
Releases the namespaces map. |
void |
setSaxSource(SAXSource source)
Sets a SAX source that can be parsed by the parse(ContentHandler) method. |
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, getDocumentBuilder, getDomSource, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getSaxSource, getStreamSource, getText, isNamespaceAware, putNamespace, setNamespaceAware, validate, validate, validate, validate |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, getReader, write, write |
Methods inherited from class org.restlet.resource.Representation |
---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, getText, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType |
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 DOM document to parse.public SaxRepresentation(MediaType mediaType, InputSource xmlSource)
mediaType
- The representation's media type.xmlSource
- A SAX input source to parse.public SaxRepresentation(MediaType mediaType, SAXSource xmlSource)
mediaType
- The representation's media type.xmlSource
- A JAXP source to parse.public SaxRepresentation(Representation xmlRepresentation)
xmlRepresentation
- A source XML representation to parse.
IOException
Method Detail |
---|
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
public SAXSource getSaxSource() throws IOException
parse(ContentHandler)
method or used for an XSLT transformation.
getSaxSource
in class XmlRepresentation
IOException
public void parse(ContentHandler contentHandler) throws IOException
contentHandler
- The SAX content handler to use for parsing.
IOException
public void release()
release
in class XmlRepresentation
public void setSaxSource(SAXSource source)
parse(ContentHandler)
method.
source
- A SAX source.public void write(OutputStream outputStream) throws IOException
Representation
write
in class Representation
outputStream
- The output stream.
IOException
public void write(XmlWriter writer) throws IOException
writer
- The XML writer to write to.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |