Modifier and Type | Field and Description |
---|---|
int |
handle |
boolean |
isExceptionObject |
protected contenttype |
type |
Constructor and Description |
---|
contentbase(contenttype type) |
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 indetation,
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.
|
public int handle
public boolean isExceptionObject
protected contenttype type
public contentbase(contenttype type)
public boolean isExceptionObject()
content
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
isExceptionObject
in interface content
public void setIsExceptionObject(boolean value)
content
setIsExceptionObject
in interface content
value
- the new value to usepublic contenttype getType()
public int getHandle()
content
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.
public void validate() throws ValidityException
content
validate
in interface content
ValidityException
- if the object's state is invalidpublic java.lang.String toJson(java.lang.String indetation, java.util.Map<classdesc,java.util.Map<field,java.lang.Object>> fielddata, boolean child)
content
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
toJson
in interface content
indetation
- 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