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 TypeMethodDescriptionlong
Creates 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.long
Returns the number of bytes written.void
setIgnoreNextClassWrite
(boolean state) Puts the context in a state where the next call to writeClass is ignored.void
setInputObject
(Object object) Sets the object for which the next createObjectId() call creates an ID.void
Starts an object frame when using a context with framing support.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.void
write
(byte[] b) Writes a byte array.void
writeBoolean
(boolean bool) Writes a boolean value.void
writeByte
(byte b) Writes a byte.void
writeClass
(Class<?> clazz) Writes a class to the context.int
writeClassname
(String name) Writes the name of a class.void
writeSignedVarInt
(long value) Writes a signed variable integer to the encoding context.void
writeString
(String string) Writes a string to the context.void
writeVarInt
(long value) Writes a variable integer to the encoding context.Methods inherited from interface jadex.common.transformation.traverser.IRootObjectContext
getRootObject
Methods 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.
-