java.lang.Object
de.grogra.persistence.XMLPersistenceReader
- All Implemented Interfaces:
PersistenceInput
- Direct Known Subclasses:
XMLGraphReader
,XMLRootlessGraphReader
An
XMLPersistenceReader
is used to read the serialization
output of an XMLPersistenceWriter
.- Author:
- Ole Kniemeyer
-
Field Summary
Fields inherited from interface de.grogra.persistence.PersistenceInput
ARRAY_OBJECT, MANAGEABLE_OBJECT, MIN_UNUSED_KIND, NULL_OBJECT, PERSISTENT_OBJECT_ID, PLAIN_OBJECT, SERIALIZED_OBJECT, SHARED_OBJECT_REFERENCE, STRING_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
boolean
beginComponent
(ManageableType.ArrayComponent c, int index) beginField
(ManageableType type, ManageableType.Field field) void
endArray()
void
void
endField()
void
protected ManageableType.Field
getManagedField
(ManageableType t, String name) int
getObject
(long id) peekName()
final void
readAttribute
(PersistenceCapable object, String uri, String name, String value) boolean
byte
readByte()
char
readChar()
double
final void
readElements
(PersistenceCapable object, SAXElement parent) float
int
readInt()
long
readLong()
readName()
readObject
(int kind, Type type) long
short
int
int
void
registerObject
(long id, PersistenceCapable o) protected String
replaceType
(String type) void
resolve()
resolveId
(long inputId) void
setNested
(boolean nested) void
valueOf
(Manageable object, String value) Deserializes a string into an existing object.Deserializes a string into an object of the given type.
-
Constructor Details
-
XMLPersistenceReader
-
-
Method Details
-
getBindings
- Specified by:
getBindings
in interfacePersistenceInput
-
getObject
-
registerObject
-
readBoolean
- Specified by:
readBoolean
in interfacePersistenceInput
- Throws:
IOException
-
readByte
- Specified by:
readByte
in interfacePersistenceInput
- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedByte
in interfacePersistenceInput
- Throws:
IOException
-
readShort
- Specified by:
readShort
in interfacePersistenceInput
- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShort
in interfacePersistenceInput
- Throws:
IOException
-
readChar
- Specified by:
readChar
in interfacePersistenceInput
- Throws:
IOException
-
readInt
- Specified by:
readInt
in interfacePersistenceInput
- Throws:
IOException
-
readLong
- Specified by:
readLong
in interfacePersistenceInput
- Throws:
IOException
-
readFloat
- Specified by:
readFloat
in interfacePersistenceInput
- Throws:
IOException
-
readDouble
- Specified by:
readDouble
in interfacePersistenceInput
- Throws:
IOException
-
readName
- Specified by:
readName
in interfacePersistenceInput
- Throws:
IOException
-
peekName
- Throws:
IOException
-
readString
- Specified by:
readString
in interfacePersistenceInput
- Throws:
IOException
-
getNextObjectKind
- Specified by:
getNextObjectKind
in interfacePersistenceInput
- Throws:
IOException
-
readObject
- Specified by:
readObject
in interfacePersistenceInput
- Throws:
IOException
-
readPersistentObjectId
- Specified by:
readPersistentObjectId
in interfacePersistenceInput
- Throws:
IOException
-
readPersistentObject
- Specified by:
readPersistentObject
in interfacePersistenceInput
- Throws:
IOException
-
beginArray
- Specified by:
beginArray
in interfacePersistenceInput
- Throws:
IOException
-
beginComponent
- Specified by:
beginComponent
in interfacePersistenceInput
- Throws:
IOException
-
endComponent
public void endComponent()- Specified by:
endComponent
in interfacePersistenceInput
-
endArray
public void endArray()- Specified by:
endArray
in interfacePersistenceInput
-
beginManaged
- Specified by:
beginManaged
in interfacePersistenceInput
- Throws:
IOException
-
replaceType
-
getManagedField
-
areFieldsProvided
public boolean areFieldsProvided()- Specified by:
areFieldsProvided
in interfacePersistenceInput
-
beginField
public ManageableType.Field beginField(ManageableType type, ManageableType.Field field) throws IOException - Specified by:
beginField
in interfacePersistenceInput
- Throws:
IOException
-
endField
public void endField()- Specified by:
endField
in interfacePersistenceInput
-
endManaged
- Specified by:
endManaged
in interfacePersistenceInput
- Throws:
IOException
-
setNested
public void setNested(boolean nested) - Specified by:
setNested
in interfacePersistenceInput
-
readElements
- Throws:
SAXException
-
readAttribute
public final void readAttribute(PersistenceCapable object, String uri, String name, String value) throws SAXException - Throws:
SAXException
-
valueOf
Deserializes a string into an existing object. The string must have been generated byXMLPersistenceWriter.toString(Manageable)
with an object argument of the same class.- Parameters:
object
- the object's content will be set using the serialized description invalue
value
- the serialized description of the object
-
valueOf
public Object valueOf(Type type, String s) throws InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException Deserializes a string into an object of the given type. The string must have been generated byXMLPersistenceWriter.toString(Type, Object)
with the sametype
as argument.- Parameters:
type
- the type of the object to deserializes
- the serialized description of the object- Returns:
- deserialized object
- Throws:
InstantiationException
IllegalAccessException
InvocationTargetException
ClassNotFoundException
-
resolve
public void resolve() -
resolveId
- Specified by:
resolveId
in interfacePersistenceInput
-