Class POJOPropertyBuilder
- java.lang.Object
-
- org.codehaus.jackson.map.BeanPropertyDefinition
-
- org.codehaus.jackson.map.introspect.POJOPropertyBuilder
-
- All Implemented Interfaces:
java.lang.Comparable<POJOPropertyBuilder>,Named
public class POJOPropertyBuilder extends BeanPropertyDefinition implements java.lang.Comparable<POJOPropertyBuilder>
Helper class used for aggregating information about a single potential POJO property.- Since:
- 1.9
-
-
Field Summary
Fields Modifier and Type Field Description protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedParameter>_ctorParametersprotected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedField>_fieldsprotected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedMethod>_gettersprotected java.lang.String_internalNameOriginal internal name, derived from accessor, of this property.protected java.lang.String_nameExternal name of logical property; may change with renaming (by new instance being constructed using a new name)protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedMethod>_setters
-
Constructor Summary
Constructors Constructor Description POJOPropertyBuilder(java.lang.String internalName)POJOPropertyBuilder(POJOPropertyBuilder src, java.lang.String newName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(POJOPropertyBuilder src)Method for adding all property members from specified collector into this collector.voidaddCtor(AnnotatedParameter a, java.lang.String ename, boolean visible, boolean ignored)voidaddField(AnnotatedField a, java.lang.String ename, boolean visible, boolean ignored)voidaddGetter(AnnotatedMethod a, java.lang.String ename, boolean visible, boolean ignored)voidaddSetter(AnnotatedMethod a, java.lang.String ename, boolean visible, boolean ignored)booleananyDeserializeIgnorals()booleananyExplicitNames()booleananyIgnorals()booleananySerializeIgnorals()booleananyVisible()intcompareTo(POJOPropertyBuilder other)booleancouldSerialize()java.lang.StringfindNewName()Method called to check whether property represented by this collector should be renamed from the implicit name; and also verify that there are no conflicting rename definitions.AnnotatedMembergetAccessor()Method used to find accessor (getter, field to access) to use for accessing value of the property.AnnotatedParametergetConstructorParameter()AnnotatedFieldgetField()AnnotatedMethodgetGetter()java.lang.StringgetInternalName()Accessor that can be used to determine implicit name from underlying element(s) before possible renaming.AnnotatedMembergetMutator()Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property.java.lang.StringgetName()Accessor for name used for external representation (in JSON).AnnotatedMethodgetSetter()booleanhasConstructorParameter()booleanhasField()booleanhasGetter()booleanhasSetter()booleanisExplicitlyIncluded()Accessor that can be called to check whether property was included due to an explicit marker (usually annotation), or just by naming convention.voidmergeAnnotations(boolean forSerialization)voidremoveIgnored()Method called to remove all entries that are marked as ignored.voidremoveNonVisible()java.lang.StringtoString()voidtrimByVisibility()Method called to trim unnecessary entries, such as implicit getter if there is an explict one available.POJOPropertyBuilderwithName(java.lang.String newName)Method for constructing a renamed instance-
Methods inherited from class org.codehaus.jackson.map.BeanPropertyDefinition
couldDeserialize
-
-
-
-
Field Detail
-
_name
protected final java.lang.String _name
External name of logical property; may change with renaming (by new instance being constructed using a new name)
-
_internalName
protected final java.lang.String _internalName
Original internal name, derived from accessor, of this property. Will not be changed by renaming.
-
_fields
protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedField> _fields
-
_ctorParameters
protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedParameter> _ctorParameters
-
_getters
protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedMethod> _getters
-
_setters
protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedMethod> _setters
-
-
Constructor Detail
-
POJOPropertyBuilder
public POJOPropertyBuilder(java.lang.String internalName)
-
POJOPropertyBuilder
public POJOPropertyBuilder(POJOPropertyBuilder src, java.lang.String newName)
-
-
Method Detail
-
withName
public POJOPropertyBuilder withName(java.lang.String newName)
Method for constructing a renamed instance
-
compareTo
public int compareTo(POJOPropertyBuilder other)
- Specified by:
compareToin interfacejava.lang.Comparable<POJOPropertyBuilder>
-
getName
public java.lang.String getName()
Description copied from class:BeanPropertyDefinitionAccessor for name used for external representation (in JSON).- Specified by:
getNamein interfaceNamed- Specified by:
getNamein classBeanPropertyDefinition
-
getInternalName
public java.lang.String getInternalName()
Description copied from class:BeanPropertyDefinitionAccessor that can be used to determine implicit name from underlying element(s) before possible renaming. This is the "internal" name derived from accessor ("x" from "getX"), and is not based on annotations or naming strategy.- Specified by:
getInternalNamein classBeanPropertyDefinition
-
isExplicitlyIncluded
public boolean isExplicitlyIncluded()
Description copied from class:BeanPropertyDefinitionAccessor that can be called to check whether property was included due to an explicit marker (usually annotation), or just by naming convention.- Specified by:
isExplicitlyIncludedin classBeanPropertyDefinition- Returns:
- True if property was explicitly included (usually by having one of components being annotated); false if inclusion was purely due to naming or visibility definitions (that is, implicit)
-
hasGetter
public boolean hasGetter()
- Specified by:
hasGetterin classBeanPropertyDefinition
-
hasSetter
public boolean hasSetter()
- Specified by:
hasSetterin classBeanPropertyDefinition
-
hasField
public boolean hasField()
- Specified by:
hasFieldin classBeanPropertyDefinition
-
hasConstructorParameter
public boolean hasConstructorParameter()
- Specified by:
hasConstructorParameterin classBeanPropertyDefinition
-
getAccessor
public AnnotatedMember getAccessor()
Description copied from class:BeanPropertyDefinitionMethod used to find accessor (getter, field to access) to use for accessing value of the property. Null if no such member exists.- Specified by:
getAccessorin classBeanPropertyDefinition
-
getMutator
public AnnotatedMember getMutator()
Description copied from class:BeanPropertyDefinitionMethod used to find mutator (constructor parameter, setter, field) to use for changing value of the property. Null if no such member exists.- Specified by:
getMutatorin classBeanPropertyDefinition
-
couldSerialize
public boolean couldSerialize()
- Overrides:
couldSerializein classBeanPropertyDefinition
-
getGetter
public AnnotatedMethod getGetter()
- Specified by:
getGetterin classBeanPropertyDefinition
-
getSetter
public AnnotatedMethod getSetter()
- Specified by:
getSetterin classBeanPropertyDefinition
-
getField
public AnnotatedField getField()
- Specified by:
getFieldin classBeanPropertyDefinition
-
getConstructorParameter
public AnnotatedParameter getConstructorParameter()
- Specified by:
getConstructorParameterin classBeanPropertyDefinition
-
addField
public void addField(AnnotatedField a, java.lang.String ename, boolean visible, boolean ignored)
-
addCtor
public void addCtor(AnnotatedParameter a, java.lang.String ename, boolean visible, boolean ignored)
-
addGetter
public void addGetter(AnnotatedMethod a, java.lang.String ename, boolean visible, boolean ignored)
-
addSetter
public void addSetter(AnnotatedMethod a, java.lang.String ename, boolean visible, boolean ignored)
-
addAll
public void addAll(POJOPropertyBuilder src)
Method for adding all property members from specified collector into this collector.
-
removeIgnored
public void removeIgnored()
Method called to remove all entries that are marked as ignored.
-
removeNonVisible
public void removeNonVisible()
-
trimByVisibility
public void trimByVisibility()
Method called to trim unnecessary entries, such as implicit getter if there is an explict one available. This is important for later stages, to avoid unnecessary conflicts.
-
mergeAnnotations
public void mergeAnnotations(boolean forSerialization)
-
anyExplicitNames
public boolean anyExplicitNames()
-
anyVisible
public boolean anyVisible()
-
anyIgnorals
public boolean anyIgnorals()
-
anyDeserializeIgnorals
public boolean anyDeserializeIgnorals()
-
anySerializeIgnorals
public boolean anySerializeIgnorals()
-
findNewName
public java.lang.String findNewName()
Method called to check whether property represented by this collector should be renamed from the implicit name; and also verify that there are no conflicting rename definitions.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-