|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.serializers.EncodingSerializer org.apache.cocoon.components.serializers.XMLSerializer
public class XMLSerializer
A fancy XML serializer not relying on the JAXP API.
For configuration options of this serializer, please look at the
EncodingSerializer
.
Field Summary | |
---|---|
protected DocType |
doctype
The DocType instance representing the document. |
Fields inherited from class org.apache.cocoon.components.serializers.EncodingSerializer |
---|
ATTRIBUTE_LENGTH, ATTRIBUTE_LOCAL, ATTRIBUTE_NSURI, ATTRIBUTE_QNAME, ATTRIBUTE_VALUE, charset, indentPerLevel, namespaces |
Fields inherited from interface org.apache.cocoon.serialization.Serializer |
---|
ROLE |
Constructor Summary | |
---|---|
|
XMLSerializer()
Create a new instance of this XMLSerializer |
protected |
XMLSerializer(XMLEncoder encoder)
Create a new instance of this XMLSerializer |
Method Summary | |
---|---|
void |
body(String uri,
String local,
String qual)
Receive notification of the beginning of the document body. |
void |
charactersImpl(char[] data,
int start,
int length)
Receive notification of character data. |
protected boolean |
closeElement(boolean end_element)
Write the end part of a start element (if necessary). |
void |
comment(char[] data,
int start,
int length)
Report an XML comment anywhere in the document. |
void |
endCDATA()
Report the end of a CDATA section. |
void |
endDocument()
Receive notification of the end of a document. |
void |
endDTD()
Report the start of DTD declarations, if any. |
void |
endElementImpl(String uri,
String local,
String qual)
Receive notification of the end of an element. |
void |
endEntity(String name)
Report the end of an entity. |
String |
getMimeType()
Return the MIME Content-Type produced by this serializer. |
protected void |
head()
Write the XML document header. |
void |
ignorableWhitespace(char[] data,
int start,
int length)
Receive notification of ignorable whitespace in element content. |
void |
processingInstruction(String target,
String data)
Receive notification of a processing instruction. |
void |
recycle()
Reset this XMLSerializer . |
void |
skippedEntity(String name)
Receive notification of a skipped entity. |
void |
startCDATA()
Report the start of a CDATA section. |
void |
startDocument()
Receive notification of the beginning of a document. |
void |
startDTD(String name,
String public_id,
String system_id)
Report the start of DTD declarations, if any. |
void |
startElementImpl(String uri,
String local,
String qual,
String[][] namespaces,
String[][] attributes)
Receive notification of the beginning of an element. |
void |
startEntity(String name)
Report the beginning of some internal and external XML entities. |
Methods inherited from class org.apache.cocoon.components.serializers.EncodingSerializer |
---|
characters, configure, encode, encode, encode, endElement, endPrefixMapping, flush, getColumnNumber, getLineNumber, getLocation, getPublicId, getSystemId, setDocumentLocator, setOutputStream, shouldSetContentLength, startElement, startPrefixMapping, write, write, write, write, write, writeIndent, writeln, writeln |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DocType doctype
DocType
instance representing the document.
Constructor Detail |
---|
public XMLSerializer()
XMLSerializer
protected XMLSerializer(XMLEncoder encoder)
XMLSerializer
Method Detail |
---|
public void recycle()
XMLSerializer
.
recycle
in interface Recyclable
recycle
in class EncodingSerializer
public String getMimeType()
AbstractProcessingPipeline.setMimeTypeForSerializer(org.apache.cocoon.environment.Environment)
,
AbstractProcessingPipeline.setMimeTypeForReader(org.apache.cocoon.environment.Environment)
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class EncodingSerializer
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class EncodingSerializer
SAXException
protected void head() throws SAXException
This method will write out the <?xml version="1.0"
...>
header.
SAXException
public void startDTD(String name, String public_id, String system_id) throws SAXException
SAXException
public void endDTD() throws SAXException
SAXException
public void body(String uri, String local, String qual) throws SAXException
body
in class EncodingSerializer
uri
- The namespace URI of the root element.local
- The local name of the root element.qual
- The fully-qualified name of the root element.
SAXException
public void startElementImpl(String uri, String local, String qual, String[][] namespaces, String[][] attributes) throws SAXException
startElementImpl
in class EncodingSerializer
uri
- The namespace URI of the root element.local
- The local name of the root element.qual
- The fully-qualified name of the root element.namespaces
- An array of String
objects containing
the namespaces to be declared by this element.attributes
- An array of String
objects containing
all attributes of this element.
SAXException
public void endElementImpl(String uri, String local, String qual) throws SAXException
endElementImpl
in class EncodingSerializer
uri
- The namespace URI of the root element.local
- The local name of the root element.qual
- The fully-qualified name of the root element.
SAXException
protected boolean closeElement(boolean end_element) throws SAXException
end_element
- Whether this method was called because an element
is being closed or not.
</element>
is required.
SAXException
public void startCDATA() throws SAXException
SAXException
public void endCDATA() throws SAXException
SAXException
public void charactersImpl(char[] data, int start, int length) throws SAXException
charactersImpl
in class EncodingSerializer
SAXException
public void ignorableWhitespace(char[] data, int start, int length) throws SAXException
SAXException
public void comment(char[] data, int start, int length) throws SAXException
SAXException
public void processingInstruction(String target, String data) throws SAXException
SAXException
public void startEntity(String name) throws SAXException
SAXException
public void endEntity(String name) throws SAXException
SAXException
public void skippedEntity(String name) throws SAXException
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |