|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.beans.impl.BasicMetaProperty<P>
P - the type of the property contentpublic abstract class BasicMetaProperty<P>
An abstract base meta-property.
| Constructor Summary | |
|---|---|
protected |
BasicMetaProperty(String propertyName)
Constructor. |
| Method Summary | ||
|---|---|---|
|
annotation(Class<A> annotationClass)
Gets an annotation from the property. |
|
Property<P> |
createProperty(Bean bean)
Creates a property that binds this meta-property to a specific bean. |
|
boolean |
equals(Object obj)
Checks if this meta-property equals another. |
|
String |
getString(Bean bean)
Gets the value of the property for the specified bean converted to a string. |
|
String |
getString(Bean bean,
org.joda.convert.StringConvert stringConvert)
Gets the value of the property for the specified bean converted to a string. |
|
int |
hashCode()
Returns a suitable hash code. |
|
String |
name()
Gets the property name. |
|
P |
put(Bean bean,
Object value)
Sets the value of the property on the associated bean and returns the previous value. |
|
void |
setString(Bean bean,
String value)
Sets the value of the property on the specified bean from a string by conversion. |
|
void |
setString(Bean bean,
String value,
org.joda.convert.StringConvert stringConvert)
Sets the value of the property on the specified bean from a string by conversion. |
|
String |
toString()
Returns a string that summarises the meta-property. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.joda.beans.MetaProperty |
|---|
annotations, declaringType, get, metaBean, propertyGenericType, propertyType, set, style |
| Constructor Detail |
|---|
protected BasicMetaProperty(String propertyName)
propertyName - the property name, not empty| Method Detail |
|---|
public Property<P> createProperty(Bean bean)
MetaProperty
This method returns a Property instance that connects this meta-property to the specified bean.
The result can be queried and passed around without further reference to the bean.
createProperty in interface MetaProperty<P>bean - the bean to create the property for, not null
public String name()
MetaPropertyThe JavaBean style methods getFoo() and setFoo() will lead to a property name of 'foo' and so on.
name in interface MetaProperty<P>
public P put(Bean bean,
Object value)
MetaProperty
The value must be of the correct type for the property.
This is a combination of the get and set methods that matches the definition
of put in a Map.
put in interface MetaProperty<P>bean - the bean to update, not nullvalue - the value to set into the property on the specified bean, may be null
public String getString(Bean bean)
MetaProperty
This converts the result of MetaProperty.get(Bean) to a standard format string.
Conversion uses Joda-Convert.
Not all object types can be converted to a string, see Joda-Convert.
For a standard JavaBean, this is equivalent to calling getFoo() on the bean.
Alternate implementations may perform any logic to obtain the value.
getString in interface MetaProperty<P>bean - the bean to query, not null
public String getString(Bean bean,
org.joda.convert.StringConvert stringConvert)
MetaProperty
This converts the result of MetaProperty.get(Bean) to a standard format string using the supplied converter.
Not all object types can be converted to a string, see Joda-Convert.
For a standard JavaBean, this is equivalent to calling getFoo() on the bean.
Alternate implementations may perform any logic to obtain the value.
getString in interface MetaProperty<P>bean - the bean to query, not nullstringConvert - the converter to use, not null
public void setString(Bean bean,
String value)
MetaProperty
This converts the string to the correct type for the property and then sets it
using MetaProperty.set(Bean, Object). Conversion uses Joda-Convert.
setString in interface MetaProperty<P>bean - the bean to update, not nullvalue - the value to set into the property on the specified bean, may be null
public void setString(Bean bean,
String value,
org.joda.convert.StringConvert stringConvert)
MetaProperty
This converts the string to the correct type for the property using the supplied converter and then sets it
using MetaProperty.set(Bean, Object).
setString in interface MetaProperty<P>bean - the bean to update, not nullvalue - the value to set into the property on the specified bean, may be nullstringConvert - the converter, not nullpublic <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>A - the annotation typeannotationClass - the annotation class to find, not null
public boolean equals(Object obj)
MetaPropertyThis compares the property name and declaring type. It does not compare the property or bean types.
equals in interface MetaProperty<P>equals in class Objectobj - the other meta-property, null returns false
public int hashCode()
MetaProperty
hashCode in interface MetaProperty<P>hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||