|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.loom.binding.PropertyWrapper
public class PropertyWrapper
Wraps a property, allowing to read and write it in an encapsulated way
Constructor Summary | |
---|---|
PropertyWrapper(java.lang.Class<?> containerClass,
java.lang.String propertyName)
|
Method Summary | ||
---|---|---|
void |
addAnnotations(java.lang.reflect.AnnotatedElement element)
Adds the element annotations to this property wrapper |
|
protected java.lang.Object |
get(java.lang.Object container)
|
|
java.lang.Object |
get(java.lang.Object container,
boolean createIfNull)
Gets the property value |
|
|
getAnnotation(java.lang.Class<T> annotationClass)
|
|
java.lang.annotation.Annotation[] |
getAnnotations()
|
|
java.lang.Class<?> |
getContainerClass()
|
|
java.lang.String |
getDisplayName()
|
|
java.lang.reflect.Field |
getField()
|
|
java.lang.reflect.Method |
getGetter()
|
|
ImplementationFactory<?> |
getImplementationFactory()
|
|
ItemMetadata |
getItemMetadata()
|
|
ItemMetadata |
getItemMetadata(int index)
|
|
int |
getItemMetadataSize()
|
|
java.lang.String |
getName()
|
|
java.lang.Class<?> |
getNextPropertyClass()
|
|
java.lang.Object |
getNullValue()
|
|
java.lang.Class<?> |
getPropertyClass()
|
|
java.lang.String |
getPropertyName()
|
|
java.lang.reflect.Method |
getSetter()
|
|
java.lang.Class<?> |
guessCollectionGenericType()
Guess the collection generic type of this property, if possible. |
|
java.lang.Class<?> |
guessMapGenericKeyType()
Guess the Map generic type used for the key of this Map property, String.class if it cannot be guessed. |
|
java.lang.Class<?> |
guessMapGenericValueType()
Guess the Map generic type used for the value of this Map property, String.class if it cannot be guessed. |
|
boolean |
isCollection()
|
|
boolean |
isMap()
|
|
boolean |
isReadOnly()
|
|
boolean |
isSet()
|
|
void |
set(java.lang.Object container,
java.lang.Object value)
Sets a value to this property in the specified container |
|
void |
setContainerClass(java.lang.Class<?> containerClass)
|
|
void |
setField(java.lang.reflect.Field field)
|
|
void |
setGetter(java.lang.reflect.Method getter)
|
|
void |
setImplementationFactory(ImplementationFactory<?> valueFactory)
|
|
void |
setItemMetadata(ItemMetadata itemMetadata)
|
|
void |
setItemMetadata(ItemMetadata[] itemMetadata)
|
|
void |
setNullValue(java.lang.Object nullValue)
|
|
void |
setPropertyClass(java.lang.Class<?> propertyClass)
|
|
void |
setPropertyName(java.lang.String propertyName)
|
|
void |
setSetter(java.lang.reflect.Method setter)
|
|
java.lang.String |
toString()
for debugging purposes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PropertyWrapper(java.lang.Class<?> containerClass, java.lang.String propertyName)
Method Detail |
---|
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
getAnnotation
in interface AnnotationContainer
public void addAnnotations(java.lang.reflect.AnnotatedElement element)
element
- public java.lang.Object get(java.lang.Object container, boolean createIfNull)
container
- The object that contains the propertycreateIfNull
- if true, creates a new instance if the property value is null
public void setField(java.lang.reflect.Field field)
public void setGetter(java.lang.reflect.Method getter)
public void setSetter(java.lang.reflect.Method setter)
protected java.lang.Object get(java.lang.Object container)
public void set(java.lang.Object container, java.lang.Object value)
public boolean isCollection()
isCollection
in interface AnnotationContainer
public boolean isMap()
isMap
in interface AnnotationContainer
public boolean isSet()
public java.lang.reflect.Field getField()
public java.lang.reflect.Method getGetter()
public java.lang.reflect.Method getSetter()
public boolean isReadOnly()
public java.lang.annotation.Annotation[] getAnnotations()
getAnnotations
in interface AnnotationContainer
public java.lang.Class<?> getContainerClass()
public java.lang.Class<?> getPropertyClass()
getPropertyClass
in interface AnnotationContainer
public java.lang.String getPropertyName()
public java.lang.String getName()
getName
in interface AnnotationContainer
public void setContainerClass(java.lang.Class<?> containerClass)
public void setPropertyClass(java.lang.Class<?> propertyClass)
public java.lang.String getDisplayName()
getDisplayName
in interface AnnotationContainer
public void setPropertyName(java.lang.String propertyName)
public ImplementationFactory<?> getImplementationFactory()
public void setImplementationFactory(ImplementationFactory<?> valueFactory)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object getNullValue()
public void setNullValue(java.lang.Object nullValue)
public void setItemMetadata(ItemMetadata itemMetadata)
public void setItemMetadata(ItemMetadata[] itemMetadata)
public ItemMetadata getItemMetadata()
public ItemMetadata getItemMetadata(int index)
getItemMetadata
in interface AnnotationContainer
public int getItemMetadataSize()
getItemMetadataSize
in interface AnnotationContainer
public java.lang.Class<?> getNextPropertyClass()
public java.lang.Class<?> guessCollectionGenericType()
guessCollectionGenericType
in interface AnnotationContainer
public java.lang.Class<?> guessMapGenericKeyType()
guessMapGenericKeyType
in interface AnnotationContainer
public java.lang.Class<?> guessMapGenericValueType()
guessMapGenericValueType
in interface AnnotationContainer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |