cookxml.core.interfaces
Interface Creator

All Known Implementing Classes:
AppletCreator, ApplicationWindowCreator, ArrayCellModifierCreator, ArrayCreator, BaseCreator, BoxLayoutCreator, BSFCreator, BSHCreator, CheckboxTableViewerCreator, ChoiceFormatCreator, ColumnPixelDataCreator, ColumnWeightDataCreator, ComboBoxCellEditorCreator, CoolBarCreator, CoolBarManagerCreator, DateFormatCreator, DefaultCreator, DialogCreator, DisplayCreator, FormattedTextFieldCreator, FormBuilderCreator, FormBuilderHelperCreator, FormBuilderPropertyCreator, FrameCreator, GLCanvasCreator, GridDataCreator, HelperCreator, HtmlCreator, IdReferenceCreator, IncludeCreator, InsetsCreator, InternalFrameCreator, JSCreator, JythonCreator, MenuBarCreator, MenuCreator, MenuManagerCreator, MenuSplitCreator, MenuSplitCreator, MessageFormatCreator, NullCreator, ObjectCreator, OverlayLayoutCreator, PointCreator, RectangleCreator, SeparatorCreator, SeparatorHelperCreator, ShellCreator, SpinnerEditorCreator, SpringCreator, SpringGridCreator, SystemTrayCreator, TableHeaderCreator, TextCellEditorCreator, TextCreator, ToolBarCreator, ToolBarManagerCreator, TrackerCreator, TreeItemCreator, UIManagerCreator, VarReferenceCreator, ViewControlCreator, WidgetCreator, WindowCreator, XmlContentProviderCreator

public interface Creator

Since:
CookXml 1.0
See Also:
CreatorException

Method Summary
 Object create(String parentNS, String parentTag, Element elm, Object parentObj, DecodeEngine decodeEngine)
          This function is called whenever decodeEngine starts processing an element.
 Object editFinished(String parentNS, String parentTag, Element elm, Object parentObj, Object obj, DecodeEngine decodeEngine)
          This function is called when the element and its subnodes have all been processed. and about to be returned.
 

Method Detail

create

public Object create(String parentNS,
                     String parentTag,
                     Element elm,
                     Object parentObj,
                     DecodeEngine decodeEngine)
              throws CreatorException
This function is called whenever decodeEngine starts processing an element. It should return an object that corresponds to the tag, or null to indicate no object could be created. If the object returned is of NoAdd type, then the object is not added to the parent object by decodeEngine.

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.

Parameters:
parentNS - the parent tag namespace.
parentTag - the parent tag that contains this element
elm - the DOM element that contains all the information regarding this node.
parentObj - the parent object in the node
decodeEngine - the decode engine that is being used @throws CreatorException
Returns:
the object created, or null to tell decodeEngine to stop processing this node
Throws:
CreatorException

editFinished

public Object editFinished(String parentNS,
                           String parentTag,
                           Element elm,
                           Object parentObj,
                           Object obj,
                           DecodeEngine decodeEngine)
                    throws CookXmlException
This function is called when the element and its subnodes have all been processed. and about to be returned. For many helper objects that implement NoAdd, this is a great time to generate the real object and call the decodeEngine.addChild to add the real object to the parent.

Parameters:
parentNS - the parent tag namespace.
parentTag - the parent element tag
elm - the DOM element that contains all the information regarding this node.
parentObj - the parent object of the parent element
obj - the object that was created by this create function
decodeEngine - the decode engine that is being used.
Returns:
the object. The purpose is to allow a helper object to return the real object.
Throws:
CookXmlException