public interface content
Generic interface for all data that may be read from the stream (except null).
A successful read of the stream will result in a series of content instances or null references. For details on specific metadata, see documentation on implementing classes/subinterfaces.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INDENT |
static java.lang.String |
NEW_LINE |
Modifier and Type | Method and Description |
---|---|
int |
getHandle()
Get the numeric handle by which this object was referred to in the object stream.
|
contenttype |
getType() |
boolean |
isExceptionObject()
Tells whether or not this object is an exception that was caught during
serialization.
|
void |
setIsExceptionObject(boolean value)
Sets the flag that tells whether or not this object is an exception that was caught
during serialization.
|
java.lang.String |
toJson(java.lang.String indentation,
java.util.Map<classdesc,java.util.Map<field,java.lang.Object>> fielddata,
boolean child)
Analogy for toString method; however, outputs its string in json formatting.
|
void |
validate()
Performs extra object-specific validity checks.
|
static final java.lang.String INDENT
static final java.lang.String NEW_LINE
contenttype getType()
int getHandle()
Get the numeric handle by which this object was referred to in the object stream. These handles are used internally by Object{Output,Input}Stream as a mechanism to avoid costly duplication.
CAUTION: they are *not* necessarily unique across all objects in a given stream! If an exception was thrown during serialization (which is most likely to happen during a serialized objct's writeObject() implementation), then the stream resets before and after the exception is serialized.
void validate() throws ValidityException
ValidityException
- if the object's state is invalidboolean isExceptionObject()
Tells whether or not this object is an exception that was caught during serialization.
Note: Not every Throwable or Exception in the stream will have this flag set to true; only those which were thrown during serialization will
void setIsExceptionObject(boolean value)
value
- the new value to usejava.lang.String toJson(java.lang.String indentation, java.util.Map<classdesc,java.util.Map<field,java.lang.Object>> fielddata, boolean child)
Analogy for toString method; however, outputs its string in json formatting. Returns the exact json representation of object with indentation.
Inherited by multiple classes via contentbase, often calls itself for another object
indentation
- starting indentation for json outputfielddata
- used when calling this method for inner instances
so the instance has info about its variables.
Instance info is saved in another content space than
info about its field variables, so it must be provided by parameter
to inner instanceschild
- tells that the instance is child of another because of indentation