Class POJOPropertyBuilder
- java.lang.Object
-
- org.codehaus.jackson.map.BeanPropertyDefinition
-
- org.codehaus.jackson.map.introspect.POJOPropertyBuilder
-
- All Implemented Interfaces:
Comparable<POJOPropertyBuilder>
,Named
public class POJOPropertyBuilder extends BeanPropertyDefinition implements 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>
_ctorParameters
protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedField>
_fields
protected org.codehaus.jackson.map.introspect.POJOPropertyBuilder.Node<AnnotatedMethod>
_getters
protected String
_internalName
Original internal name, derived from accessor, of this property.protected String
_name
External 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(String internalName)
POJOPropertyBuilder(POJOPropertyBuilder src, String newName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(POJOPropertyBuilder src)
Method for adding all property members from specified collector into this collector.void
addCtor(AnnotatedParameter a, String ename, boolean visible, boolean ignored)
void
addField(AnnotatedField a, String ename, boolean visible, boolean ignored)
void
addGetter(AnnotatedMethod a, String ename, boolean visible, boolean ignored)
void
addSetter(AnnotatedMethod a, String ename, boolean visible, boolean ignored)
boolean
anyExplicitNames()
boolean
anyIgnorals()
boolean
anyVisible()
int
compareTo(POJOPropertyBuilder other)
boolean
couldSerialize()
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.AnnotatedMember
getAccessor()
Method used to find accessor (getter, field to access) to use for accessing value of the property.AnnotatedParameter
getConstructorParameter()
AnnotatedField
getField()
AnnotatedMethod
getGetter()
String
getInternalName()
Accessor that can be used to determine implicit name from underlying element(s) before possible renaming.AnnotatedMember
getMutator()
Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property.String
getName()
Accessor for name used for external representation (in JSON).AnnotatedMethod
getSetter()
boolean
hasConstructorParameter()
boolean
hasField()
boolean
hasGetter()
boolean
hasSetter()
void
mergeAnnotations(boolean forSerialization)
void
removeIgnored()
Method called to remove all entries that are marked as ignored.void
removeNonVisible()
String
toString()
void
trimByVisibility()
Method called to trim unnecessary entries, such as implicit getter if there is an explict one available.POJOPropertyBuilder
withName(String newName)
Method for constructing a renamed instance-
Methods inherited from class org.codehaus.jackson.map.BeanPropertyDefinition
couldDeserialize
-
-
-
-
Field Detail
-
_name
protected final String _name
External name of logical property; may change with renaming (by new instance being constructed using a new name)
-
_internalName
protected final 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(String internalName)
-
POJOPropertyBuilder
public POJOPropertyBuilder(POJOPropertyBuilder src, String newName)
-
-
Method Detail
-
withName
public POJOPropertyBuilder withName(String newName)
Method for constructing a renamed instance
-
compareTo
public int compareTo(POJOPropertyBuilder other)
- Specified by:
compareTo
in interfaceComparable<POJOPropertyBuilder>
-
getName
public String getName()
Description copied from class:BeanPropertyDefinition
Accessor for name used for external representation (in JSON).- Specified by:
getName
in interfaceNamed
- Specified by:
getName
in classBeanPropertyDefinition
-
getInternalName
public String getInternalName()
Description copied from class:BeanPropertyDefinition
Accessor 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:
getInternalName
in classBeanPropertyDefinition
-
hasGetter
public boolean hasGetter()
- Specified by:
hasGetter
in classBeanPropertyDefinition
-
hasSetter
public boolean hasSetter()
- Specified by:
hasSetter
in classBeanPropertyDefinition
-
hasField
public boolean hasField()
- Specified by:
hasField
in classBeanPropertyDefinition
-
hasConstructorParameter
public boolean hasConstructorParameter()
- Specified by:
hasConstructorParameter
in classBeanPropertyDefinition
-
getAccessor
public AnnotatedMember getAccessor()
Description copied from class:BeanPropertyDefinition
Method used to find accessor (getter, field to access) to use for accessing value of the property. Null if no such member exists.- Specified by:
getAccessor
in classBeanPropertyDefinition
-
getMutator
public AnnotatedMember getMutator()
Description copied from class:BeanPropertyDefinition
Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property. Null if no such member exists.- Specified by:
getMutator
in classBeanPropertyDefinition
-
couldSerialize
public boolean couldSerialize()
- Overrides:
couldSerialize
in classBeanPropertyDefinition
-
getGetter
public AnnotatedMethod getGetter()
- Specified by:
getGetter
in classBeanPropertyDefinition
-
getSetter
public AnnotatedMethod getSetter()
- Specified by:
getSetter
in classBeanPropertyDefinition
-
getField
public AnnotatedField getField()
- Specified by:
getField
in classBeanPropertyDefinition
-
getConstructorParameter
public AnnotatedParameter getConstructorParameter()
- Specified by:
getConstructorParameter
in classBeanPropertyDefinition
-
addField
public void addField(AnnotatedField a, String ename, boolean visible, boolean ignored)
-
addCtor
public void addCtor(AnnotatedParameter a, String ename, boolean visible, boolean ignored)
-
addGetter
public void addGetter(AnnotatedMethod a, String ename, boolean visible, boolean ignored)
-
addSetter
public void addSetter(AnnotatedMethod a, 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()
-
findNewName
public 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.
-
-