public class ObjectWriterAdapter<T> extends java.lang.Object implements ObjectWriter<T>
| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
containsNoneFieldGetter |
(package private) long |
features |
protected FieldWriter[] |
fieldWriterArray |
(package private) java.util.List<FieldWriter> |
fieldWriters |
(package private) boolean |
googleCollection |
(package private) boolean |
hasFilter |
(package private) long[] |
hashCodes |
(package private) boolean |
hasValueField |
(package private) byte[] |
jsonbClassInfo |
(package private) short[] |
mapping |
(package private) NameFilter |
nameFilter |
(package private) char[] |
nameWithColonUTF16 |
(package private) byte[] |
nameWithColonUTF8 |
(package private) java.lang.Class |
objectClass |
(package private) PropertyFilter |
propertyFilter |
(package private) PropertyPreFilter |
propertyPreFilter |
(package private) boolean |
serializable |
(package private) static java.lang.String |
TYPE |
(package private) java.lang.String |
typeKey |
(package private) byte[] |
typeKeyJSONB |
protected java.lang.String |
typeName |
protected long |
typeNameHash |
protected byte[] |
typeNameJSONB |
protected long |
typeNameSymbolCache |
(package private) ValueFilter |
valueFilter |
| Constructor and Description |
|---|
ObjectWriterAdapter(java.lang.Class<T> objectClass,
java.util.List<FieldWriter> fieldWriters) |
ObjectWriterAdapter(java.lang.Class<T> objectClass,
java.lang.String typeKey,
java.lang.String typeName,
long features,
java.util.List<FieldWriter> fieldWriters) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
errorOnNoneSerializable() |
long |
getFeatures()
Gets the features enabled by this ObjectWriter.
|
FieldWriter |
getFieldWriter(long hashCode)
Gets the FieldWriter for the specified field hash code.
|
java.util.List<FieldWriter> |
getFieldWriters()
Gets the list of FieldWriters associated with this ObjectWriter.
|
boolean |
hasFilter(JSONWriter jsonWriter)
Checks if the JSONWriter has any filters enabled that would affect serialization.
|
protected boolean |
hasFilter0(JSONWriter jsonWriter) |
void |
setNameFilter(NameFilter nameFilter)
Sets the name filter for this ObjectWriter.
|
void |
setPropertyFilter(PropertyFilter propertyFilter)
Sets the property filter for this ObjectWriter.
|
void |
setPropertyPreFilter(PropertyPreFilter propertyPreFilter)
Sets the property pre-filter for this ObjectWriter.
|
void |
setValueFilter(ValueFilter valueFilter)
Sets the value filter for this ObjectWriter.
|
JSONObject |
toJSONObject(T object) |
JSONObject |
toJSONObject(T object,
long features) |
java.util.Map<java.lang.String,java.lang.Object> |
toMap(java.lang.Object object) |
java.lang.String |
toString() |
void |
write(JSONWriter jsonWriter,
java.lang.Object object,
java.lang.Object fieldName,
java.lang.reflect.Type fieldType,
long features)
Writes an object to the JSONWriter with the given field name, field type, and features.
|
void |
writeArrayMappingJSONB(JSONWriter jsonWriter,
java.lang.Object object,
java.lang.Object fieldName,
java.lang.reflect.Type fieldType,
long features)
Writes an object to the JSONWriter in array mapping JSONB format with additional parameters.
|
protected void |
writeClassInfo(JSONWriter jsonWriter) |
private boolean |
writeClassInfoSymbol(JSONWriter jsonWriter,
SymbolTable symbolTable) |
void |
writeJSONB(JSONWriter jsonWriter,
java.lang.Object object,
java.lang.Object fieldName,
java.lang.reflect.Type fieldType,
long features)
Writes an object to the JSONWriter in JSONB format.
|
boolean |
writeTypeInfo(JSONWriter jsonWriter)
Writes type information to the JSON output.
|
void |
writeWithFilter(JSONWriter jsonWriter,
java.lang.Object object,
java.lang.Object fieldName,
java.lang.reflect.Type fieldType,
long features)
Writes an object to the JSONWriter with filter support.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFieldValue, getFieldWriter, setFilter, toJSONString, write, writeArrayMapping, writeArrayMappingJSONB, writeWithFilterboolean hasFilter
PropertyPreFilter propertyPreFilter
PropertyFilter propertyFilter
NameFilter nameFilter
ValueFilter valueFilter
static final java.lang.String TYPE
final java.lang.Class objectClass
final java.util.List<FieldWriter> fieldWriters
protected final FieldWriter[] fieldWriterArray
final java.lang.String typeKey
byte[] typeKeyJSONB
protected final java.lang.String typeName
protected final long typeNameHash
protected long typeNameSymbolCache
protected final byte[] typeNameJSONB
byte[] nameWithColonUTF8
char[] nameWithColonUTF16
final long features
final long[] hashCodes
final short[] mapping
final boolean hasValueField
final boolean serializable
final boolean containsNoneFieldGetter
final boolean googleCollection
byte[] jsonbClassInfo
public ObjectWriterAdapter(java.lang.Class<T> objectClass, java.util.List<FieldWriter> fieldWriters)
public ObjectWriterAdapter(java.lang.Class<T> objectClass, java.lang.String typeKey, java.lang.String typeName, long features, java.util.List<FieldWriter> fieldWriters)
public long getFeatures()
ObjectWritergetFeatures in interface ObjectWriter<T>public FieldWriter getFieldWriter(long hashCode)
ObjectWritergetFieldWriter in interface ObjectWriter<T>hashCode - the hash code of the field namepublic final boolean hasFilter(JSONWriter jsonWriter)
ObjectWriterhasFilter in interface ObjectWriter<T>jsonWriter - the JSONWriter to checkprotected final boolean hasFilter0(JSONWriter jsonWriter)
public void setPropertyFilter(PropertyFilter propertyFilter)
ObjectWritersetPropertyFilter in interface ObjectWriter<T>propertyFilter - the property filter to setpublic void setValueFilter(ValueFilter valueFilter)
ObjectWritersetValueFilter in interface ObjectWriter<T>valueFilter - the value filter to setpublic void setNameFilter(NameFilter nameFilter)
ObjectWritersetNameFilter in interface ObjectWriter<T>nameFilter - the name filter to setpublic void setPropertyPreFilter(PropertyPreFilter propertyPreFilter)
ObjectWritersetPropertyPreFilter in interface ObjectWriter<T>propertyPreFilter - the property pre-filter to setpublic void writeArrayMappingJSONB(JSONWriter jsonWriter, java.lang.Object object, java.lang.Object fieldName, java.lang.reflect.Type fieldType, long features)
ObjectWriterwriteArrayMappingJSONB in interface ObjectWriter<T>jsonWriter - the JSONWriter to which the object should be writtenobject - the object to writefieldName - the name of the field being writtenfieldType - the type of the field being writtenfeatures - the features to use for writingpublic void writeJSONB(JSONWriter jsonWriter, java.lang.Object object, java.lang.Object fieldName, java.lang.reflect.Type fieldType, long features)
ObjectWriterwriteJSONB in interface ObjectWriter<T>jsonWriter - the JSONWriter to which the object should be writtenobject - the object to writefieldName - the name of the field being writtenfieldType - the type of the field being writtenfeatures - the features to use for writingprotected final void writeClassInfo(JSONWriter jsonWriter)
private boolean writeClassInfoSymbol(JSONWriter jsonWriter, SymbolTable symbolTable)
public void write(JSONWriter jsonWriter, java.lang.Object object, java.lang.Object fieldName, java.lang.reflect.Type fieldType, long features)
ObjectWriterwrite in interface ObjectWriter<T>jsonWriter - the JSONWriter to which the object should be writtenobject - the object to writefieldName - the name of the field being writtenfieldType - the type of the field being writtenfeatures - the features to use for writingpublic java.util.Map<java.lang.String,java.lang.Object> toMap(java.lang.Object object)
public java.util.List<FieldWriter> getFieldWriters()
ObjectWritergetFieldWriters in interface ObjectWriter<T>public boolean writeTypeInfo(JSONWriter jsonWriter)
ObjectWriterwriteTypeInfo in interface ObjectWriter<T>jsonWriter - the JSONWriter to which type information should be writtenpublic void writeWithFilter(JSONWriter jsonWriter, java.lang.Object object, java.lang.Object fieldName, java.lang.reflect.Type fieldType, long features)
ObjectWriterwriteWithFilter in interface ObjectWriter<T>jsonWriter - the JSONWriter to which the object should be writtenobject - the object to writefieldName - the name of the field being writtenfieldType - the type of the field being writtenfeatures - the features to use for writingpublic JSONObject toJSONObject(T object)
public JSONObject toJSONObject(T object, long features)
public java.lang.String toString()
toString in class java.lang.Objectprotected void errorOnNoneSerializable()