|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.axis.encoding.SerializationContextImpl
Manage a serialization, including keeping track of namespace mappings and element stacks.
| Constructor Summary | |
SerializationContextImpl(Writer writer)
Construct SerializationContextImpl with associated writer |
|
SerializationContextImpl(Writer writer,
MessageContext msgContext)
Construct SerializationContextImpl with associated writer and MessageContext |
|
| Method Summary | |
String |
attributeQName2String(javax.xml.namespace.QName qName)
Convert attribute QName to a string of the form |
void |
endDocument()
Output anything in the end. |
void |
endElement()
Writes the end element tag for the open element. |
Message |
getCurrentMessage()
Return the current message |
javax.xml.namespace.QName |
getCurrentXMLType()
Get the currently prefered xmlType |
boolean |
getDoMultiRefs()
Are we doing multirefs? |
Stack |
getElementStack()
Get the stack of element qnames. |
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. |
javax.xml.namespace.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,
javax.xml.namespace.QName xmlType)
|
boolean |
isNoDefaultNamespace()
Get whether or not to write the default namespace. |
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(javax.xml.namespace.QName qName)
Convert QName to a string of the form |
String |
qName2String(javax.xml.namespace.QName qName,
boolean writeNS)
Convert QName to a string of the form |
void |
registerPrefixForURI(String prefix,
String uri)
Register prefix for the indicated uri |
void |
serialize(javax.xml.namespace.QName elemQName,
Attributes attributes,
Object value)
Serialize the indicated value as an element with the name indicated by elemQName. |
void |
serialize(javax.xml.namespace.QName elemQName,
Attributes attributes,
Object value,
javax.xml.namespace.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 |
setNoDefaultNamespace(boolean noDefaultNamespace)
Set whether or not to write the default namespace. |
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,
javax.xml.namespace.QName type)
Obtains the type attribute that should be serialized and returns the new list of Attributes |
boolean |
shouldSendXSIType()
Get whether or not to write xsi:type attributes. |
void |
startDocument()
Output anything in the beginning. |
void |
startElement(javax.xml.namespace.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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SerializationContextImpl(Writer writer)
writer - java.io.Writerpublic SerializationContextImpl(Writer writer, MessageContext msgContext)
writer - java.io.WritermsgContext - is the MessageContext| Method Detail |
public boolean getPretty()
getPretty in interface SerializationContextpublic void setPretty(boolean pretty)
setPretty in interface SerializationContextpretty - true/falsepublic boolean getDoMultiRefs()
getDoMultiRefs in interface SerializationContextpublic void setDoMultiRefs(boolean shouldDo)
setDoMultiRefs in interface SerializationContextshouldDo - true/falsepublic void setSendDecl(boolean sendDecl)
setSendDecl in interface SerializationContextsendDecl - true/falsepublic boolean shouldSendXSIType()
shouldSendXSIType in interface SerializationContextpublic boolean isNoDefaultNamespace()
isNoDefaultNamespace in interface SerializationContextpublic void setNoDefaultNamespace(boolean noDefaultNamespace)
setNoDefaultNamespace in interface SerializationContextpublic TypeMapping getTypeMapping()
getTypeMapping in interface SerializationContextpublic TypeMappingRegistry getTypeMappingRegistry()
getTypeMappingRegistry in interface SerializationContextpublic String getPrefixForURI(String uri)
getPrefixForURI in interface SerializationContexturi - is the namespace uri
public String getPrefixForURI(String uri, String defaultPrefix)
getPrefixForURI in interface SerializationContexturi - is the namespace uridefaultPrefix - optional parameter which is the default prefix
public String getPrefixForURI(String uri, String defaultPrefix, boolean attribute)
public void registerPrefixForURI(String prefix, String uri)
registerPrefixForURI in interface SerializationContextprefix - uri - is the namespace uripublic Message getCurrentMessage()
getCurrentMessage in interface SerializationContextpublic MessageContext getMessageContext()
getMessageContext in interface SerializationContextpublic String qName2String(javax.xml.namespace.QName qName, boolean writeNS)
qName -
public String qName2String(javax.xml.namespace.QName qName)
SerializationContext
qName2String in interface SerializationContextqName -
public String attributeQName2String(javax.xml.namespace.QName qName)
attributeQName2String in interface SerializationContextqName - QName
public javax.xml.namespace.QName getQNameForClass(Class cls)
getQNameForClass in interface SerializationContextcls - Class of an object requiring serialization.
public boolean isPrimitive(Object value)
isPrimitive in interface SerializationContextvalue - to be serialized
public void serialize(javax.xml.namespace.QName elemQName,
Attributes attributes,
Object value)
throws IOException
serialize in interface SerializationContextelemQName - is the QName of the elementattributes - are additional attributesvalue - is the object to serialize
IOException
public void serialize(javax.xml.namespace.QName elemQName,
Attributes attributes,
Object value,
javax.xml.namespace.QName xmlType,
boolean sendNull,
Boolean sendType)
throws IOException
serialize in interface SerializationContextelemQName - is the QName of the elementattributes - are additional attributesvalue - is the object to serializexmlType - is the qname of the type or null.sendNull - determines whether to send null values.sendType - determines whether to set xsi:type attribute.
IOException
public void outputMultiRefs()
throws IOException
outputMultiRefs in interface SerializationContextIOException
public void startDocument()
throws IOException
SerializationContext
startDocument in interface SerializationContextIOException
public void endDocument()
throws IOException
SerializationContext
endDocument in interface SerializationContextIOException
public void startElement(javax.xml.namespace.QName qName,
Attributes attributes)
throws IOException
startElement in interface SerializationContextqName - is the name of the elementattributes - are the attributes to write
IOException
public void endElement()
throws IOException
endElement in interface SerializationContextIOException
public void writeChars(char[] p1,
int p2,
int p3)
throws IOException
writeChars in interface SerializationContextp1 - character array to writep2 - starting index in arrayp3 - length to write
IOExceptionpublic void writeString(String string) throws IOException
writeString in interface SerializationContextstring - is the String to write.
IOExceptionpublic void writeSafeString(String string) throws IOException
writeSafeString in interface SerializationContextstring - is the String to write.
IOExceptionpublic void writeDOMElement(Element el) throws IOException
writeDOMElement in interface SerializationContextel - is a DOM Element
IOExceptionpublic final Serializer getSerializerForJavaType(Class javaType)
getSerializerForJavaType in interface SerializationContextjavaType - is Class for a type to serialize
public Attributes setTypeAttribute(Attributes attributes, javax.xml.namespace.QName type)
setTypeAttribute in interface SerializationContextattributes - of the qnametype - is the qname of the type
public javax.xml.namespace.QName getCurrentXMLType()
getCurrentXMLType in interface SerializationContextpublic String getValueAsString(Object value, javax.xml.namespace.QName xmlType) throws IOException
getValueAsString in interface SerializationContextIOExceptionpublic Stack getElementStack()
getElementStack in interface SerializationContext
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||