|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.skaringa.javaxml.serializers.AbstractSerializer com.skaringa.javaxml.serializers.ArraySerializer
public final class ArraySerializer
Implementation of ComponentSerializer for arrays.
Field Summary |
---|
Fields inherited from class com.skaringa.javaxml.serializers.AbstractSerializer |
---|
FIELD_TEMPLATE |
Method Summary | |
---|---|
void |
addUsedClasses(java.lang.Class base,
java.util.Set usedClasses)
Get all classes used by a given base class. |
java.lang.Object |
endDeserialize(java.lang.Object obj,
java.lang.String text)
This method is called during deserialization when the end of the element is found. |
java.lang.String |
getXMLTypeName()
Get the XML type name for objects handled by the serializer. |
void |
serialize(java.lang.Object obj,
java.lang.Class type,
java.lang.String name,
java.util.Map propertyMap,
java.util.Map objectIdMap,
DocumentOutputHandlerInterface output)
Serialize an object. |
void |
setMember(java.lang.Object parent,
java.lang.String name,
java.lang.Object value)
This method is called when a member field of an object was completely deserialized and needs to be set. |
java.lang.Object |
startDeserialize(java.lang.String name,
org.xml.sax.Attributes attrs,
java.lang.Object parent,
java.util.Stack objStack,
java.lang.ClassLoader classLoader)
This method is called during deserialization when the start of an element is found. |
void |
toJson(java.lang.Object obj,
java.lang.Class type,
java.util.Map propertyMap,
java.io.PrintStream output)
Serialize an object to JSON. |
void |
writeXMLTypeDefinition(java.lang.Class type,
java.util.Map propertyMap,
DocumentOutputHandlerInterface output)
Write the definition the type in XML Schema format. |
Methods inherited from class com.skaringa.javaxml.serializers.AbstractSerializer |
---|
getField, getFieldsToSerialize, getFieldType, printEncodedStr, startElement, subst, writeXMLCollectionDef, writeXMLExtensionDef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void serialize(java.lang.Object obj, java.lang.Class type, java.lang.String name, java.util.Map propertyMap, java.util.Map objectIdMap, DocumentOutputHandlerInterface output) throws SerializerException
ComponentSerializer
obj
- The object to serialize.type
- The type of the object.name
- The name of the object.propertyMap
- A map (string-to-object) of properties for serialization.objectIdMap
- The objects and their ids that were already serialized.output
- The destination of the serialization.
SerializerException
- If an error occured during serialization.ComponentSerializer.serialize(Object, Class, String, Map, Map, DocumentOutputHandlerInterface)
public java.lang.String getXMLTypeName()
ComponentSerializer
ComponentSerializer.getXMLTypeName()
public java.lang.Object startDeserialize(java.lang.String name, org.xml.sax.Attributes attrs, java.lang.Object parent, java.util.Stack objStack, java.lang.ClassLoader classLoader) throws DeserializerException
ComponentSerializer
name
- The name of the element.attrs
- The attributes of the XML element.parent
- The parent object or null if unknown.objStack
- The complete stack of all parent ObjectDeserializerHolder objects.classLoader
- The class loader used to load the class of the new object.
DeserializerException
- If the creation of the object failed.ComponentSerializer.startDeserialize(String, Attributes, Object, Stack, ClassLoader)
public void setMember(java.lang.Object parent, java.lang.String name, java.lang.Object value) throws DeserializerException
ComponentSerializer
parent
- The parent object.name
- The name of the member.value
- The value of the member.
DeserializerException
- If the setting of the member failed.ComponentSerializer.setMember(Object, String, Object)
public java.lang.Object endDeserialize(java.lang.Object obj, java.lang.String text) throws DeserializerException
ComponentSerializer
obj
- The element created by startDeserialize.text
- The text child node of the XML element.
DeserializerException
- If the deserialization failed.ComponentSerializer.endDeserialize(Object, String)
public void writeXMLTypeDefinition(java.lang.Class type, java.util.Map propertyMap, DocumentOutputHandlerInterface output) throws SerializerException
ComponentSerializer
type
- The type of the object.propertyMap
- A map (string-to-object) of properties.output
- Where to write the schema definition to.
SerializerException
- If an error occured during write.ComponentSerializer.writeXMLTypeDefinition(Class, Map, DocumentOutputHandlerInterface)
public void addUsedClasses(java.lang.Class base, java.util.Set usedClasses) throws SerializerException
ComponentSerializer
base
- The base class.usedClasses
- A Set with Class objects which represent
all used classes. This set is filled up by this function.
SerializerException
- If an error occured.ComponentSerializer.addUsedClasses(Class, Set)
public void toJson(java.lang.Object obj, java.lang.Class type, java.util.Map propertyMap, java.io.PrintStream output) throws SerializerException
ComponentSerializer
obj
- The object to serialize.type
- The type of the object.propertyMap
- A map (string-to-object) of properties for serialization.output
- The destination of the serialization.
SerializerException
- If an error occurred during serialization.CollectionSerializer.toJson(Object, Class, Map, PrintStream)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |