|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.axis.encoding.SerializationContextImpl
Manage a serialization, including keeping track of namespace mappings and element stacks.
| Constructor Summary | |
SerializationContextImpl(java.io.Writer writer)
Construct SerializationContextImpl with associated writer |
|
SerializationContextImpl(java.io.Writer writer,
MessageContext (src) msgContext)
Construct SerializationContextImpl with associated writer and MessageContext |
|
| Method Summary | |
java.lang.String |
attributeQName2String(QName (src) 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 (src) |
getCurrentMessage()
Return the current message |
QName (src) |
getCurrentXMLType()
Get the currently prefered xmlType |
boolean |
getDoMultiRefs()
Are we doing multirefs? |
java.util.Stack |
getElementStack()
Get the stack of element qnames. |
MessageContext (src) |
getMessageContext()
Get the MessageContext we're operating with |
java.lang.String |
getPrefixForURI(java.lang.String uri)
Get a prefix for a namespace URI. |
java.lang.String |
getPrefixForURI(java.lang.String uri,
java.lang.String defaultPrefix)
Get a prefix for the given namespace URI. |
java.lang.String |
getPrefixForURI(java.lang.String uri,
java.lang.String defaultPrefix,
boolean attribute)
Get a prefix for the given namespace URI. |
boolean |
getPretty()
Get whether the serialization should be pretty printed. |
QName (src) |
getQNameForClass(java.lang.Class cls)
Get the QName associated with the specified class. |
Serializer (src) |
getSerializerForJavaType(java.lang.Class javaType)
Convenience method to get the Serializer for a specific java type |
TypeMapping (src) |
getTypeMapping()
Get the TypeMapping we're using. |
TypeMappingRegistry (src) |
getTypeMappingRegistry()
Get the TypeMappingRegistry we're using. |
java.lang.String |
getValueAsString(java.lang.Object value,
QName (src) xmlType)
|
boolean |
isNoDefaultNamespace()
Get whether or not to write the default namespace. |
boolean |
isPrimitive(java.lang.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. |
java.lang.String |
qName2String(QName (src) qName)
Convert QName to a string of the form |
java.lang.String |
qName2String(QName (src) qName,
boolean writeNS)
Convert QName to a string of the form |
void |
registerPrefixForURI(java.lang.String prefix,
java.lang.String uri)
Register prefix for the indicated uri |
void |
serialize(QName (src) elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value)
Serialize the indicated value as an element with the name indicated by elemQName. |
void |
serialize(QName (src) elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value,
QName (src) xmlType,
boolean sendNull,
java.lang.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. |
org.xml.sax.Attributes |
setTypeAttribute(org.xml.sax.Attributes attributes,
QName (src) 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(QName (src) qName,
org.xml.sax.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(org.w3c.dom.Element el)
Output a DOM representation to a SerializationContext |
void |
writeSafeString(java.lang.String string)
Convenience operation to write out (to Writer) the String properly encoded with xml entities (like &) |
void |
writeString(java.lang.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(java.io.Writer writer)
writer - java.io.Writer
public SerializationContextImpl(java.io.Writer writer,
MessageContext (src) msgContext)
writer - java.io.WritermsgContext - is the MessageContext| Method Detail |
public boolean getPretty()
getPretty in interface SerializationContext (src) public void setPretty(boolean pretty)
setPretty in interface SerializationContext (src) pretty - true/falsepublic boolean getDoMultiRefs()
getDoMultiRefs in interface SerializationContext (src) public void setDoMultiRefs(boolean shouldDo)
setDoMultiRefs in interface SerializationContext (src) shouldDo - true/falsepublic void setSendDecl(boolean sendDecl)
setSendDecl in interface SerializationContext (src) sendDecl - true/falsepublic boolean shouldSendXSIType()
shouldSendXSIType in interface SerializationContext (src) public boolean isNoDefaultNamespace()
isNoDefaultNamespace in interface SerializationContext (src) public void setNoDefaultNamespace(boolean noDefaultNamespace)
setNoDefaultNamespace in interface SerializationContext (src) public TypeMapping (src) getTypeMapping()
getTypeMapping in interface SerializationContext (src) public TypeMappingRegistry (src) getTypeMappingRegistry()
getTypeMappingRegistry in interface SerializationContext (src) public java.lang.String getPrefixForURI(java.lang.String uri)
getPrefixForURI in interface SerializationContext (src) uri - is the namespace uri
public java.lang.String getPrefixForURI(java.lang.String uri,
java.lang.String defaultPrefix)
getPrefixForURI in interface SerializationContext (src) uri - is the namespace uridefaultPrefix - optional parameter which is the default prefix
public java.lang.String getPrefixForURI(java.lang.String uri,
java.lang.String defaultPrefix,
boolean attribute)
public void registerPrefixForURI(java.lang.String prefix,
java.lang.String uri)
registerPrefixForURI in interface SerializationContext (src) prefix - uri - is the namespace uripublic Message (src) getCurrentMessage()
getCurrentMessage in interface SerializationContext (src) public MessageContext (src) getMessageContext()
getMessageContext in interface SerializationContext (src)
public java.lang.String qName2String(QName (src) qName,
boolean writeNS)
qName -
public java.lang.String qName2String(QName (src) qName)
SerializationContext (src)
qName2String in interface SerializationContext (src) qName -
public java.lang.String attributeQName2String(QName (src) qName)
attributeQName2String in interface SerializationContext (src) qName - QName
public QName (src) getQNameForClass(java.lang.Class cls)
getQNameForClass in interface SerializationContext (src) cls - Class of an object requiring serialization.
public boolean isPrimitive(java.lang.Object value)
isPrimitive in interface SerializationContext (src) value - to be serialized
public void serialize(QName (src) elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value)
throws java.io.IOException
serialize in interface SerializationContext (src) elemQName - is the QName of the elementattributes - are additional attributesvalue - is the object to serialize
java.io.IOException
public void serialize(QName (src) elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value,
QName (src) xmlType,
boolean sendNull,
java.lang.Boolean sendType)
throws java.io.IOException
serialize in interface SerializationContext (src) elemQName - 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.
java.io.IOException
public void outputMultiRefs()
throws java.io.IOException
outputMultiRefs in interface SerializationContext (src) java.io.IOException
public void startDocument()
throws java.io.IOException
SerializationContext (src)
startDocument in interface SerializationContext (src) java.io.IOException
public void endDocument()
throws java.io.IOException
SerializationContext (src)
endDocument in interface SerializationContext (src) java.io.IOException
public void startElement(QName (src) qName,
org.xml.sax.Attributes attributes)
throws java.io.IOException
startElement in interface SerializationContext (src) qName - is the name of the elementattributes - are the attributes to write
java.io.IOException
public void endElement()
throws java.io.IOException
endElement in interface SerializationContext (src) java.io.IOException
public void writeChars(char[] p1,
int p2,
int p3)
throws java.io.IOException
writeChars in interface SerializationContext (src) p1 - character array to writep2 - starting index in arrayp3 - length to write
java.io.IOException
public void writeString(java.lang.String string)
throws java.io.IOException
writeString in interface SerializationContext (src) string - is the String to write.
java.io.IOException
public void writeSafeString(java.lang.String string)
throws java.io.IOException
writeSafeString in interface SerializationContext (src) string - is the String to write.
java.io.IOException
public void writeDOMElement(org.w3c.dom.Element el)
throws java.io.IOException
writeDOMElement in interface SerializationContext (src) el - is a DOM Element
java.io.IOExceptionpublic final Serializer (src) getSerializerForJavaType(java.lang.Class javaType)
getSerializerForJavaType in interface SerializationContext (src) javaType - is Class for a type to serialize
public org.xml.sax.Attributes setTypeAttribute(org.xml.sax.Attributes attributes,
QName (src) type)
setTypeAttribute in interface SerializationContext (src) attributes - of the qnametype - is the qname of the type
public QName (src) getCurrentXMLType()
getCurrentXMLType in interface SerializationContext (src)
public java.lang.String getValueAsString(java.lang.Object value,
QName (src) xmlType)
throws java.io.IOException
getValueAsString in interface SerializationContext (src) java.io.IOExceptionpublic java.util.Stack getElementStack()
getElementStack in interface SerializationContext (src)
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||