<test.xml> <import file="abc.xml"/> </test.xml>There is also another constructor for BasicElementFactory: public BasicElementFactory(TagProvider provider). This constructor accepts an argument in type of TagProvider. You can implement your own TagProvider to find your definition in your own way or even define the Tag in your own style (other than XML). Following is the interface definition of TagProvider:
public interface TagProvider { public Tag getTag(String id) throws ConfigException; }
There is a call back interface com.ibm.btt.element.ElementProcessor. If you want to perform some tasks before or after the factory creates or initializes an element, you can implement this interface, and add your implementation to BasicElementFactory.
Following is the sample code, you must define it in your TagProvide and use elementProcessors as the ID.
<list id="elementProcessors"> <yourPackage.YourElementProcessor1 /> <yourPackage.YourElementProcessor2 /> </list>
public interface ElementProcessor { public Tag beforeCreateElement(Tag tag) throws ElementException; public Object beforeInitializeElement(Tag tag, Object element) throws ElementException; public Object afterInitializeElement(Tag tag, Object element) throws ElementException; }
<string id="defaultScope" value="prototype" />
Class name together with package name might be a long string. You can define short cut for a class name.
To define the short cut for a class name, you must define a Map containing the mapping between the short cut and the real class name. The Map must be defined in your TagProvider, together with your element definition. You must use classTable as the ID. See Tag naming rules for more details.