public class SaxRepresentation extends XmlRepresentation
Modifier and Type | Field and Description |
---|---|
static boolean |
XML_SECURE_PROCESSING
True for turning on secure parsing XML representations; default value
provided by system property "org.restlet.ext.xml.secureProcessing", true
by default.
|
XML_EXPANDING_ENTITY_REFS, XML_VALIDATING_DTD
UNKNOWN_SIZE
Constructor and Description |
---|
SaxRepresentation()
Default constructor.
|
SaxRepresentation(MediaType mediaType)
Constructor.
|
SaxRepresentation(MediaType mediaType,
org.w3c.dom.Document xmlDocument)
Constructor.
|
SaxRepresentation(MediaType mediaType,
org.xml.sax.InputSource xmlSource)
Constructor.
|
SaxRepresentation(MediaType mediaType,
javax.xml.transform.sax.SAXSource xmlSource)
Constructor.
|
SaxRepresentation(Representation xmlRepresentation)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.xml.sax.InputSource |
getInputSource()
Returns the XML representation as a SAX input source.
|
javax.xml.transform.sax.SAXSource |
getSaxSource()
Returns the SAX source that can be parsed by the
parse(ContentHandler) method or used for an XSLT transformation. |
boolean |
isSecureProcessing()
Indicates if it limits potential XML overflow attacks.
|
void |
parse(org.xml.sax.ContentHandler contentHandler)
Parses the source and sends SAX events to a content handler.
|
void |
release()
Releases the namespaces map.
|
void |
setSaxSource(javax.xml.transform.sax.SAXSource source)
Sets a SAX source that can be parsed by the
parse(ContentHandler) method. |
void |
setSecureProcessing(boolean secureProcessing)
Indicates if it limits potential XML overflow attacks.
|
void |
write(java.io.Writer writer) |
void |
write(XmlWriter writer)
Writes the representation to a XML writer.
|
getBoolean, getDocument, getDocumentBuilder, getDomSource, getEntityResolver, getErrorHandler, getNamespaces, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getSaxSource, getSchema, getStreamSource, getText, isCoalescing, isExpandingEntityRefs, isIgnoringComments, isIgnoringExtraWhitespaces, isNamespaceAware, isValidatingDtd, isXIncludeAware, setCoalescing, setEntityResolver, setErrorHandler, setExpandingEntityRefs, setIgnoringComments, setIgnoringExtraWhitespaces, setNamespaceAware, setNamespaces, setSchema, setSchema, setValidatingDtd, setXIncludeAware, validate, validate, validate, validate
getReader
getChannel, getStream, write, write
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
getModificationDate, getTag, setModificationDate, setTag
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
public static final boolean XML_SECURE_PROCESSING
public SaxRepresentation()
MediaType.TEXT_XML
media type.public SaxRepresentation(MediaType mediaType)
mediaType
- The representation media type.public SaxRepresentation(MediaType mediaType, org.w3c.dom.Document xmlDocument)
mediaType
- The representation's media type.xmlDocument
- A DOM document to parse.public SaxRepresentation(MediaType mediaType, org.xml.sax.InputSource xmlSource)
mediaType
- The representation's media type.xmlSource
- A SAX input source to parse.public SaxRepresentation(MediaType mediaType, javax.xml.transform.sax.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.public org.xml.sax.InputSource getInputSource() throws java.io.IOException
XmlRepresentation
getInputSource
in class XmlRepresentation
java.io.IOException
public javax.xml.transform.sax.SAXSource getSaxSource() throws java.io.IOException
parse(ContentHandler)
method or used for an XSLT transformation.getSaxSource
in class XmlRepresentation
java.io.IOException
public boolean isSecureProcessing()
public void parse(org.xml.sax.ContentHandler contentHandler) throws java.io.IOException
contentHandler
- The SAX content handler to use for parsing.java.io.IOException
public void release()
release
in class XmlRepresentation
public void setSaxSource(javax.xml.transform.sax.SAXSource source)
parse(ContentHandler)
method.source
- A SAX source.public void setSecureProcessing(boolean secureProcessing)
secureProcessing
- True if it limits potential XML overflow attacks.public void write(java.io.Writer writer) throws java.io.IOException
write
in class Representation
java.io.IOException
public void write(XmlWriter writer) throws java.io.IOException
parse(ContentHandler)
using the XmlWriter
parameter as the content handler. This behavior is intended to be
overridden.writer
- The XML writer to write to.java.io.IOException
Copyright © 2005-2020 Restlet.