Package com.db4o.internal.handlers
Class PrimitiveHandler
- java.lang.Object
-
- com.db4o.internal.handlers.PrimitiveHandler
-
- All Implemented Interfaces:
BuiltinTypeHandler
,CanExcludeNullInQueries
,Comparable4
,Indexable4
,IndexableTypeHandler
,LinkLengthAware
,QueryableTypeHandler
,TypeHandler4
,ValueTypeHandler
- Direct Known Subclasses:
BooleanHandler
,ByteHandler
,CharHandler
,IntHandler
,LongHandler
,NetTypeHandler
,ShortHandler
public abstract class PrimitiveHandler extends java.lang.Object implements ValueTypeHandler, IndexableTypeHandler, BuiltinTypeHandler, QueryableTypeHandler, CanExcludeNullInQueries
-
-
Field Summary
Fields Modifier and Type Field Description protected ReflectClass
_classReflector
-
Constructor Summary
Constructors Constructor Description PrimitiveHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ReflectClass
classReflector()
java.lang.Object
coerce(ReflectClass claxx, java.lang.Object obj)
abstract java.lang.Object
defaultValue()
void
defragIndexEntry(DefragmentContextImpl context)
void
defragment(DefragmentContext context)
gets called when an object gets defragmented.void
delete(DeleteContext context)
gets called when an object gets deleted.boolean
descendsIntoMembers()
boolean
excludeNull()
java.lang.Object
indexEntryToObject(Context context, java.lang.Object indexEntry)
abstract PreparedComparison
internalPrepareComparison(java.lang.Object obj)
protected java.lang.Class
javaClass()
abstract int
linkLength()
java.lang.Object
nullRepresentationInUntypedArrays()
PreparedComparison
prepareComparison(Context context, java.lang.Object obj)
creates a prepared comparison to compare multiple objects against one single object.ReflectClass
primitiveClassReflector()
abstract java.lang.Class
primitiveJavaClass()
protected PrimitiveMarshaller
primitiveMarshaller()
java.lang.Object
primitiveNull()
java.lang.Object
read(MarshallerFamily mf, StatefulBuffer buffer, boolean redirect)
java.lang.Object
read(ReadContext context)
gets called when an value type is to be read from the database.java.lang.Object
readIndexEntry(ObjectIdContext context)
java.lang.Object
readIndexEntry(Context context, ByteArrayBuffer buffer)
java.lang.Object
readIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer)
void
registerReflector(Reflector reflector)
void
write(WriteContext context, java.lang.Object obj)
gets called when an object is to be written to the database.abstract void
write(java.lang.Object a_object, ByteArrayBuffer a_bytes)
void
writeIndexEntry(Context context, ByteArrayBuffer a_writer, java.lang.Object a_object)
-
-
-
Field Detail
-
_classReflector
protected ReflectClass _classReflector
-
-
Method Detail
-
coerce
public java.lang.Object coerce(ReflectClass claxx, java.lang.Object obj)
-
defaultValue
public abstract java.lang.Object defaultValue()
-
delete
public void delete(DeleteContext context)
Description copied from interface:TypeHandler4
gets called when an object gets deleted.- Specified by:
delete
in interfaceTypeHandler4
-
indexEntryToObject
public final java.lang.Object indexEntryToObject(Context context, java.lang.Object indexEntry)
- Specified by:
indexEntryToObject
in interfaceIndexableTypeHandler
-
primitiveJavaClass
public abstract java.lang.Class primitiveJavaClass()
-
javaClass
protected java.lang.Class javaClass()
-
descendsIntoMembers
public boolean descendsIntoMembers()
- Specified by:
descendsIntoMembers
in interfaceQueryableTypeHandler
-
primitiveNull
public java.lang.Object primitiveNull()
-
read
public java.lang.Object read(MarshallerFamily mf, StatefulBuffer buffer, boolean redirect) throws CorruptionException
- Parameters:
mf
-buffer
-redirect
-- Throws:
CorruptionException
-
readIndexEntry
public java.lang.Object readIndexEntry(Context context, ByteArrayBuffer buffer)
- Specified by:
readIndexEntry
in interfaceIndexable4
-
readIndexEntryFromObjectSlot
public final java.lang.Object readIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer) throws CorruptionException
- Specified by:
readIndexEntryFromObjectSlot
in interfaceIndexableTypeHandler
- Throws:
CorruptionException
-
readIndexEntry
public java.lang.Object readIndexEntry(ObjectIdContext context) throws CorruptionException, Db4oIOException
- Specified by:
readIndexEntry
in interfaceIndexableTypeHandler
- Throws:
CorruptionException
Db4oIOException
-
classReflector
public ReflectClass classReflector()
- Specified by:
classReflector
in interfaceBuiltinTypeHandler
-
primitiveClassReflector
public ReflectClass primitiveClassReflector()
-
registerReflector
public void registerReflector(Reflector reflector)
- Specified by:
registerReflector
in interfaceBuiltinTypeHandler
-
write
public abstract void write(java.lang.Object a_object, ByteArrayBuffer a_bytes)
-
writeIndexEntry
public void writeIndexEntry(Context context, ByteArrayBuffer a_writer, java.lang.Object a_object)
- Specified by:
writeIndexEntry
in interfaceIndexable4
-
linkLength
public abstract int linkLength()
- Specified by:
linkLength
in interfaceLinkLengthAware
-
defragment
public final void defragment(DefragmentContext context)
Description copied from interface:TypeHandler4
gets called when an object gets defragmented.- Specified by:
defragment
in interfaceTypeHandler4
-
defragIndexEntry
public void defragIndexEntry(DefragmentContextImpl context)
- Specified by:
defragIndexEntry
in interfaceIndexable4
-
primitiveMarshaller
protected PrimitiveMarshaller primitiveMarshaller()
-
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
-
read
public java.lang.Object read(ReadContext context)
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
-
nullRepresentationInUntypedArrays
public java.lang.Object nullRepresentationInUntypedArrays()
-
prepareComparison
public PreparedComparison prepareComparison(Context context, java.lang.Object obj)
Description copied from interface:Comparable4
creates a prepared comparison to compare multiple objects against one single object.- Specified by:
prepareComparison
in interfaceComparable4
- Parameters:
context
- the context of the comparisonobj
- the object that is to be compared against multiple other objects- Returns:
- the prepared comparison
-
internalPrepareComparison
public abstract PreparedComparison internalPrepareComparison(java.lang.Object obj)
-
excludeNull
public boolean excludeNull()
- Specified by:
excludeNull
in interfaceCanExcludeNullInQueries
-
-