Package eu.woolplatform.utils.beans
Class PropertySpec
- java.lang.Object
-
- eu.woolplatform.utils.beans.PropertySpec
-
public class PropertySpec extends Object
The specification of a property in a JavaBeans-like object. A property may be accessed by a public field or getter and setter methods. An instance of this class can be obtained from thePropertyScanner.
-
-
Constructor Summary
Constructors Constructor Description PropertySpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldgetField()Returns the field.MethodgetGetMethod()Returns the get method if the field is not public.StringgetName()Returns the field name.MethodgetSetMethod()Returns the set method if the field is not public.booleanisPublic()Returns whether the field is public.voidsetField(Field field)Sets the field.voidsetGetMethod(Method getMethod)Sets the get method.voidsetName(String name)Sets the field name.voidsetPublic(boolean isPublic)Sets whether the field is public.voidsetSetMethod(Method setMethod)Sets the set method.StringtoString()
-
-
-
Method Detail
-
getName
public String getName()
Returns the field name.- Returns:
- the field name
-
setName
public void setName(String name)
Sets the field name.- Parameters:
name- the field name
-
getField
public Field getField()
Returns the field. Note that it may not be public. SeeisPublic().- Returns:
- the field
-
setField
public void setField(Field field)
Sets the field.- Parameters:
field- the field
-
isPublic
public boolean isPublic()
Returns whether the field is public. If not, then usegetGetMethod()andgetSetMethod().- Returns:
- true if the field is public
-
setPublic
public void setPublic(boolean isPublic)
Sets whether the field is public. If not, you should set the get method and set method.- Parameters:
isPublic- true if the field is public
-
getGetMethod
public Method getGetMethod()
Returns the get method if the field is not public.- Returns:
- the get method
-
setGetMethod
public void setGetMethod(Method getMethod)
Sets the get method. This should be done if the field is not public.- Parameters:
getMethod- the get method
-
getSetMethod
public Method getSetMethod()
Returns the set method if the field is not public.- Returns:
- the set method
-
setSetMethod
public void setSetMethod(Method setMethod)
Sets the set method. This should be done if the field is not public.- Parameters:
setMethod- the set method
-
-