cookxml.core.setter
Class DefaultSetter

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

public class DefaultSetter
extends Object
implements DocletSetter, DocletActionReporter

This setter attempts to call Java setter functions with the converted attribute values.

Since:
CookXml 1.0
Version:
$Id: DefaultSetter.java 265 2007-06-10 18:47:06Z coconut $

Field Summary
static String PREFIX
           
 
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.
 String[] getAttributes(Class cl)
          This function reports potential attributes that can be handled by this setter for a given class.
static DefaultSetter getInstance()
           
 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
 

Field Detail

PREFIX

public static String PREFIX
Method Detail

getInstance

public static DefaultSetter getInstance()

setAttribute

public void setAttribute(String ns,
                         String tag,
                         String attrNS,
                         String attr,
                         Object obj,
                         Object value,
                         cookxml.core.DecodeEngine decodeEngine)
                  throws SetterException
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:
SetterException

getAttributes

public String[] getAttributes(Class cl)
Description copied from interface: DocletSetter
This function reports potential attributes that can be handled by this setter for a given class. Usually it is done through reflection.

Specified by:
getAttributes in interface DocletSetter
Parameters:
cl - the class interested in.
Returns:
an non-null array of possible attributes.

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.