java.lang.Object
de.grogra.persistence.XMLPersistenceWriter
- All Implemented Interfaces:
PersistenceOutput
- Direct Known Subclasses:
XMLGraphWriter
An
XMLPersistenceWriter serializes data into
XML elements and attributes. The output can be deserialized
by an instance of XMLPersistenceReader.- Author:
- Ole Kniemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PersistenceOutputListenerstatic final Stringstatic final Attributesstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginArray(int length, Type ct) voidbeginExtent(PersistenceManager manager) voidbeginField(ManageableType.Field field) voidbooleanbeginManaged(ManageableType type, boolean writeType) voidendArray()protected voidendElement(String name) voidvoidendField(ManageableType.Field field) voidvoidendManaged(Object object, boolean writeType) voidvoidsetNested(boolean nested) protected voidstartElement(String name, Attributes attr) This method serializesointo a single string which may be used, e.g., as an attribute value of an XML element.This method serializesoof typetypeinto a single string which may be used, e.g., as an attribute value of an XML element.voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteChar(int v) voidwriteDouble(double v) voidvoidwriteFloat(float v) voidwriteInt(int v) voidvoidwriteLong(long v) voidvoidvoidwriteObject(Object v, Type type) voidvoidvoidwriteShort(int v) booleanReturn true if static (global) fields should be writtenvoidvoidwriteStringObject(String value)
-
Field Details
-
NAMESPACE
- See Also:
-
NS_PREFIX
- See Also:
-
NS_ATTRIBUTE
-
listener
-
-
Constructor Details
-
XMLPersistenceWriter
-
-
Method Details
-
getContentHandler
-
beginExtent
- Throws:
IOException
-
endExtent
- Throws:
IOException
-
writeName
- Specified by:
writeNamein interfacePersistenceOutput
-
writeString
- Specified by:
writeStringin interfacePersistenceOutput
-
writeBoolean
- Specified by:
writeBooleanin interfacePersistenceOutput- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfacePersistenceOutput- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfacePersistenceOutput- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfacePersistenceOutput- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfacePersistenceOutput- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfacePersistenceOutput- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfacePersistenceOutput- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfacePersistenceOutput- Throws:
IOException
-
writeNullObject
- Specified by:
writeNullObjectin interfacePersistenceOutput- Throws:
IOException
-
writeStringObject
- Specified by:
writeStringObjectin interfacePersistenceOutput- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin interfacePersistenceOutput- Throws:
IOException
-
writePersistentObjectReference
- Specified by:
writePersistentObjectReferencein interfacePersistenceOutput- Throws:
IOException
-
beginArray
- Specified by:
beginArrayin interfacePersistenceOutput- Throws:
IOException
-
endArray
- Specified by:
endArrayin interfacePersistenceOutput- Throws:
IOException
-
beginManaged
- Specified by:
beginManagedin interfacePersistenceOutput- Throws:
IOException
-
endManaged
- Specified by:
endManagedin interfacePersistenceOutput- Throws:
IOException
-
startElement
- Throws:
IOException
-
endElement
- Throws:
IOException
-
beginFields
public void beginFields()- Specified by:
beginFieldsin interfacePersistenceOutput
-
beginField
- Specified by:
beginFieldin interfacePersistenceOutput- Throws:
IOException
-
endField
- Specified by:
endFieldin interfacePersistenceOutput- Throws:
IOException
-
endFields
public void endFields()- Specified by:
endFieldsin interfacePersistenceOutput
-
setNested
public void setNested(boolean nested) - Specified by:
setNestedin interfacePersistenceOutput
-
getAttributes
- Throws:
IOException
-
writeFields
- Throws:
IOException
-
toString
This method serializesointo a single string which may be used, e.g., as an attribute value of an XML element. The value can be deserialized usingXMLPersistenceReader.valueOf(Manageable, String).- Parameters:
o- the value to be serialized- Returns:
- a string describing
o
-
toString
This method serializesoof typetypeinto a single string which may be used, e.g., as an attribute value of an XML element. The value can be deserialized usingXMLPersistenceReader.valueOf(Type, String).- Parameters:
type- the type ofoo- the value to be serialized- Returns:
- a string describing
o
-
writeLibraryObjectReference
- Specified by:
writeLibraryObjectReferencein interfacePersistenceOutput- Throws:
IOException
-
writeStatic
public boolean writeStatic()Description copied from interface:PersistenceOutputReturn true if static (global) fields should be written- Specified by:
writeStaticin interfacePersistenceOutput
-