org.yaml.snakeyaml.representer
public class Representer extends BaseRepresenter
| Modifier and Type | Class and Description |
|---|---|
protected class |
Representer.RepresentJavaBean |
| Modifier and Type | Field and Description |
|---|---|
protected Map<Class<? extends Object>,Tag> |
classTags |
static Pattern |
MULTILINE_PATTERN |
protected TimeZone |
timeZone |
defaultFlowStyle, defaultScalarStyle, multiRepresenters, nullRepresenter, objectToRepresent, representedObjects, representers| Constructor and Description |
|---|
Representer() |
| Modifier and Type | Method and Description |
|---|---|
Tag |
addClassTag(Class<? extends Object> clazz,
Tag tag)
Define a tag for the
Class to serialize. |
protected void |
checkGlobalTag(Property property,
Node node,
Object object)
Remove redundant global tag for a type safe (generic) collection if it is
the same as defined by the JavaBean property
|
protected Set<Property> |
getProperties(Class<? extends Object> type)
Get JavaBean properties to be serialised.
|
protected Tag |
getTag(Class<?> clazz,
Tag defaultTag) |
TimeZone |
getTimeZone() |
protected MappingNode |
representJavaBean(Set<Property> properties,
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(Object javaBean,
Property property,
Object propertyValue,
Tag customTag)
Represent one JavaBean property.
|
void |
setTimeZone(TimeZone timeZone) |
getDefaultFlowStyle, getPropertyUtils, isExplicitPropertyUtils, represent, representData, representMapping, representScalar, representScalar, representSequence, setDefaultFlowStyle, setDefaultScalarStyle, setPropertyUtilsprotected TimeZone timeZone
public static Pattern MULTILINE_PATTERN
protected MappingNode representJavaBean(Set<Property> properties, Object javaBean)
properties - JavaBean gettersjavaBean - instance for Nodeprotected NodeTuple representJavaBeanProperty(Object javaBean, Property property, 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, Object object)
property - - JavaBean propertynode - - representation of the propertyobject - - instance represented by the nodeprotected Set<Property> getProperties(Class<? extends Object> type) throws IntrospectionException
type - - JavaBean to inspect the propertiesIntrospectionExceptionpublic Tag addClassTag(Class<? extends Object> clazz, Tag tag)
Class to serialize.clazz - Class which tag is changedtag - new tag to be used for every instance of the specified
ClassClasspublic TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
Copyright © 2008–2015. All rights reserved.