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
Modifier and TypeFieldDescriptionprotected final PersistenceOutputListener
static final String
static final Attributes
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beginArray
(int length, Type ct) void
beginExtent
(PersistenceManager manager) void
beginField
(ManageableType.Field field) void
boolean
beginManaged
(ManageableType type, boolean writeType) void
endArray()
protected void
endElement
(String name) void
void
endField
(ManageableType.Field field) void
void
endManaged
(Object object, boolean writeType) void
void
setNested
(boolean nested) protected void
startElement
(String name, Attributes attr) This method serializeso
into a single string which may be used, e.g., as an attribute value of an XML element.This method serializeso
of typetype
into a single string which may be used, e.g., as an attribute value of an XML element.void
writeBoolean
(boolean v) void
writeByte
(int v) void
writeChar
(int v) void
writeDouble
(double v) void
void
writeFloat
(float v) void
writeInt
(int v) void
writeLong
(long v) void
void
void
writeObject
(Object v, Type type) void
void
void
writeShort
(int v) void
void
writeStringObject
(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:
writeName
in interfacePersistenceOutput
-
writeString
- Specified by:
writeString
in interfacePersistenceOutput
-
writeBoolean
- Specified by:
writeBoolean
in interfacePersistenceOutput
- Throws:
IOException
-
writeByte
- Specified by:
writeByte
in interfacePersistenceOutput
- Throws:
IOException
-
writeChar
- Specified by:
writeChar
in interfacePersistenceOutput
- Throws:
IOException
-
writeShort
- Specified by:
writeShort
in interfacePersistenceOutput
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfacePersistenceOutput
- Throws:
IOException
-
writeLong
- Specified by:
writeLong
in interfacePersistenceOutput
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfacePersistenceOutput
- Throws:
IOException
-
writeDouble
- Specified by:
writeDouble
in interfacePersistenceOutput
- Throws:
IOException
-
writeNullObject
- Specified by:
writeNullObject
in interfacePersistenceOutput
- Throws:
IOException
-
writeStringObject
- Specified by:
writeStringObject
in interfacePersistenceOutput
- Throws:
IOException
-
writeObject
- Specified by:
writeObject
in interfacePersistenceOutput
- Throws:
IOException
-
writePersistentObjectReference
- Specified by:
writePersistentObjectReference
in interfacePersistenceOutput
- Throws:
IOException
-
beginArray
- Specified by:
beginArray
in interfacePersistenceOutput
- Throws:
IOException
-
endArray
- Specified by:
endArray
in interfacePersistenceOutput
- Throws:
IOException
-
beginManaged
- Specified by:
beginManaged
in interfacePersistenceOutput
- Throws:
IOException
-
endManaged
- Specified by:
endManaged
in interfacePersistenceOutput
- Throws:
IOException
-
startElement
- Throws:
IOException
-
endElement
- Throws:
IOException
-
beginFields
public void beginFields()- Specified by:
beginFields
in interfacePersistenceOutput
-
beginField
- Specified by:
beginField
in interfacePersistenceOutput
- Throws:
IOException
-
endField
- Specified by:
endField
in interfacePersistenceOutput
- Throws:
IOException
-
endFields
public void endFields()- Specified by:
endFields
in interfacePersistenceOutput
-
setNested
public void setNested(boolean nested) - Specified by:
setNested
in interfacePersistenceOutput
-
getAttributes
- Throws:
IOException
-
writeFields
- Throws:
IOException
-
toString
This method serializeso
into 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 serializeso
of typetype
into 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 ofo
o
- the value to be serialized- Returns:
- a string describing
o
-