org.swixml
Class TagLibrary
public abstract class TagLibrary
extends java.lang.Object
A skeletal impementation of a TagLibrary
A TagLibrary has a collection of Factories.
Every Tag is mapped to a Factory which is used to build the java object during document parsing.
Date: Dec 9, 2002
TagLibrary()- Constructs a new TagLibrary and regisiters all factories.
|
Factory | getFactory(Class template)- Returns the Factory that is currently registered for the given Tag name
|
Factory | getFactory(String name)- Returns the Factory that is currently registered for the given Tag name
|
protected Method | getSetter(Class template, String name)- Returns a setter method by name for a specified template class
|
Map | getTagClasses()
|
protected Method | guessSetter(Class template, String name)- Returns a setter method by name for a specified template class
|
void | registerTag(String name, Class template)- Registers a class for the given tag name
|
void | registerTag(String name, Factory factory)- Registers a factory for the given tag name
|
protected abstract void | registerTags()- Registers all factories for the TagLibrary.
|
boolean | unregisterTag(String name)- Un-registers (removes) a registered tag.
|
TagLibrary
public TagLibrary()
Constructs a new TagLibrary and regisiters all factories.
getFactory
public Factory getFactory(Class template)
Returns the Factory that is currently registered for the given Tag name
Factory - regsitered for the given tag name
getFactory
public Factory getFactory(String name)
Returns the Factory that is currently registered for the given Tag name
Factory - regsitered for the given tag name
getSetter
protected Method getSetter(Class template,
String name) Returns a setter method by name for a specified template class
template - Class template classname - Sting method name
Method - a setter method for the given class.
getTagClasses
public Map getTagClasses()
Map - all registered tags.
Use athe tag names to get to the factories
guessSetter
protected Method guessSetter(Class template,
String name) Returns a setter method by name for a specified template class
template - Class template classname - Sting attribute name
Method - a setter method for the given class, able to modify the property.
registerTag
public void registerTag(String name,
Class template) Registers a class for the given tag name
name - String the tag's nametemplate - Class the java class that represents the tag
registerTag
public void registerTag(String name,
Factory factory) Registers a factory for the given tag name
name - String the tag's namefactory - FactoryFactory factory to create an Instance of the tag
registerTags
protected abstract void registerTags()
Registers all factories for the TagLibrary.
unregisterTag
public boolean unregisterTag(String name)
Un-registers (removes) a registered tag.
name - String the tag's name
boolean true if tag was registered befoire and now successfuly removed.
Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.