public class GetInstanceCreator extends java.lang.Object implements Creator, DocletActionReporter
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,
java.lang.String funcName)
This function used to generate a creator that creates a new object
using the public static function specified.
|
static Creator |
getCreator(java.lang.Class targetClass,
java.lang.String funcName,
boolean addAfterFinish)
This function used to generate a creator that creates a new object
using the public static function specified.
|
public static Creator getCreator(java.lang.Class targetClass, java.lang.String funcName) throws CookXmlException
targetClass
- the class objectfuncName
- the name of the static function to be called.CookXmlException
- in case the function could not be found.public static Creator getCreator(java.lang.Class targetClass, java.lang.String funcName, boolean addAfterFinish) throws CookXmlException
targetClass
- the class objectfuncName
- the name of the static function to be called.addAfterFinish
- a flag that indicates not to add the object after
its creation, but rather wait until all the setup
has been done.CookXmlException
- in case the function could not be found.public 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)
Creator
There 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 Creator
parentNS
- 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 CreatorExceptionpublic 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
Creator
editFinished
in interface Creator
parentNS
- 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.CookXmlException
public 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)
DocletActionReporter
getActions
in interface DocletActionReporter
tagLibrary
- the tag library being used.tagNS
- the namespace of the tagtag
- possible tagattrNS
- the namespace of the attributeattr
- the attributecl
- the possible class