Package com.db4o.internal
Class OpenTypeHandler
- java.lang.Object
-
- com.db4o.internal.OpenTypeHandler
-
- All Implemented Interfaces:
BuiltinTypeHandler
,LinkLengthAware
,CascadingTypeHandler
,ReferenceTypeHandler
,TypeHandler4
,ValueTypeHandler
- Direct Known Subclasses:
InterfaceTypeHandler
,OpenTypeHandler7
public class OpenTypeHandler extends java.lang.Object implements ReferenceTypeHandler, ValueTypeHandler, BuiltinTypeHandler, CascadingTypeHandler, LinkLengthAware
-
-
Constructor Summary
Constructors Constructor Description OpenTypeHandler(ObjectContainerBase container)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ReferenceActivationContext context)
gets called when an object is to be activated.void
cascadeActivation(ActivationContext context)
will be called during activation if the handled object is already activeReflectClass
classReflector()
void
collectIDs(QueryingReadContext readContext)
will be called during querying to ask for IDs of member objects of the handled object.protected ObjectContainerBase
container(DefragmentContext context)
protected TypeHandler4
correctTypeHandlerVersionFor(DefragmentContext context, int classMetadataId)
void
defragment(DefragmentContext context)
gets called when an object gets defragmented.void
delete(DeleteContext context)
gets called when an object gets deleted.boolean
equals(java.lang.Object obj)
int
getID()
boolean
hasField(ObjectContainerBase a_stream, java.lang.String a_path)
int
hashCode()
static boolean
isPlainObject(TypeHandler4 typeHandler)
int
linkLength()
java.lang.Object
read(ReadContext readContext)
gets called when an value type is to be read from the database.TypeHandler4
readCandidateHandler(QueryingReadContext context)
will be called during querying to ask for the handler to be used to collect children of the handled objectObjectID
readObjectID(InternalReadContext context)
protected TypeHandler4
readTypeHandler(InternalReadContext context, int payloadOffset)
TypeHandler4
readTypeHandlerRestoreOffset(InternalReadContext context)
void
registerReflector(Reflector reflector)
protected void
seekSecondaryOffset(ReadBuffer buffer, TypeHandler4 typeHandler)
TypeHandler4
typeHandlerForObject(java.lang.Object obj)
void
write(WriteContext context, java.lang.Object obj)
gets called when an object is to be written to the database.
-
-
-
Constructor Detail
-
OpenTypeHandler
public OpenTypeHandler(ObjectContainerBase container)
-
-
Method Detail
-
classReflector
public ReflectClass classReflector()
- Specified by:
classReflector
in interfaceBuiltinTypeHandler
-
cascadeActivation
public void cascadeActivation(ActivationContext context)
Description copied from interface:CascadingTypeHandler
will be called during activation if the handled object is already active- Specified by:
cascadeActivation
in interfaceCascadingTypeHandler
-
delete
public void delete(DeleteContext context) throws Db4oIOException
Description copied from interface:TypeHandler4
gets called when an object gets deleted.- Specified by:
delete
in interfaceTypeHandler4
- Throws:
Db4oIOException
-
getID
public int getID()
-
hasField
public boolean hasField(ObjectContainerBase a_stream, java.lang.String a_path)
-
readCandidateHandler
public TypeHandler4 readCandidateHandler(QueryingReadContext context)
Description copied from interface:CascadingTypeHandler
will be called during querying to ask for the handler to be used to collect children of the handled object- Specified by:
readCandidateHandler
in interfaceCascadingTypeHandler
- Returns:
-
readObjectID
public ObjectID readObjectID(InternalReadContext context)
-
defragment
public void defragment(DefragmentContext context)
Description copied from interface:TypeHandler4
gets called when an object gets defragmented.- Specified by:
defragment
in interfaceTypeHandler4
-
correctTypeHandlerVersionFor
protected TypeHandler4 correctTypeHandlerVersionFor(DefragmentContext context, int classMetadataId)
-
container
protected ObjectContainerBase container(DefragmentContext context)
-
readTypeHandler
protected TypeHandler4 readTypeHandler(InternalReadContext context, int payloadOffset)
-
seekSecondaryOffset
protected void seekSecondaryOffset(ReadBuffer buffer, TypeHandler4 typeHandler)
- Parameters:
buffer
-typeHandler
-
-
read
public java.lang.Object read(ReadContext readContext)
Description copied from interface:ValueTypeHandler
gets called when an value type is to be read from the database.- Specified by:
read
in interfaceValueTypeHandler
- Returns:
- the read value type
-
activate
public void activate(ReferenceActivationContext context)
Description copied from interface:ReferenceTypeHandler
gets called when an object is to be activated.- Specified by:
activate
in interfaceReferenceTypeHandler
-
collectIDs
public void collectIDs(QueryingReadContext readContext)
Description copied from interface:CascadingTypeHandler
will be called during querying to ask for IDs of member objects of the handled object.- Specified by:
collectIDs
in interfaceCascadingTypeHandler
-
readTypeHandlerRestoreOffset
public TypeHandler4 readTypeHandlerRestoreOffset(InternalReadContext context)
-
write
public void write(WriteContext context, java.lang.Object obj)
Description copied from interface:TypeHandler4
gets called when an object is to be written to the database.- Specified by:
write
in interfaceTypeHandler4
obj
- the object
-
isPlainObject
public static boolean isPlainObject(TypeHandler4 typeHandler)
-
typeHandlerForObject
public TypeHandler4 typeHandlerForObject(java.lang.Object obj)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
registerReflector
public void registerReflector(Reflector reflector)
- Specified by:
registerReflector
in interfaceBuiltinTypeHandler
-
linkLength
public int linkLength()
- Specified by:
linkLength
in interfaceLinkLengthAware
-
-