public class DefaultCreator extends java.lang.Object implements Creator, DocletActionReporter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Class[] |
EMPTY_CLASS_PARAM |
static java.lang.Object[] |
EMPTY_OBJECT_PARAM |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
create(java.lang.String parentNS,
java.lang.String parentTag,
org.w3c.dom.Element elm,
java.lang.Object parentObj,
cookxml.core.DecodeEngine decodeEngine)
This function is called whenever decodeEngine starts processing an element.
|
java.lang.Object |
editFinished(java.lang.String parentNS,
java.lang.String parentTag,
org.w3c.dom.Element elm,
java.lang.Object parentObj,
java.lang.Object obj,
cookxml.core.DecodeEngine decodeEngine)
This function is called when the element and its subnodes have all been processed.
|
java.lang.Object[] |
getActions(TagLibrary tagLibrary,
java.lang.String tagNS,
java.lang.String tag,
java.lang.String attrNS,
java.lang.String attr,
java.lang.Class cl)
This function returns the related function/constructor/field/methods that
is called by creator/setter etc.
|
static Creator |
getCreator(java.lang.Class targetClass) |
static Creator |
getCreator(java.lang.Class targetClass,
boolean addAfterFinish)
This function used to generate a creator.
|
public static final java.lang.Class[] EMPTY_CLASS_PARAM
public static final java.lang.Object[] EMPTY_OBJECT_PARAM
public static Creator getCreator(java.lang.Class targetClass) throws CookXmlException
CookXmlExceptionpublic static Creator getCreator(java.lang.Class targetClass, boolean addAfterFinish) throws CookXmlException
targetClass - the class objectaddAfterFinish - a flag that indicates not to add the object after
its creation, but rather wait until all the setup
has been done.CookXmlExceptionpublic java.lang.Object create(java.lang.String parentNS,
java.lang.String parentTag,
org.w3c.dom.Element elm,
java.lang.Object parentObj,
cookxml.core.DecodeEngine decodeEngine)
throws CreatorException
CreatorThere can be creative use of this function. For example, one could create another instance of CookXml that process the element differently, then call this instanceof decodeEngine to add the processed object to the parent, and then return null to tell this instance of decodeEngine/CookXml to stop processing the element.
create in interface CreatorparentNS - the parent tag namespace.parentTag - the parent tag that contains this elementelm - the DOM element that contains all the information regarding this node.parentObj - the parent object in the nodedecodeEngine - the decode engine that is being used @throws CreatorExceptionCreatorExceptionpublic java.lang.Object editFinished(java.lang.String parentNS,
java.lang.String parentTag,
org.w3c.dom.Element elm,
java.lang.Object parentObj,
java.lang.Object obj,
cookxml.core.DecodeEngine decodeEngine)
throws CookXmlException
CreatoreditFinished in interface CreatorparentNS - the parent tag namespace.parentTag - the parent element tagelm - the DOM element that contains all the information regarding this node.parentObj - the parent object of the parent elementobj - the object that was created by this create functiondecodeEngine - the decode engine that is being used.CookXmlExceptionpublic java.lang.Object[] getActions(TagLibrary tagLibrary, java.lang.String tagNS, java.lang.String tag, java.lang.String attrNS, java.lang.String attr, java.lang.Class cl)
DocletActionReportergetActions in interface DocletActionReportertagLibrary - the tag library being used.tagNS - the namespace of the tagtag - possible tagattrNS - the namespace of the attributeattr - the attributecl - the possible class