Package org.mycore.common.content
Class MCRSAXContent
java.lang.Object
org.mycore.common.content.MCRContent
org.mycore.common.content.MCRXMLContent
org.mycore.common.content.MCRSAXContent
- Author:
- Thomas Scheffler (yagee)
-
Field Summary
Fields inherited from class org.mycore.common.content.MCRXMLContent
defaultFormat, format
Fields inherited from class org.mycore.common.content.MCRContent
docType, encoding, lastModified, length, mimeType, name, systemId, usingSession
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasXML()
Parses content, assuming it is XML, and returns the parsed document.Ensures that content is XML.Returns content as input stream.Return the content as Sourcevoid
setEncoding
(String encoding) Methods inherited from class org.mycore.common.content.MCRXMLContent
getETag, getMimeType, length, setFormat
Methods inherited from class org.mycore.common.content.MCRContent
asByteArray, asDataURL, asString, getContentInputStream, getDataURLEncoding, getDocType, getInputSource, getName, getReadableByteChannel, getReusableCopy, getSafeEncoding, getSimpleWeakETag, getSystemId, isReusable, isUsingSession, lastModified, sendTo, sendTo, sendTo, sendTo, setDocType, setLastModified, setMimeType, setName, setUsingSession
-
Constructor Details
-
MCRSAXContent
-
-
Method Details
-
getInputStream
Description copied from class:MCRContent
Returns content as input stream. Be sure to close this stream properly!- Overrides:
getInputStream
in classMCRXMLContent
- Returns:
- input stream to read content from
- Throws:
IOException
-
getSource
Description copied from class:MCRContent
Return the content as Source- Overrides:
getSource
in classMCRContent
- Returns:
- content as Source
- Throws:
IOException
-
ensureXML
Description copied from class:MCRContent
Ensures that content is XML. The content is parsed as if asXML() is called. When content is XML, an MCRContent instance is returned that guarantees that. When XML can not be parsed, an exception is thrown.- Overrides:
ensureXML
in classMCRXMLContent
-
asXML
Description copied from class:MCRContent
Parses content, assuming it is XML, and returns the parsed document.- Overrides:
asXML
in classMCRContent
- Returns:
- the XML document parsed from content
- Throws:
JDOMException
IOException
SAXException
-
setEncoding
- Overrides:
setEncoding
in classMCRXMLContent
- Throws:
UnsupportedEncodingException
-
getEncoding
- Overrides:
getEncoding
in classMCRContent
-