org.apache.axis.encoding

Class TextSerializationContext

Implemented Interfaces:
SerializationContext

public class TextSerializationContext
extends SerializationContext

For internal use only. Used to get the first text node of an element.
Author:
Jarek Gawor (gawor@apache.org)

Field Summary

Fields inherited from class org.apache.axis.encoding.SerializationContext

log, startOfDocument

Constructor Summary

TextSerializationContext(Writer writer)
Construct SerializationContext with associated writer
TextSerializationContext(Writer writer, MessageContext msgContext)
Construct SerializationContext with associated writer and MessageContext

Method Summary

void
endElement()
Writes the end element tag for the open element.
void
serialize(QName elemQName, Attributes attributes, Object value, QName xmlType, Boolean sendNull, Boolean sendType)
Serialize the indicated value as an element with the name indicated by elemQName.
void
startElement(QName qName, Attributes attributes)
Writes (using the Writer) the start tag for element QName along with the indicated attributes and namespace mappings.
void
writeChars(char[] p1, int p2, int p3)
Convenience operation to write out (to Writer) the characters in p1 starting at index p2 for length p3.
void
writeDOMElement(Element el)
Output a DOM representation to a SerializationContext
void
writeString(String string)
Convenience operation to write out (to Writer) the String

Methods inherited from class org.apache.axis.encoding.SerializationContext

attributeQName2String, endElement, getCurrentMessage, getCurrentXMLType, getDoMultiRefs, getEncoder, getEncoding, getEncodingStyle, getItemQName, getItemType, getMessageContext, getPrefixForURI, getPrefixForURI, getPrefixForURI, getPretty, getQNameForClass, getSerializerForJavaType, getTypeMapping, getTypeMappingRegistry, getValueAsString, isEncoded, isPrimitive, outputMultiRefs, qName2String, qName2String, registerPrefixForURI, serialize, serialize, serialize, serialize, serialize, serialize, setDoMultiRefs, setEncoding, setItemQName, setItemType, setPretty, setSendDecl, setTypeAttribute, setWriteXMLType, shouldSendXSIType, startElement, writeChars, writeDOMElement, writeSafeString, writeString, writeXMLDeclaration

Constructor Details

TextSerializationContext

public TextSerializationContext(Writer writer)
Construct SerializationContext with associated writer
Parameters:
writer - java.io.Writer

TextSerializationContext

public TextSerializationContext(Writer writer,
                                MessageContext msgContext)
Construct SerializationContext with associated writer and MessageContext
Parameters:
writer - java.io.Writer
msgContext - is the MessageContext

Method Details

endElement

public void endElement()
            throws IOException
Writes the end element tag for the open element.
Overrides:
endElement in interface SerializationContext

serialize

public void serialize(QName elemQName,
                      Attributes attributes,
                      Object value,
                      QName xmlType,
                      Boolean sendNull,
                      Boolean sendType)
            throws IOException
Serialize the indicated value as an element with the name indicated by elemQName. The attributes are additional attribute to be serialized on the element. The value is the object being serialized. (It may be serialized directly or serialized as an mult-ref'd item) The value is an Object, which may be a wrapped primitive. The xmlType (if specified) is the QName of the type that is used to set xsi:type. The sendNull flag indicates whether to end an element with an xsi:nil="true" attribute for null variables (if Boolean.TRUE), or nothing (if Boolean.FALSE). The sendType flag indicates whether the xsi:type flag should be sent (default is true).
Overrides:
serialize in interface SerializationContext
Parameters:
elemQName - is the QName of the element
attributes - are additional attributes
value - is the object to serialize
xmlType - is the qname of the type or null.
sendNull - determines whether to send null values.
sendType - determines whether to set xsi:type attribute.

startElement

public void startElement(QName qName,
                         Attributes attributes)
            throws IOException
Writes (using the Writer) the start tag for element QName along with the indicated attributes and namespace mappings.
Overrides:
startElement in interface SerializationContext
Parameters:
qName - is the name of the element
attributes - are the attributes to write

writeChars

public void writeChars(char[] p1,
                       int p2,
                       int p3)
            throws IOException
Convenience operation to write out (to Writer) the characters in p1 starting at index p2 for length p3.
Overrides:
writeChars in interface SerializationContext
Parameters:
p1 - character array to write
p2 - starting index in array
p3 - length to write

writeDOMElement

public void writeDOMElement(Element el)
            throws IOException
Output a DOM representation to a SerializationContext
Overrides:
writeDOMElement in interface SerializationContext
Parameters:
el - is a DOM Element

writeString

public void writeString(String string)
            throws IOException
Convenience operation to write out (to Writer) the String
Overrides:
writeString in interface SerializationContext
Parameters:
string - is the String to write.

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.