Package jadex.binary
Interface IEncodingContext
- All Superinterfaces:
jadex.common.transformation.traverser.IRootObjectContext,jadex.common.transformation.traverser.IUserContextContainer
- All Known Implementing Classes:
AbstractEncodingContext,DataOutputEncodingContext,EncodingContext,FramingEncodingContext
public interface IEncodingContext
extends jadex.common.transformation.traverser.IRootObjectContext
Encoding context interface.
-
Method Summary
Modifier and TypeMethodDescriptionlongCreates ID for an object.Gets the classloader.Returns the non-inner class cache.getObjectId(Object object) Gets the ID of a known object.List<jadex.common.transformation.traverser.ITraverseProcessor> Returns the preprocessors.longReturns the number of bytes written.voidsetIgnoreNextClassWrite(boolean state) Puts the context in a state where the next call to writeClass is ignored.voidsetInputObject(Object object) Sets the object for which the next createObjectId() call creates an ID.voidStarts an object frame when using a context with framing support.voidstartObjectFrame(boolean fixedsize) Starts an object frame when using a context with framing support.voidStops an object frame when using a context with framing support.voidwrite(byte[] b) Writes a byte array.voidwriteBoolean(boolean bool) Writes a boolean value.voidwriteByte(byte b) Writes a byte.voidwriteClass(Class<?> clazz) Writes a class to the context.intwriteClassname(String name) Writes the name of a class.voidwriteSignedVarInt(long value) Writes a signed variable integer to the encoding context.voidwriteString(String string) Writes a string to the context.voidwriteVarInt(long value) Writes a variable integer to the encoding context.Methods inherited from interface jadex.common.transformation.traverser.IRootObjectContext
getRootObjectMethods inherited from interface jadex.common.transformation.traverser.IUserContextContainer
getUserContext
-
Method Details
-
getPreprocessors
List<jadex.common.transformation.traverser.ITraverseProcessor> getPreprocessors()Returns the preprocessors.- Returns:
- The preprocessors
-
getClassLoader
ClassLoader getClassLoader()Gets the classloader.- Returns:
- The classloader.
-
getNonInnerClassCache
Returns the non-inner class cache.- Returns:
- The non-inner class cache.
-
setInputObject
Sets the object for which the next createObjectId() call creates an ID.- Parameters:
object- The object.
-
createObjectId
long createObjectId()Creates ID for an object.- Parameters:
object- The object- Returns:
- The ID.
-
getObjectId
Gets the ID of a known object.- Parameters:
object- The object- Returns:
- The ID.
-
setIgnoreNextClassWrite
void setIgnoreNextClassWrite(boolean state) Puts the context in a state where the next call to writeClass is ignored.- Parameters:
state- If true, the next class write will be ignored and the state reset.
-
writeByte
void writeByte(byte b) Writes a byte.- Parameters:
b- The byte.
-
write
void write(byte[] b) Writes a byte array.- Parameters:
b- The byte array.
-
writeBoolean
void writeBoolean(boolean bool) Writes a boolean value.- Parameters:
bool- The value.
-
writeString
Writes a string to the context.- Parameters:
string- The string.
-
writeVarInt
void writeVarInt(long value) Writes a variable integer to the encoding context.- Parameters:
value- The value.
-
writeSignedVarInt
void writeSignedVarInt(long value) Writes a signed variable integer to the encoding context.- Parameters:
value- The value.
-
writeClass
Writes a class to the context.- Parameters:
clazz- The class.
-
writeClassname
Writes the name of a class.- Parameters:
name- The name of the class.
-
getWrittenBytes
long getWrittenBytes()Returns the number of bytes written.- Returns:
- The number of bytes written.
-
startObjectFrame
void startObjectFrame()Starts an object frame when using a context with framing support. -
startObjectFrame
void startObjectFrame(boolean fixedsize) Starts an object frame when using a context with framing support.- Parameters:
fixedsize- If true, use fixed-size (integer) framing. Set true if the object being framed is expected to be larger than 127 bytes (same type of object MUST use either fixed OR variable framing).
-
stopObjectFrame
void stopObjectFrame()Stops an object frame when using a context with framing support.
-