P - the type of the property contentpublic final class StandaloneMetaProperty<P> extends BasicMetaProperty<P>
One use case for this is to handle renamed properties in SerDeserializer.
| Modifier and Type | Method and Description |
|---|---|
List<Annotation> |
annotations()
Gets the annotations of the property.
|
Class<?> |
declaringType()
Get the type that declares the property, represented as a
Class. |
P |
get(Bean bean)
Gets the value of the property for the specified bean.
|
MetaBean |
metaBean()
Gets the meta-bean which owns this meta-property.
|
static <R> StandaloneMetaProperty<R> |
of(String propertyName,
MetaBean metaBean,
Class<R> clazz)
Creates a non-generified property.
|
static <R> StandaloneMetaProperty<R> |
of(String propertyName,
MetaBean metaBean,
Class<R> clazz,
Type type)
Creates a property.
|
Type |
propertyGenericType()
Gets the generic types of the property.
|
Class<P> |
propertyType()
Get the type of the property represented as a
Class. |
void |
set(Bean bean,
Object value)
Sets the value of the property on the specified bean.
|
PropertyStyle |
style()
Gets the style of the property, such as read-only, read-write or write-only.
|
equals, hashCode, name, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitannotation, createProperty, getString, getString, put, setString, setStringpublic static <R> StandaloneMetaProperty<R> of(String propertyName, MetaBean metaBean, Class<R> clazz)
R - the property typepropertyName - the property name, not emptymetaBean - the meta-bean, which does not have to refer to this property, not nullclazz - the type of the property, not nullpublic static <R> StandaloneMetaProperty<R> of(String propertyName, MetaBean metaBean, Class<R> clazz, Type type)
R - the property typepropertyName - the property name, not emptymetaBean - the meta-bean, which does not have to refer to this property, not nullclazz - the type of the property, not nulltype - the type of the property, not nullpublic MetaBean metaBean()
MetaPropertyEach meta-property is fully owned by a single bean.
public Class<?> declaringType()
MetaPropertyClass.
This is the type of the bean where the property is declared.
public Class<P> propertyType()
MetaPropertyClass.
This is the type of the property.
For example, the surname of a person would typically be a String.
public Type propertyGenericType()
MetaPropertyThis provides access to the generic type declared in the source code.
public PropertyStyle style()
MetaPropertyRather than testing against specific values, it is strongly recommended to call the helper methods on the returned style.
public List<Annotation> annotations()
MetaPropertyThe annotations are queried from the property. This is typically accomplished by querying the annotations of the underlying instance variable however any strategy is permitted.
public P get(Bean bean)
MetaProperty
For a standard JavaBean, this is equivalent to calling getFoo() on the bean.
Alternate implementations may perform any logic to obtain the value.
bean - the bean to query, not nullpublic void set(Bean bean, Object value)
MetaProperty
The value must be of the correct type for the property.
For a standard JavaBean, this is equivalent to calling setFoo() on the bean.
Alternate implementations may perform any logic to change the value.
bean - the bean to update, not nullvalue - the value to set into the property on the specified bean, may be nullCopyright © 2007–2017 Joda.org. All rights reserved.