public class Property
extends java.lang.Object
Property
contains information about a single property of a
PropertyModule
.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> |
annotations |
protected java.lang.reflect.Method |
getter |
protected java.lang.String |
info |
protected com.google.inject.Module |
module |
protected java.lang.String |
name |
protected int |
order |
protected java.util.Collection<Requirement> |
requirements |
protected java.lang.reflect.Method |
setter |
protected java.lang.Class<?> |
type |
Constructor and Description |
---|
Property(com.google.inject.Module module,
java.lang.String name,
java.lang.Class<?> type,
java.lang.reflect.Method getter,
java.lang.reflect.Method setter,
java.lang.Iterable<java.lang.annotation.Annotation> annotations)
Constructs a
Property . |
Modifier and Type | Method and Description |
---|---|
void |
addRequirement(Requirement requirement)
Adds a
Requirement . |
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<? extends A> clazz)
Returns the annotation of the specified class or null if not existent.
|
java.util.Collection<java.lang.annotation.Annotation> |
getAnnotations()
Returns the annotations of this property.
|
java.lang.reflect.Method |
getGetter()
Returns the getter method.
|
java.lang.String |
getInfo()
Returns the info.
|
java.lang.String |
getName()
Returns the name.
|
int |
getOrder()
Returns the order.
|
java.util.Collection<Requirement> |
getRequirements()
Returns the requirements.
|
java.lang.reflect.Method |
getSetter()
Returns the setter method.
|
java.lang.Class<?> |
getType()
Returns the type.
|
java.lang.Object |
getValue()
Returns the value of the property.
|
boolean |
isActive()
Returns
true if the property is active. |
boolean |
isNumber()
Returns
true if the property represents a number. |
void |
setInfo(java.lang.String info)
Sets the info.
|
void |
setOrder(int order)
Sets the order.
|
void |
setValue(java.lang.Object value)
Sets the value of the property.
|
void |
setValue(java.lang.String value)
Sets the value of the property.
|
protected void |
setValueObject(java.lang.Object value)
Sets the value of the property.
|
protected final com.google.inject.Module module
protected final java.lang.String name
protected final java.lang.Class<?> type
protected final java.lang.reflect.Method getter
protected final java.lang.reflect.Method setter
protected java.lang.String info
protected int order
protected final java.util.Collection<Requirement> requirements
protected final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation> annotations
public Property(com.google.inject.Module module, java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.Iterable<java.lang.annotation.Annotation> annotations)
Property
.module
- the modulename
- the nametype
- the typegetter
- the getter methodsetter
- the setter methodannotations
- the annotationspublic java.lang.String getInfo()
setInfo(java.lang.String)
public void setInfo(java.lang.String info)
info
- the info to setgetInfo()
public int getOrder()
setOrder(int)
public void setOrder(int order)
order
- the order to setgetOrder()
public java.lang.String getName()
public java.lang.Class<?> getType()
public java.lang.reflect.Method getGetter()
public java.lang.reflect.Method getSetter()
public void addRequirement(Requirement requirement)
Requirement
.requirement
- the requirement to addpublic boolean isActive()
true
if the property is active.true
if the property is activepublic java.util.Collection<Requirement> getRequirements()
public java.lang.Object getValue()
setValue(java.lang.Object)
public void setValue(java.lang.Object value) throws java.lang.reflect.InvocationTargetException
value
- the value to setjava.lang.reflect.InvocationTargetException
- thrown if the value cannot be assignedgetValue()
public void setValue(java.lang.String value) throws java.lang.reflect.InvocationTargetException
value
- the value to setjava.lang.reflect.InvocationTargetException
- thrown if the value cannot be assignedpublic boolean isNumber()
true
if the property represents a number.true
if the property represents a numberprotected void setValueObject(java.lang.Object value) throws java.lang.reflect.InvocationTargetException
value
- the value to setjava.lang.reflect.InvocationTargetException
- thrown if the value cannot be assignedpublic java.util.Collection<java.lang.annotation.Annotation> getAnnotations()
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<? extends A> clazz)
A
- the annotation typeclazz
- the specific annotation class