org.apache.axis.encoding
public class SerializationContext extends Object implements SerializationContext
Field Summary | |
---|---|
protected static Log | log |
protected boolean | startOfDocument The flag whether the XML decl should be written |
Constructor Summary | |
---|---|
SerializationContext(Writer writer)
Construct SerializationContext with associated writer | |
SerializationContext(Writer writer, MessageContext msgContext)
Construct SerializationContext with associated writer and MessageContext |
Method Summary | |
---|---|
String | attributeQName2String(QName qName)
Convert attribute QName to a string of the form |
void | endElement()
Writes the end element tag for the open element.
|
Message | getCurrentMessage()
Return the current message |
QName | getCurrentXMLType()
Get the currently prefered xmlType |
boolean | getDoMultiRefs()
Are we doing multirefs? |
XMLEncoder | getEncoder() |
String | getEncoding()
get the encoding for the serialization |
String | getEncodingStyle()
Returns this context's encoding style. |
QName | getItemQName() |
QName | getItemType() |
MessageContext | getMessageContext()
Get the MessageContext we're operating with |
String | getPrefixForURI(String uri)
Get a prefix for a namespace URI. |
String | getPrefixForURI(String uri, String defaultPrefix)
Get a prefix for the given namespace URI. |
String | getPrefixForURI(String uri, String defaultPrefix, boolean attribute)
Get a prefix for the given namespace URI. |
boolean | getPretty()
Get whether the serialization should be pretty printed. |
QName | getQNameForClass(Class cls)
Get the QName associated with the specified class. |
Serializer | getSerializerForJavaType(Class javaType)
Convenience method to get the Serializer for a specific
java type |
TypeMapping | getTypeMapping()
Get the TypeMapping we're using. |
TypeMappingRegistry | getTypeMappingRegistry()
Get the TypeMappingRegistry we're using. |
String | getValueAsString(Object value, QName xmlType) |
boolean | isEncoded()
Returns whether this context should be encoded or not.
|
boolean | isPrimitive(Object value)
Indicates whether the object should be interpretted as a primitive
for the purposes of multi-ref processing. |
void | outputMultiRefs()
The serialize method uses hrefs to reference all non-primitive
values. |
String | qName2String(QName qName, boolean writeNS)
Convert QName to a string of the form |
String | qName2String(QName qName) |
void | registerPrefixForURI(String prefix, String uri)
Register prefix for the indicated uri |
void | serialize(QName elemQName, Attributes attributes, Object value)
Serialize the indicated value as an element with the name
indicated by elemQName.
|
void | serialize(QName elemQName, Attributes attributes, Object value, QName xmlType)
Serialize the indicated value as an element with the name
indicated by elemQName.
|
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 | 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 | setDoMultiRefs(boolean shouldDo)
Set whether we are doing multirefs |
void | setEncoding(String encoding)
set the encoding for the serialization |
void | setItemQName(QName itemQName) |
void | setItemType(QName itemType) |
void | setPretty(boolean pretty)
Indicate whether the serialization should be pretty printed. |
void | setSendDecl(boolean sendDecl)
Set whether or not we should write XML declarations. |
Attributes | setTypeAttribute(Attributes attributes, QName type)
Obtains the type attribute that should be serialized and returns the new list of Attributes |
void | setWriteXMLType(QName type) |
boolean | shouldSendXSIType()
Get whether or not to write xsi:type attributes. |
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 | writeSafeString(String string)
Convenience operation to write out (to Writer) the String
properly encoded with xml entities (like &) |
void | writeString(String string)
Convenience operation to write out (to Writer) the String |
void | writeXMLDeclaration() |
Parameters: writer java.io.Writer
Parameters: writer java.io.Writer msgContext is the MessageContext
Parameters: qName QName
Returns: prefixed qname representation for serialization.
Returns: QName of xmlType or null
Returns: true or false
Returns:
Returns: a String
value
Parameters: uri is the namespace uri
Returns: prefix
Returns: true/false
Parameters: cls Class of an object requiring serialization.
Returns: appropriate QName associated with the class.
Parameters: javaType is Class for a type to serialize
Returns: Serializer
Returns: TypeMapping or null
Returns: TypeMapping or null
Returns: a boolean
value
Parameters: value to be serialized
Returns: true/false
Parameters: qName
Returns: prefixed qname representation for serialization.
Parameters: prefix uri is the namespace uri
Parameters: elemQName is the QName of the element attributes are additional attributes value is the object to serialize
Parameters: elemQName is the QName of the element attributes are additional attributes value is the object to serialize
Deprecated: use serialize(QName, Attributes, Object, QName, Boolean, Boolean) instead.
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 null values should be sent over the wire (default is to send such values with xsi:nil="true"). The sendType flag indicates whether the xsi:type flag should be sent (default is true).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.
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.
Parameters: pretty true/false
Parameters: sendDecl true/false
Parameters: attributes of the qname type is the qname of the type
Returns: new list of Attributes
Returns: true/false
Parameters: qName is the name of the element attributes are the attributes to write
Parameters: p1 character array to write p2 starting index in array p3 length to write
Parameters: el is a DOM Element
Parameters: string is the String to write.
Parameters: string is the String to write.