Class BeanPropertyMeta
- All Implemented Interfaces:
- Comparable<BeanPropertyMeta>
Contains information such as type of property (e.g. field/getter/setter), class type of property value, and whether any transforms are associated with this property.
 Developers will typically not need access to this class.  The information provided by it is already exposed through
 several methods on the BeanMap API.
 
See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBeanPropertyMeta builder class.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates a new BeanPropertyMeta using the contents of the specified builder.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a value to aCollectionor array property.voidAdds a value to aMapor bean property.static BeanPropertyMeta.BuilderCreates a builder forBeanPropertyMeta(org.apache.juneau.BeanPropertyMeta.Builder)objects.booleancanRead()Returnstrue if this property can be read.booleancanWrite()Returnstrue if this property can be written.intboolean<A extends Annotation>
 BeanPropertyMetaforEachAnnotation(Class<A> a, Predicate<A> filter, Consumer<A> action) Performs an action on all matching instances of the specified annotation on the getter/setter/field of the property.Equivalent to callingBeanMap.get(Object), but is faster since it avoids looking up the property meta.<A extends Annotation>
 List<A>Returns all instances of the specified annotation in the hierarchy of this bean property.BeanMeta<?>Returns the bean meta that this property belongs to.Returns the bean dictionary in use for this bean property.ClassMeta<?>Returns theClassMetaof the class of this property.Returns the metadata on the property that this metadata is a delegate for.getDynaMap(Object bean) Returns theMapobject returned by the DynaBean getter.getField()Returns the field for this property.Returns the getter method for this property.Returns the field for this property even if the field is private.getName()Returns the name of this bean property.String[]Returns the override list of properties defined through a@Beanp(properties)annotation on this property.Equivalent to callingBeanMap.getRaw(Object), but is faster since it avoids looking up the property meta.Returns the setter method for this property.inthashCode()booleanisDyna()Returnstrue if this bean property is named"*" .booleanReturnstrue if this property is read-only.booleanisUri()Returnstrue if this bean property is a URI.protected booleanReturnstrue if this property is write-only.Equivalent to callingBeanMap.put(String, Object), but is faster since it avoids looking up the property meta.protected voidSets an array field on this bean.toString()
- 
Constructor Details- 
BeanPropertyMetaCreates a new BeanPropertyMeta using the contents of the specified builder.- Parameters:
- b- The builder to copy fields from.
 
 
- 
- 
Method Details- 
builderCreates a builder forBeanPropertyMeta(org.apache.juneau.BeanPropertyMeta.Builder)objects.- Parameters:
- beanMeta- The metadata on the bean
- name- The bean property name.
- Returns:
- A new builder.
 
- 
getNameReturns the name of this bean property.- Returns:
- The name of the bean property.
 
- 
getBeanMetaReturns the bean meta that this property belongs to.- Returns:
- The bean meta that this property belongs to.
 
- 
getGetterReturns the getter method for this property.- Returns:
- The getter method for this bean property, or null if there is no getter method.
 
- 
getSetterReturns the setter method for this property.- Returns:
- The setter method for this bean property, or null if there is no setter method.
 
- 
getFieldReturns the field for this property.- Returns:
- The field for this bean property, or null if there is no field associated with this bean property.
 
- 
getInnerFieldReturns the field for this property even if the field is private.- Returns:
- The field for this bean property, or null if there is no field associated with this bean property.
 
- 
getClassMetaReturns theClassMetaof the class of this property.If this property or the property type class has a ObjectSwapassociated with it, this method returns the transformed class meta. This matches the class type that is used by theget(BeanMap,String)andset(BeanMap,String,Object)methods.- Returns:
- The ClassMetaof the class of this property.
 
- 
getBeanRegistryReturns the bean dictionary in use for this bean property.The order of lookup for the dictionary is as follows: - Dictionary defined via @Beanp(dictionary).
- Dictionary defined via BeanContext.Builder.beanDictionary(Class...).
 - Returns:
- The bean dictionary in use for this bean property.  Never null .
 
- Dictionary defined via 
- 
isUriReturnstrue if this bean property is a URI.A bean property can be considered a URI if any of the following are true: - Returns:
- true if this bean property is a URI.
 
- 
isDynaReturnstrue if this bean property is named"*" .- Returns:
- true if this bean property is named- "*" .
 
- 
getPropertiesReturns the override list of properties defined through a@Beanp(properties)annotation on this property.- Returns:
- The list of override properties, or null if annotation not specified.
 
- 
getDelegateForReturns the metadata on the property that this metadata is a delegate for.- Returns:
- the metadata on the property that this metadata is a delegate for, or this object if it's not a delegate.
 
- 
getEquivalent to callingBeanMap.get(Object), but is faster since it avoids looking up the property meta.- Parameters:
- m- The bean map to get the transformed value from.
- pName- The property name if this is a dyna property (i.e.- "*" ).
 Otherwise can be- null .
- Returns:
- The property value.
   
 Returnsnull if this is a write-only property.
 
- 
getRawEquivalent to callingBeanMap.getRaw(Object), but is faster since it avoids looking up the property meta.- Parameters:
- m- The bean map to get the transformed value from.
- pName- The property name if this is a dyna property (i.e.- "*" ).
 Otherwise can be- null .
- Returns:
- The raw property value.
 
- 
setEquivalent to callingBeanMap.put(String, Object), but is faster since it avoids looking up the property meta.This is a no-op on a read-only property. - Parameters:
- m- The bean map to set the property value on.
- pName- The property name if this is a dyna property (i.e.- "*" ).
 Otherwise can be- null .
- value- The value to set.
- Returns:
- The previous property value.
- Throws:
- BeanRuntimeException- If property could not be set.
 
- 
getDynaMappublic Map<String,Object> getDynaMap(Object bean) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException Returns theMapobject returned by the DynaBean getter.The DynaBean property is the property whose name is "*" and returns a map of "extra" properties on the bean.- Parameters:
- bean- The bean.
- Returns:
- The map returned by the getter, or an empty map if the getter returned null or this isn't a DynaBean property.
- Throws:
- IllegalArgumentException- Thrown by method invocation.
- IllegalAccessException- Thrown by method invocation.
- InvocationTargetException- Thrown by method invocation.
 
- 
setArrayprotected void setArray(Object bean, List l) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException Sets an array field on this bean.Works on both Object and primitive arrays.- Parameters:
- bean- The bean of the field.
- l- The collection to use to set the array field.
- Throws:
- IllegalArgumentException- Thrown by method invocation.
- IllegalAccessException- Thrown by method invocation.
- InvocationTargetException- Thrown by method invocation.
 
- 
addAdds a value to aCollectionor array property.Note that adding values to an array property is inefficient for large arrays since it must copy the array into a larger array on each operation. - Parameters:
- m- The bean of the field being set.
- pName- The property name if this is a dyna property (i.e.- "*" ).
 Otherwise can be- null .
- value- The value to add to the field.
- Throws:
- BeanRuntimeException- If field is not a collection or array.
 
- 
addAdds a value to aMapor bean property.- Parameters:
- m- The bean of the field being set.
- pName- The property name if this is a dyna property (i.e.- "*" ).
 Otherwise can be- null .
- key- The key to add to the field.
- value- The value to add to the field.
- Throws:
- BeanRuntimeException- If field is not a map or array.
 
- 
getAllAnnotationsParentFirstReturns all instances of the specified annotation in the hierarchy of this bean property.Searches through the class hierarchy (e.g. superclasses, interfaces, packages) for all instances of the specified annotation. - Type Parameters:
- A- The class to find annotations for.
- Parameters:
- a- The class to find annotations for.
- Returns:
- A list of annotations ordered in parent-to-child order.  Never null .
 
- 
forEachAnnotationpublic <A extends Annotation> BeanPropertyMeta forEachAnnotation(Class<A> a, Predicate<A> filter, Consumer<A> action) Performs an action on all matching instances of the specified annotation on the getter/setter/field of the property.- Type Parameters:
- A- The class to find annotations for.
- Parameters:
- a- The class to find annotations for.
- filter- The filter to apply to the annotation.
- action- The action to perform against the annotation.
- Returns:
- A list of annotations ordered in child-to-parent order.  Never null .
 
- 
toString
- 
canReadReturnstrue if this property can be read.- Returns:
- true if this property can be read.
 
- 
canWriteReturnstrue if this property can be written.- Returns:
- true if this property can be written.
 
- 
isReadOnlyReturnstrue if this property is read-only.This implies the property MIGHT be writable, but that parsers should not set a value for it. - Returns:
- true if this property is read-only.
 
- 
isWriteOnlyReturnstrue if this property is write-only.This implies the property MIGHT be readable, but that serializers should not serialize it. - Returns:
- true if this property is write-only.
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<BeanPropertyMeta>
 
- 
hashCode
- 
equals
 
-