|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface describes the AXIS SerializationContext.
Method Summary | |
void |
endElement()
Writes the end element tag for the open element. |
Message |
getCurrentMessage()
Get the current message. |
MessageContext |
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)
|
boolean |
getPretty()
Get whether the serialization should be pretty printed. |
QName |
getQNameForClass(java.lang.Class cls)
Get the QName associated with the specified class. |
Serializer |
getSerializerForJavaType(java.lang.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. |
boolean |
isPrimitive(java.lang.Object value,
java.lang.Class javaType)
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 qName)
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 elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value,
java.lang.Class javaType)
Serialize the indicated value as an element with the name indicated by elemQName. |
void |
serialize(QName elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value,
java.lang.Class javaType,
QName xmlType,
boolean sendNull,
boolean sendType)
|
void |
serializeActual(QName elemQName,
org.xml.sax.Attributes attributes,
java.lang.Object value,
java.lang.Class javaType,
QName xmlType,
boolean sendType)
Invoked to do the actual serialization of the qName (called by serialize above). |
void |
setDoMultiRefs(boolean shouldDo)
Set whether we are doing multirefs. |
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 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 |
startElement(QName 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 |
Method Detail |
public void serialize(QName elemQName, org.xml.sax.Attributes attributes, java.lang.Object value, java.lang.Class javaType) throws java.io.IOException
elemQName
- is the QName of the elementattributes
- are additional attributesvalue
- is the object to serializejavaType
- is the "real" type of the value.xmlType
- is the qname of the type or null. (default is null)sendNull
- determines whether to send null values. (default is true)sendType
- determines whether to set xsi:type attribute. (default is true)public void serialize(QName elemQName, org.xml.sax.Attributes attributes, java.lang.Object value, java.lang.Class javaType, QName xmlType, boolean sendNull, boolean sendType) throws java.io.IOException
public void serializeActual(QName elemQName, org.xml.sax.Attributes attributes, java.lang.Object value, java.lang.Class javaType, QName xmlType, boolean sendType) throws java.io.IOException
elemQName
- is the QName of the elementattributes
- are additional attributesvalue
- is the object to serializejavaType
- is the "real" type of the value. For primitives, the value is the
associated java.lang class. So the javaType is needed to know that the value
is really a wrapped primitive.xmlType
- (optional) is the desired type QName.sendType
- indicates whether the xsi:type attribute should be set.public org.xml.sax.Attributes setTypeAttribute(org.xml.sax.Attributes attributes, QName type)
attributes
- of the qnametype
- is the qname of the typepublic Serializer getSerializerForJavaType(java.lang.Class javaType)
javaType
- is Class for a type to serializepublic boolean getPretty()
public void setPretty(boolean pretty)
pretty
- true/falsepublic void setDoMultiRefs(boolean shouldDo)
shouldDo
- true/falsepublic void setSendDecl(boolean sendDecl)
sendDecl
- true/falsepublic boolean shouldSendXSIType()
public TypeMapping getTypeMapping()
public TypeMappingRegistry getTypeMappingRegistry()
public java.lang.String getPrefixForURI(java.lang.String uri)
uri
- is the namespace uridefaultPrefix
- optional parameter which is the default prefixpublic java.lang.String getPrefixForURI(java.lang.String uri, java.lang.String defaultPrefix)
public void registerPrefixForURI(java.lang.String prefix, java.lang.String uri)
prefix
- uri
- is the namespace uripublic Message getCurrentMessage()
public MessageContext getMessageContext()
public java.lang.String qName2String(QName qName)
QName
- public QName getQNameForClass(java.lang.Class cls)
Class
- of an object requiring serialization.public boolean isPrimitive(java.lang.Object value, java.lang.Class javaType)
value
- to be serializedjavaType
- is the "real" java type of value. Used to distinguish
between java primitives and their wrapper classes.public void outputMultiRefs() throws java.io.IOException
public void startElement(QName qName, org.xml.sax.Attributes attributes) throws java.io.IOException
qName
- is the name of the elementattributes
- are the attributes to writepublic void endElement() throws java.io.IOException
public void writeChars(char[] p1, int p2, int p3) throws java.io.IOException
p1
- character array to writep2
- starting index in arrayp3
- length to writepublic void writeString(java.lang.String string) throws java.io.IOException
string
- is the String to write.public void writeSafeString(java.lang.String string) throws java.io.IOException
string
- is the String to write.public void writeDOMElement(org.w3c.dom.Element el) throws java.io.IOException
el
- is a DOM Element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |