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
FieldsModifier and TypeFieldDescriptionstatic final ThreadLocal<WeakReference<XMLPersistenceReader>> static Objectprotected final LongHashMap<PersistenceCapable> 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis list hold the objects that contains a node in their serialization and which could not be properly resolved.booleanintbooleanbeginComponent(ManageableType.ArrayComponent c, int index) beginField(ManageableType type, ManageableType.Field field) voidendArray()voidvoidendField()voidprotected ManageableType.FieldgetManagedField(ManageableType t, String name) intgetObject(long id) booleanisSetToBeResolved(long nid) charpeek()peekName()final voidreadAttribute(PersistenceCapable object, String uri, String name, String value) booleanbytereadByte()charreadChar()doublefinal voidreadElements(PersistenceCapable object, SAXElement parent) floatintreadInt()longreadLong()readName()readObject(int kind, Type type) longshortintintvoidregisterObject(long id, PersistenceCapable o) protected StringreplaceType(String type) voidresolve()resolveId(long inputId) voidsetNested(boolean nested) voidvalueOf(Manageable object, String value) Deserializes a string into an existing object.Deserializes a string into an object of the given type.
-
Field Details
-
CURRENT_READER
-
currentDeserializedObject
-
duplicatePersistentObjects
-
-
Constructor Details
-
XMLPersistenceReader
-
-
Method Details
-
setCurrentReader
-
getBindings
- Specified by:
getBindingsin interfacePersistenceInput
-
getObject
-
registerObject
-
readBoolean
- Specified by:
readBooleanin interfacePersistenceInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfacePersistenceInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfacePersistenceInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfacePersistenceInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfacePersistenceInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfacePersistenceInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfacePersistenceInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfacePersistenceInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfacePersistenceInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfacePersistenceInput- Throws:
IOException
-
readName
- Specified by:
readNamein interfacePersistenceInput- Throws:
IOException
-
peekName
- Throws:
IOException
-
readString
- Specified by:
readStringin interfacePersistenceInput- Throws:
IOException
-
getNextObjectKind
- Specified by:
getNextObjectKindin interfacePersistenceInput- Throws:
IOException
-
readObject
- Specified by:
readObjectin interfacePersistenceInput- Throws:
IOException
-
readPersistentObjectId
- Specified by:
readPersistentObjectIdin interfacePersistenceInput- Throws:
IOException
-
readPersistentObject
- Specified by:
readPersistentObjectin interfacePersistenceInput- Throws:
IOException
-
beginArray
- Specified by:
beginArrayin interfacePersistenceInput- Throws:
IOException
-
beginComponent
- Specified by:
beginComponentin interfacePersistenceInput- Throws:
IOException
-
endComponent
public void endComponent()- Specified by:
endComponentin interfacePersistenceInput
-
endArray
public void endArray()- Specified by:
endArrayin interfacePersistenceInput
-
beginManaged
- Specified by:
beginManagedin interfacePersistenceInput- Throws:
IOException
-
replaceType
-
getManagedField
-
areFieldsProvided
public boolean areFieldsProvided()- Specified by:
areFieldsProvidedin interfacePersistenceInput
-
beginField
public ManageableType.Field beginField(ManageableType type, ManageableType.Field field) throws IOException - Specified by:
beginFieldin interfacePersistenceInput- Throws:
IOException
-
endField
public void endField()- Specified by:
endFieldin interfacePersistenceInput
-
endManaged
- Specified by:
endManagedin interfacePersistenceInput- Throws:
IOException
-
setNested
public void setNested(boolean nested) - Specified by:
setNestedin 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 invaluevalue- 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 sametypeas argument.- Parameters:
type- the type of the object to deserializes- the serialized description of the object- Returns:
- deserialized object
- Throws:
InstantiationExceptionIllegalAccessExceptionInvocationTargetExceptionClassNotFoundException
-
resolve
public void resolve() -
addNestedObjectToResolve
This list hold the objects that contains a node in their serialization and which could not be properly resolved. (Usually because the object a map/list in the metagraph and the node is in the main graph). Such object should not be used but well. -
resolveId
- Specified by:
resolveIdin interfacePersistenceInput
-
peek
- Specified by:
peekin interfacePersistenceInput- Throws:
IOException
-
isSetToBeResolved
public boolean isSetToBeResolved(long nid)
-