cookxml.core.setter
Class ConstantSetter

java.lang.Object
  extended by cookxml.core.setter.ConstantSetter
All Implemented Interfaces:
DocletActionReporter, Setter

public class ConstantSetter
extends Object
implements Setter, DocletActionReporter

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
Version:
$Id: ConstantSetter.java 224 2007-06-06 06:57:33Z coconut $

Constructor Summary
ConstantSetter(Class constantClass)
           
ConstantSetter(Class constantClass, Setter setter)
           
 
Method Summary
 Object[] getActions(TagLibrary tagLibrary, String tagNS, String tag, String attrNS, String attr, Class cl)
          This function returns the related function/constructor/field/methods that is called by creator/setter etc.
 void setAttribute(String ns, String tag, String attrNS, String attr, Object obj, Object value, cookxml.core.DecodeEngine decodeEngine)
          Set an attribute of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantSetter

public ConstantSetter(Class constantClass)

ConstantSetter

public ConstantSetter(Class constantClass,
                      Setter setter)
Method Detail

setAttribute

public void setAttribute(String ns,
                         String tag,
                         String attrNS,
                         String attr,
                         Object obj,
                         Object value,
                         cookxml.core.DecodeEngine decodeEngine)
                  throws Exception
Description copied from interface: Setter
Set an attribute of the object.

Specified by:
setAttribute in interface Setter
Parameters:
ns - the namespace of the element.
tag - the tag of the element
attrNS - the namespace of the attribute
attr - the name of the attribute
obj - the object associated with the element
value - 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:
Exception - If the exception is not a SetterException, then it is wrapped inside one by the DecodeEngine and handled by the ExceptionHandler.

getActions

public Object[] getActions(TagLibrary tagLibrary,
                           String tagNS,
                           String tag,
                           String attrNS,
                           String attr,
                           Class cl)
Description copied from interface: DocletActionReporter
This function returns the related function/constructor/field/methods that is called by creator/setter etc. CookXmlDoc would then retrieve the JavaDoc associated with Member object and use it in the documentation.

Specified by:
getActions in interface DocletActionReporter
Parameters:
tagLibrary - the tag library being used.
tagNS - the namespace of the tag
tag - possible tag
attrNS - the namespace of the attribute
attr - the attribute
cl - the possible class
Returns:
A non-empty array of actions performed by this object.