|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.yaml.snakeyaml.representer.BaseRepresenter
org.yaml.snakeyaml.representer.Representer
public class Representer
Represent JavaBeans
Nested Class Summary | |
---|---|
protected class |
Representer.RepresentJavaBean
|
Field Summary | |
---|---|
static java.util.regex.Pattern |
BINARY_PATTERN
|
protected java.util.Map<java.lang.Class<? extends java.lang.Object>,Tag> |
classTags
|
Fields inherited from class org.yaml.snakeyaml.representer.BaseRepresenter |
---|
defaultFlowStyle, multiRepresenters, nullRepresenter, objectToRepresent, representedObjects, representers, withCheckedTag |
Constructor Summary | |
---|---|
Representer()
|
Method Summary | |
---|---|
Tag |
addClassTag(java.lang.Class<? extends java.lang.Object> clazz,
java.lang.String tag)
Deprecated. use Tag instead of String |
Tag |
addClassTag(java.lang.Class<? extends java.lang.Object> clazz,
Tag tag)
Define a tag for the Class to serialize. |
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 Tag |
getTag(java.lang.Class<?> clazz,
Tag defaultTag)
|
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. |
Methods inherited from class org.yaml.snakeyaml.representer.BaseRepresenter |
---|
getPropertyUtils, isExplicitPropertyUtils, represent, representData, representMapping, representScalar, representScalar, representSequence, setDefaultFlowStyle, setDefaultScalarStyle, setPropertyUtils |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.Class<? extends java.lang.Object>,Tag> classTags
public static java.util.regex.Pattern BINARY_PATTERN
Constructor Detail |
---|
public Representer()
Method Detail |
---|
protected MappingNode representJavaBean(java.util.Set<Property> properties, java.lang.Object javaBean)
properties
- JavaBean gettersjavaBean
- instance for Node
protected 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 Tag
protected void checkGlobalTag(Property property, Node node, java.lang.Object object)
property
- - JavaBean propertynode
- - representation of the propertyobject
- - instance represented by the nodeprotected java.util.Set<Property> getProperties(java.lang.Class<? extends java.lang.Object> type) throws java.beans.IntrospectionException
type
- - JavaBean to inspect the properties
java.beans.IntrospectionException
protected Tag getTag(java.lang.Class<?> clazz, Tag defaultTag)
public Tag addClassTag(java.lang.Class<? extends java.lang.Object> clazz, java.lang.String tag)
Class
to serialize
clazz
- Class
which tag is changedtag
- new tag to be used for every instance of the specified
Class
Class
public Tag addClassTag(java.lang.Class<? extends java.lang.Object> clazz, Tag tag)
Class
to serialize.
clazz
- Class
which tag is changedtag
- new tag to be used for every instance of the specified
Class
Class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |