class
attribute is specified
this element accesses static field of specified class.
This element defines getter if it contains no argument.
It returns the value of the field in this case.
For example:<field name="TYPE" class="java.lang.Long"/>is equivalent to
Long.TYPE
in Java code.
This element defines setter if it contains one argument.
It does not return the value of the field in this case.
For example:<field name="id"><int>0</int></field>is equivalent to
id = 0
in Java code.
The following attributes are supported:
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | addAttribute(String
the attribute name name, String the attribute value value)Overrides com. |
private static Field | |
protected Object | Returns: the context of the fieldOverrides com. |
pack-priv static Object | Returns: the value of the fieldthe context bean that contains field bean, String the name of the field name)Performs the search of the field with specified |
protected Object | Returns: the value of the specified fieldthe name of the field name)Implements abstract com. name .
|
protected boolean | Returns: true if the value of this element should be used
as an argument of the element that contained in this one,
false otherwise |
private static void | setFieldValue(Object
the context bean that contains field bean, String the name of the field name, Object the new value for the field value)Performs the search of the field with specified |
protected void | setValue(String
the name of the field name, Object the new value for the specified field value)Implements abstract com. name .
|
type | back to summary |
---|---|
private Class<?> type |
FieldElementHandler | back to summary |
---|---|
pack-priv FieldElementHandler() |
addAttribute | back to summary |
---|---|
public void addAttribute(String name, String value) Overrides com. Parses attributes of the element. The following attributes are supported:
|
findField | back to summary |
---|---|
private static Field findField(Object bean, String name) throws NoSuchFieldException Performs the search of the field
with specified
|
getContextBean | back to summary |
---|---|
protected Object getContextBean() Overrides com. Returns the context of the field. The context of the static field is the class object. The context of the non-static field is the value of the parent element. |
getFieldValue | back to summary |
---|---|
pack-priv static Object getFieldValue(Object bean, String name) throws IllegalAccessException, NoSuchFieldException Performs the search of the field with specified
|
getValue | back to summary |
---|---|
protected Object getValue(String name) Implements abstract com. Returns the value of the field with specified |
isArgument | back to summary |
---|---|
protected boolean isArgument() Overrides com. Tests whether the value of this element can be used as an argument of the element that contained in this one.
|
setFieldValue | back to summary |
---|---|
private static void setFieldValue(Object bean, String name, Object value) throws IllegalAccessException, NoSuchFieldException Performs the search of the field with specified
|
setValue | back to summary |
---|---|
protected void setValue(String name, Object value) Implements abstract com. Sets the new value for the field with specified |