cookxml.core.setter
Class ConstantSetter
java.lang.Object
cookxml.core.setter.ConstantSetter
- All Implemented Interfaces:
- Setter
- public class ConstantSetter
- extends Object
- implements Setter
This setter is intended to locate a constant inside a class and returns the correct result.
If the constant cannot be located, then the DefaultSetter is called on the original input.
Thus, this setter can handle situtations where both constant values and arbitrary values
can be assigned.
- Since:
- CookXml 1.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstantSetter
public ConstantSetter(Class constantClass)
ConstantSetter
public ConstantSetter(Class constantClass,
Setter setter)
setAttribute
public void setAttribute(String ns,
String tag,
String attrNS,
String attr,
Object obj,
Object value,
DecodeEngine decodeEngine)
throws SetterException
- Description copied from interface:
Setter
- set the attribute of the object.
- Specified by:
setAttribute
in interface Setter
- Parameters:
ns
- the namespace of the element.tag
- the tag of the elementattrNS
- the namespace of the attributeattr
- the name of the attributeobj
- the object associated with the elementvalue
- the value of the object. We didn't use the String type because it is
entirely possible for an object of the child elements to call the setter.decodeEngine
- the DecodeEngine being used. @throws SetterException
- Throws:
SetterException