|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.beans.impl.BasicMetaProperty<P>
org.joda.beans.impl.direct.DirectMetaProperty<P>
P - the type of the property contentpublic final class DirectMetaProperty<P>
A meta-property implementation designed for use by the code generator.
This meta-property uses reflection to find the Field to obtain the annotations.
| Method Summary | ||
|---|---|---|
|
annotation(Class<A> annotationClass)
Gets an annotation from the property. |
|
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
|
ofDerived(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
Factory to create a derived read-only meta-property avoiding duplicate generics. |
|
static
|
ofImmutable(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
Factory to create an imutable meta-property avoiding duplicate generics. |
|
static
|
ofReadOnly(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
Factory to create a read-only meta-property avoiding duplicate generics. |
|
static
|
ofReadOnlyBuildable(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
Factory to create a buildable read-only meta-property avoiding duplicate generics. |
|
static
|
ofReadWrite(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
Factory to create a read-write meta-property avoiding duplicate generics. |
|
static
|
ofWriteOnly(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
Factory to create a write-only meta-property avoiding duplicate generics. |
|
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. |
|
| Methods inherited from class org.joda.beans.impl.BasicMetaProperty |
|---|
createProperty, equals, getString, getString, hashCode, name, put, setString, setString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static <P> DirectMetaProperty<P> ofReadWrite(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
P - the property typemetaBean - the meta-bean, not nullpropertyName - the property name, not emptydeclaringType - the type declaring the property, not nullpropertyType - the property type, not null
public static <P> DirectMetaProperty<P> ofReadOnly(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
P - the property typemetaBean - the meta-bean, not nullpropertyName - the property name, not emptydeclaringType - the type declaring the property, not nullpropertyType - the property type, not null
public static <P> DirectMetaProperty<P> ofWriteOnly(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
P - the property typemetaBean - the meta-bean, not nullpropertyName - the property name, not emptydeclaringType - the type declaring the property, not nullpropertyType - the property type, not null
public static <P> DirectMetaProperty<P> ofReadOnlyBuildable(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
P - the property typemetaBean - the meta-bean, not nullpropertyName - the property name, not emptydeclaringType - the type declaring the property, not nullpropertyType - the property type, not null
public static <P> DirectMetaProperty<P> ofDerived(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
P - the property typemetaBean - the meta-bean, not nullpropertyName - the property name, not emptydeclaringType - the type declaring the property, not nullpropertyType - the property type, not null
public static <P> DirectMetaProperty<P> ofImmutable(MetaBean metaBean,
String propertyName,
Class<?> declaringType,
Class<P> propertyType)
P - the property typemetaBean - the meta-bean, not nullpropertyName - the property name, not emptydeclaringType - the type declaring the property, not nullpropertyType - the property type, not null
public 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 <A extends Annotation> A annotation(Class<A> annotationClass)
MetaPropertyThe annotations are queried from the property. This is typically accomplished by querying the annotations of the underlying instance variable.
annotation in interface MetaProperty<P>annotation in class BasicMetaProperty<P>A - the annotation typeannotationClass - the annotation class to find, not null
public List<Annotation> annotations()
MetaPropertyThe annotations are queried from the property. This is typically accomplished by querying the annotations of the underlying instance variable.
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 null
public 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 null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||