| java.lang.Object org.apache.cocoon.components.serializers.EncodingSerializer
All known Subclasses: org.apache.cocoon.components.serializers.XMLSerializer,
EncodingSerializer | abstract public class EncodingSerializer implements Serializer,Locator,Recyclable,Configurable(Code) | | An abstract serializer supporting multiple encodings.
This serializer can accept the following configuration whenever it
is declared into a sitemap:
<serializer class="org.apache.cocoon.components.serializers..." ... >
<encoding>myencoding</encoding>
<indent>myindenting</indent>
</serializer>
The value indicated by myencoding must be replaced with a valid
charset encoding (this serializer does not rely on the JVM for character
encoding, you can look into the cocoon-serializers-charsets
JAR file for a list).
The value indicated by myindenting will control the indenting
level for each element.
version: CVS $Id: EncodingSerializer.java 433543 2006-08-22 06:22:54Z crossley $ |
Field Summary | |
final public static int | ATTRIBUTE_LENGTH The length of the array of strings representing an attribute. | final public static int | ATTRIBUTE_LOCAL The position of the local name in the attributes array. | final public static int | ATTRIBUTE_NSURI The position of the namespace URI in the attributes array. | final public static int | ATTRIBUTE_QNAME The position of the qualified name in the attributes array. | final public static int | ATTRIBUTE_VALUE The position of the value in the attributes array. | protected Charset | charset The Charset associated with the character encoding. | protected int | indentPerLevel | protected Namespaces | namespaces The Namespace associated with this instance. |
Method Summary | |
abstract public void | body(String uri, String local, String qual) Receive notification of the beginning of the document body. | public void | characters(char ch, int start, int length) | abstract public void | charactersImpl(char ch, int start, int length) | public void | configure(Configuration conf) Set the configurations for this serializer. | protected void | encode(String data) | protected void | encode(char data) Encode and write an array of characters. | protected void | encode(char data, int start, int length) Encode and write a specific part of an array of characters. | public void | endDocument() Receive notification of the end of a document. | public void | endElement(String nsuri, String local, String qual) Receive notification of the end of an element. | abstract public void | endElementImpl(String uri, String local, String qual) Receive notification of the end of an element. | public void | endPrefixMapping(String prefix) End the scope of a prefix-URI mapping. | protected void | flush() Flush the stream. | public int | getColumnNumber() Return the column number where the current document event ends. | public int | getLineNumber() Return the line number where the current document event ends. | protected String | getLocation() Return a String describing the current location. | public String | getPublicId() Return the public identifier for the current document event. | public String | getSystemId() Return the system identifier for the current document event. | public void | recycle() Reset this EncodingSerializer . | final public void | setDocumentLocator(Locator locator) Receive an object for locating the origin of SAX document events. | public void | setOutputStream(OutputStream out) Set the OutputStream where this serializer will
write data to. | public boolean | shouldSetContentLength() Test if the component wants to set the content length. | public void | startDocument() Receive notification of the beginning of a document. | public void | startElement(String nsuri, String local, String qual, Attributes attributes) Receive notification of the beginning of an element. | abstract public void | startElementImpl(String uri, String local, String qual, String namespaces, String attributes) Receive notification of the beginning of an element. | public void | startPrefixMapping(String prefix, String uri) Begin the scope of a prefix-URI Namespace mapping. | protected void | write(char data) Write an array of characters. | protected void | write(char data, int start, int length) Write a portion of an array of characters. | protected void | write(int c) Write a single character. | protected void | write(String data) Write a string. | protected void | write(String data, int start, int length) Write a portion of a string. | protected void | writeIndent(int indent) | protected void | writeln() Write a end-of-line character. | protected void | writeln(String data) Write a string and a end-of-line character. |
ATTRIBUTE_LENGTH | final public static int ATTRIBUTE_LENGTH(Code) | | The length of the array of strings representing an attribute.
|
ATTRIBUTE_LOCAL | final public static int ATTRIBUTE_LOCAL(Code) | | The position of the local name in the attributes array.
|
ATTRIBUTE_NSURI | final public static int ATTRIBUTE_NSURI(Code) | | The position of the namespace URI in the attributes array.
|
ATTRIBUTE_QNAME | final public static int ATTRIBUTE_QNAME(Code) | | The position of the qualified name in the attributes array.
|
ATTRIBUTE_VALUE | final public static int ATTRIBUTE_VALUE(Code) | | The position of the value in the attributes array.
|
charset | protected Charset charset(Code) | | The Charset associated with the character encoding.
|
indentPerLevel | protected int indentPerLevel(Code) | | Per level indent spaces
|
namespaces | protected Namespaces namespaces(Code) | | The Namespace associated with this instance.
|
EncodingSerializer | protected EncodingSerializer(Encoder encoder)(Code) | | Create a new instance of this EncodingSerializer
|
body | abstract public void body(String uri, String local, String qual) throws SAXException(Code) | | Receive notification of the beginning of the document body.
Parameters: uri - The namespace URI of the root element. Parameters: local - The local name of the root element. Parameters: qual - The fully-qualified name of the root element. |
characters | public void characters(char ch, int start, int length) throws SAXException(Code) | | |
charactersImpl | abstract public void charactersImpl(char ch, int start, int length) throws SAXException(Code) | | Receive character notifications
Parameters: ch - Parameters: start - Parameters: length - throws: SAXException - |
configure | public void configure(Configuration conf) throws ConfigurationException(Code) | | Set the configurations for this serializer.
|
encode | protected void encode(char data) throws SAXException(Code) | | Encode and write an array of characters.
|
encode | protected void encode(char data, int start, int length) throws SAXException(Code) | | Encode and write a specific part of an array of characters.
|
endDocument | public void endDocument() throws SAXException(Code) | | Receive notification of the end of a document.
|
endElementImpl | abstract public void endElementImpl(String uri, String local, String qual) throws SAXException(Code) | | Receive notification of the end of an element.
Parameters: uri - The namespace URI of the root element. Parameters: local - The local name of the root element. Parameters: qual - The fully-qualified name of the root element. |
endPrefixMapping | public void endPrefixMapping(String prefix) throws SAXException(Code) | | End the scope of a prefix-URI mapping.
|
getColumnNumber | public int getColumnNumber()(Code) | | Return the column number where the current document event ends.
The column number, or -1 if none is available. |
getLineNumber | public int getLineNumber()(Code) | | Return the line number where the current document event ends.
The line number, or -1 if none is available. |
getLocation | protected String getLocation()(Code) | | Return a String describing the current location.
|
getPublicId | public String getPublicId()(Code) | | Return the public identifier for the current document event.
A String containing the public identifier,or null if none is available. |
getSystemId | public String getSystemId()(Code) | | Return the system identifier for the current document event.
A String containing the system identifier,or null if none is available. |
recycle | public void recycle()(Code) | | Reset this EncodingSerializer .
|
setDocumentLocator | final public void setDocumentLocator(Locator locator)(Code) | | Receive an object for locating the origin of SAX document events.
|
setOutputStream | public void setOutputStream(OutputStream out) throws IOException(Code) | | Set the OutputStream where this serializer will
write data to.
Parameters: out - The OutputStream used for output. |
shouldSetContentLength | public boolean shouldSetContentLength()(Code) | | Test if the component wants to set the content length.
|
startDocument | public void startDocument() throws SAXException(Code) | | Receive notification of the beginning of a document.
|
startElementImpl | abstract public void startElementImpl(String uri, String local, String qual, String namespaces, String attributes) throws SAXException(Code) | | Receive notification of the beginning of an element.
Parameters: uri - The namespace URI of the root element. Parameters: local - The local name of the root element. Parameters: qual - The fully-qualified name of the root element. Parameters: namespaces - An array of String objects containingthe namespaces to be declared by this element. Parameters: attributes - An array of String objects containingall attributes of this element. |
startPrefixMapping | public void startPrefixMapping(String prefix, String uri) throws SAXException(Code) | | Begin the scope of a prefix-URI Namespace mapping.
|
write | protected void write(char data) throws SAXException(Code) | | Write an array of characters.
|
write | protected void write(char data, int start, int length) throws SAXException(Code) | | Write a portion of an array of characters.
|
writeIndent | protected void writeIndent(int indent) throws SAXException(Code) | | Write out character to indent the output according
to the level of nesting
Parameters: indent - throws: SAXException - |
|
|