Package jadex.binary
Interface IEncodingContext
-
- All Superinterfaces:
IRootObjectContext,IUserContextContainer
- All Known Implementing Classes:
AbstractEncodingContext,DataOutputEncodingContext,EncodingContext,FramingEncodingContext
public interface IEncodingContext extends IRootObjectContext
Encoding context interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcreateObjectId()Creates ID for an object.java.lang.ClassLoadergetClassLoader()Gets the classloader.java.util.Set<java.lang.Class<?>>getNonInnerClassCache()Returns the non-inner class cache.java.lang.LonggetObjectId(java.lang.Object object)Gets the ID of a known object.java.util.List<ITraverseProcessor>getPreprocessors()Returns the preprocessors.longgetWrittenBytes()Returns the number of bytes written.voidsetIgnoreNextClassWrite(boolean state)Puts the context in a state where the next call to writeClass is ignored.voidsetInputObject(java.lang.Object object)Sets the object for which the next createObjectId() call creates an ID.voidstartObjectFrame()Starts an object frame when using a context with framing support.voidstartObjectFrame(boolean fixedsize)Starts an object frame when using a context with framing support.voidstopObjectFrame()Stops 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(java.lang.Class<?> clazz)Writes a class to the context.intwriteClassname(java.lang.String name)Writes the name of a class.voidwriteSignedVarInt(long value)Writes a signed variable integer to the encoding context.voidwriteString(java.lang.String string)Writes a string to the context.voidwriteVarInt(long value)Writes a variable integer to the encoding context.-
Methods inherited from interface jadex.commons.transformation.traverser.IRootObjectContext
getRootObject
-
Methods inherited from interface jadex.commons.transformation.traverser.IUserContextContainer
getUserContext
-
-
-
-
Method Detail
-
getPreprocessors
java.util.List<ITraverseProcessor> getPreprocessors()
Returns the preprocessors.- Returns:
- The preprocessors
-
getClassLoader
java.lang.ClassLoader getClassLoader()
Gets the classloader.- Returns:
- The classloader.
-
getNonInnerClassCache
java.util.Set<java.lang.Class<?>> getNonInnerClassCache()
Returns the non-inner class cache.- Returns:
- The non-inner class cache.
-
setInputObject
void setInputObject(java.lang.Object object)
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
java.lang.Long getObjectId(java.lang.Object object)
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
void writeString(java.lang.String string)
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
void writeClass(java.lang.Class<?> clazz)
Writes a class to the context.- Parameters:
clazz- The class.
-
writeClassname
int writeClassname(java.lang.String name)
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.
-
-