class attribute denotes
the name of the class to instantiate.
The inner elements specifies the arguments of the constructor.
For example:
<new class="java.lang.Long">
<string>10</string>
</new>
is equivalent to Long.valueOf("10") in Java code.
The following attributes are supported:
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private Class | |
| private ValueObject |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | addArgument(Object
the value of the element that contained in this one argument)Overrides com. Adds the argument to the list of arguments that is used to calculate the value of this element. |
| public void | addAttribute(String
the attribute name name, String the attribute value value)Overrides com. Parses attributes of the element. |
| pack-priv static Object[] | Returns: the resolved array of argumentsthe array of arguments arguments, Class<?>[] the array of parameter types types)Resolves variable arguments. |
| pack-priv static Class | Returns: the array of corresponding classesthe array of arguments arguments)Converts the array of arguments to the array of corresponding classes. |
| protected final Object | Returns: the context of the methodOverrides com. Returns the context of the method. |
| protected final ValueObject | Returns: the value of this elementImplements abstract com. Returns the value of this element. |
| pack-priv ValueObject | Returns: the value of this elementthe base class type, Object[] the array of arguments args)Calculates the value of this element using the base class and the array of arguments. |
| arguments | back to summary |
|---|---|
| private List<Object> arguments | |
| type | back to summary |
|---|---|
| private Class<?> type | |
| value | back to summary |
|---|---|
| private ValueObject value | |
| NewElementHandler | back to summary |
|---|---|
| pack-priv NewElementHandler() | |
| addArgument | back to summary |
|---|---|
| protected final void addArgument(Object argument) Overrides com. Adds the argument to the list of arguments that is used to calculate the value of this element. | |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(String name, String value) Overrides com. Parses attributes of the element. The following attributes are supported:
| |
| getArguments | back to summary |
|---|---|
| pack-priv static Object[] getArguments(Object[] arguments, Class<?>[] types) Resolves variable arguments. | |
| getArgumentTypes | back to summary |
|---|---|
| pack-priv static Class Converts the array of arguments to the array of corresponding classes.
If argument is | |
| getContextBean | back to summary |
|---|---|
| protected final Object getContextBean() Overrides com. Returns the context of the method. The context of the static method is the class object. The context of the non-static method is the value of the parent element. | |
| getValueObject | back to summary |
|---|---|
| protected final ValueObject getValueObject() Implements abstract com. Returns the value of this element.
| |
| getValueObject | back to summary |
|---|---|
| pack-priv ValueObject getValueObject(Class<?> type, Object[] args) throws Exception Calculates the value of this element using the base class and the array of arguments. By default, it creates an instance of the base class. This method should be overridden in those handlers that extend behavior of this element.
| |