Package jadex.binary
Interface IDecodingContext
- All Superinterfaces:
jadex.common.transformation.traverser.IUserContextContainer
- All Known Implementing Classes:
AbstractDecodingContext
,DataInputDecodingContext
,FramingStreamDecodingContext
,StreamDecodingContext
public interface IDecodingContext
extends jadex.common.transformation.traverser.IUserContextContainer
Decoding context interface.
-
Method Summary
Modifier and TypeMethodDescriptionlong
createObjectId
(Object object) Creates ID for an object.Gets the classloader.Gets the current class name.int
Returns the current offset of the decoding process for debugging.Returns the handlers used to decode objects.jadex.common.transformation.traverser.IErrorReporter
Gets the error reporter.Returns the last object decoded.getObjectForId
(long id) Gets a known object by ID.getObjectId
(Object object) Gets the ID of a known object.List
<jadex.common.transformation.traverser.ITraverseProcessor> Returns the handlers used for post-processing.byte[]
read
(byte[] array) Reads a number of bytes from the buffer and fills the array.boolean
Reads a boolean value from the buffer.byte
readByte()
Reads a byte from the buffer.Helper method for decoding a class name.long
Helper method for decoding a signed variable-sized integer (VarInt).Helper method for decoding a string.long
Helper method for decoding a variable-sized integer (VarInt).void
setLastObject
(Object lastobject) Sets the last object decoded.void
setObjectForId
(long id, Object object) Sets a known object by ID.void
setVersion
(int version) Sets the format version.void
startObjectFrame
(boolean fixedsize) Starts an object frame when using a context with framing support.void
Stops an object frame when using a context with framing support.Methods inherited from interface jadex.common.transformation.traverser.IUserContextContainer
getUserContext
-
Method Details
-
getCurrentClassName
String getCurrentClassName()Gets the current class name.- Returns:
- The current class name.
-
getLastObject
Object getLastObject()Returns the last object decoded.- Returns:
- The last object decoded.
-
setLastObject
Sets the last object decoded.- Parameters:
lastobject
- The last object decoded.
-
setVersion
void setVersion(int version) Sets the format version.- Parameters:
version
- The version.
-
createObjectId
Creates ID for an object.- Parameters:
object
- The object- Returns:
- The ID.
-
getObjectForId
Gets a known object by ID.- Parameters:
id
- The ID.- Returns:
- The object or null.
-
setObjectForId
Sets a known object by ID.- Parameters:
id
- The ID.object
- The object..
-
getObjectId
Gets the ID of a known object.- Parameters:
object
- The object- Returns:
- The ID.
-
getClassloader
ClassLoader getClassloader()Gets the classloader.- Returns:
- The classloader.
-
getDecoderHandlers
List<IDecoderHandler> getDecoderHandlers()Returns the handlers used to decode objects.- Returns:
- The handlers.
-
getErrorReporter
jadex.common.transformation.traverser.IErrorReporter getErrorReporter()Gets the error reporter.- Returns:
- The error reporter.
-
getPostProcessors
List<jadex.common.transformation.traverser.ITraverseProcessor> getPostProcessors()Returns the handlers used for post-processing.- Returns:
- Post-processing handlers.
-
readByte
byte readByte()Reads a byte from the buffer.- Returns:
- A byte.
-
read
byte[] read(byte[] array) Reads a number of bytes from the buffer and fills the array.- Parameters:
array
- The byte array.- Returns:
- The byte array for convenience.
-
readBoolean
boolean readBoolean()Reads a boolean value from the buffer.- Returns:
- Boolean value.
-
readString
String readString()Helper method for decoding a string.- Returns:
- String encoded at the current position.
-
readVarInt
long readVarInt()Helper method for decoding a variable-sized integer (VarInt).- Returns:
- The decoded value.
-
readSignedVarInt
long readSignedVarInt()Helper method for decoding a signed variable-sized integer (VarInt).- Returns:
- The decoded value.
-
readClassname
String readClassname()Helper method for decoding a class name.- Returns:
- String encoded at the current position.
-
getCurrentOffset
int getCurrentOffset()Returns the current offset of the decoding process for debugging.- Returns:
- Current offset.
-
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.
-