Package com.db4o.internal.handlers
Class StringHandler
- java.lang.Object
-
- com.db4o.internal.handlers.StringHandler
-
- All Implemented Interfaces:
BuiltinTypeHandler
,Comparable4
,VariableLengthTypeHandler
,Indexable4
,IndexableTypeHandler
,LinkLengthAware
,QueryableTypeHandler
,TypeHandler4
,ValueTypeHandler
- Direct Known Subclasses:
StringHandler0
public class StringHandler extends java.lang.Object implements ValueTypeHandler, IndexableTypeHandler, BuiltinTypeHandler, VariableLengthTypeHandler, QueryableTypeHandler
-
-
Constructor Summary
Constructors Constructor Description StringHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ReflectClass
classReflector()
static int
compare(byte[] compare, byte[] with)
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()
java.lang.Object
indexEntryToObject(Context context, java.lang.Object indexEntry)
protected static java.lang.String
intern(Context context, java.lang.String str)
protected static void
internalWrite(InternalObjectContainer objectContainer, WriteBuffer buffer, java.lang.String str)
int
linkLength()
PreparedComparison
prepareComparison(Context context, java.lang.Object obj)
creates a prepared comparison to compare multiple objects against one single object.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 reader)
This readIndexEntry method reads from the actual index in the file.java.lang.Object
readIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer buffer)
This readIndexEntry method reads from the parent slot.static java.lang.String
readString(Context context, ReadBuffer buffer)
static java.lang.String
readStringNoDebug(Context context, ReadBuffer buffer)
void
registerReflector(Reflector reflector)
protected static LatinStringIO
stringIo(InternalObjectContainer objectContainer)
protected static LatinStringIO
stringIo(Context context)
void
write(WriteContext context, java.lang.Object obj)
gets called when an object is to be written to the database.void
writeIndexEntry(Context context, ByteArrayBuffer writer, java.lang.Object entry)
void
writeShort(Transaction trans, java.lang.String str, ByteArrayBuffer buffer)
static ByteArrayBuffer
writeToBuffer(InternalObjectContainer container, java.lang.String str)
-
-
-
Method Detail
-
classReflector
public ReflectClass classReflector()
- Specified by:
classReflector
in interfaceBuiltinTypeHandler
-
delete
public void delete(DeleteContext context)
Description copied from interface:TypeHandler4
gets called when an object gets deleted.- Specified by:
delete
in interfaceTypeHandler4
-
descendsIntoMembers
public boolean descendsIntoMembers()
- Specified by:
descendsIntoMembers
in interfaceQueryableTypeHandler
-
indexEntryToObject
public final java.lang.Object indexEntryToObject(Context context, java.lang.Object indexEntry)
- Specified by:
indexEntryToObject
in interfaceIndexableTypeHandler
-
readIndexEntryFromObjectSlot
public java.lang.Object readIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer buffer) throws CorruptionException, Db4oIOException
This readIndexEntry method reads from the parent slot.- Specified by:
readIndexEntryFromObjectSlot
in interfaceIndexableTypeHandler
- Throws:
CorruptionException
Db4oIOException
-
readIndexEntry
public java.lang.Object readIndexEntry(ObjectIdContext context) throws CorruptionException, Db4oIOException
- Specified by:
readIndexEntry
in interfaceIndexableTypeHandler
- Throws:
CorruptionException
Db4oIOException
-
readIndexEntry
public java.lang.Object readIndexEntry(Context context, ByteArrayBuffer reader)
This readIndexEntry method reads from the actual index in the file.- Specified by:
readIndexEntry
in interfaceIndexable4
-
writeIndexEntry
public void writeIndexEntry(Context context, ByteArrayBuffer writer, java.lang.Object entry)
- Specified by:
writeIndexEntry
in interfaceIndexable4
-
writeShort
public final void writeShort(Transaction trans, java.lang.String str, ByteArrayBuffer buffer)
-
compare
public static final int compare(byte[] compare, byte[] with)
-
defragIndexEntry
public void defragIndexEntry(DefragmentContextImpl context)
- Specified by:
defragIndexEntry
in interfaceIndexable4
-
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
-
internalWrite
protected static void internalWrite(InternalObjectContainer objectContainer, WriteBuffer buffer, java.lang.String str)
-
writeToBuffer
public static ByteArrayBuffer writeToBuffer(InternalObjectContainer container, java.lang.String str)
-
stringIo
protected static LatinStringIO stringIo(Context context)
-
stringIo
protected static LatinStringIO stringIo(InternalObjectContainer objectContainer)
-
readString
public static java.lang.String readString(Context context, ReadBuffer buffer)
-
readStringNoDebug
public static java.lang.String readStringNoDebug(Context context, ReadBuffer buffer)
-
intern
protected static java.lang.String intern(Context context, java.lang.String str)
-
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
-
defragment
public void defragment(DefragmentContext context)
Description copied from interface:TypeHandler4
gets called when an object gets defragmented.- Specified by:
defragment
in interfaceTypeHandler4
-
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
-
linkLength
public int linkLength()
- Specified by:
linkLength
in interfaceLinkLengthAware
-
registerReflector
public void registerReflector(Reflector reflector)
- Specified by:
registerReflector
in interfaceBuiltinTypeHandler
-
-