public class Representer extends SafeRepresenter
| Modifier and Type | Class and Description |
|---|---|
protected class |
Representer.RepresentJavaBean |
SafeRepresenter.RepresentArray, SafeRepresenter.RepresentBoolean, SafeRepresenter.RepresentByteArray, SafeRepresenter.RepresentDate, SafeRepresenter.RepresentEnum, SafeRepresenter.RepresentIterator, SafeRepresenter.RepresentList, SafeRepresenter.RepresentMap, SafeRepresenter.RepresentNull, SafeRepresenter.RepresentNumber, SafeRepresenter.RepresentPrimitiveArray, SafeRepresenter.RepresentSet, SafeRepresenter.RepresentString, SafeRepresenter.RepresentUuid| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Class<? extends java.lang.Object>,TypeDescription> |
typeDefinitions |
classTags, nonPrintableStyle, timeZonedefaultFlowStyle, defaultScalarStyle, multiRepresenters, nullRepresenter, objectToRepresent, representedObjects, representers| Constructor and Description |
|---|
Representer() |
Representer(DumperOptions options) |
| Modifier and Type | Method and Description |
|---|---|
TypeDescription |
addTypeDescription(TypeDescription td) |
protected void |
checkGlobalTag(Property property,
Node node,
java.lang.Object object)
Remove redundant global tag for a type safe (generic) collection if it is the same as defined
by the JavaBean property
|
protected java.util.Set<Property> |
getProperties(java.lang.Class<? extends java.lang.Object> type)
Get JavaBean properties to be serialised.
|
protected MappingNode |
representJavaBean(java.util.Set<Property> properties,
java.lang.Object javaBean)
Tag logic: - explicit root tag is set in serializer - if there is a predefined class tag it is
used - a global tag with class name is always used as tag.
|
protected NodeTuple |
representJavaBeanProperty(java.lang.Object javaBean,
Property property,
java.lang.Object propertyValue,
Tag customTag)
Represent one JavaBean property.
|
private void |
resetTag(java.lang.Class<? extends java.lang.Object> type,
Node node) |
void |
setPropertyUtils(PropertyUtils propertyUtils) |
addClassTag, getTag, getTimeZone, setTimeZonegetDefaultFlowStyle, getDefaultScalarStyle, getPropertyUtils, isExplicitPropertyUtils, represent, representData, representMapping, representScalar, representScalar, representSequence, setDefaultFlowStyle, setDefaultScalarStyleprotected java.util.Map<java.lang.Class<? extends java.lang.Object>,TypeDescription> typeDefinitions
public Representer()
public Representer(DumperOptions options)
public TypeDescription addTypeDescription(TypeDescription td)
public void setPropertyUtils(PropertyUtils propertyUtils)
setPropertyUtils in class BaseRepresenterprotected MappingNode representJavaBean(java.util.Set<Property> properties, java.lang.Object javaBean)
properties - JavaBean gettersjavaBean - instance for Nodeprotected NodeTuple representJavaBeanProperty(java.lang.Object javaBean, Property property, java.lang.Object propertyValue, Tag customTag)
javaBean - - the instance to be representedproperty - - the property of the instancepropertyValue - - value to be representedcustomTag - - user defined Tagprotected void checkGlobalTag(Property property, Node node, java.lang.Object object)
property - - JavaBean propertynode - - representation of the propertyobject - - instance represented by the nodeprivate void resetTag(java.lang.Class<? extends java.lang.Object> type,
Node node)
protected java.util.Set<Property> getProperties(java.lang.Class<? extends java.lang.Object> type)
type - - JavaBean to inspect the properties