|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cookxml.core.taglibrary.SingleNSTagLibrary
This class by itself can only add creators, adders, setters, and converters for a single namespace. Hence the name SingleNSTagLibrary.
However, this library can inherit tag libraries of different namespace. If the namespace of the element is null or the same as the this tag library's namespace, then this tag library is used. Otherwise, the parent tag library, if exists, is used for the lookup. Using parent-hiearchy is one way to create a tag library that can handle multiple namespaces.
This class was the TagLibrary class in CookXml 2.0.
Constructor Summary | |
SingleNSTagLibrary()
The default constructor that creates an instance of SingleNSTagLibrary without a parent. |
|
SingleNSTagLibrary(TagLibrary parentTagLibrary)
The constructor that creates an instance of SingleNSTagLibrary with a parent tag library. |
Method Summary | |
Adder |
getAdder(String ns,
String tag)
Get the Adder delegate associated with the namespace and tag. |
Converter |
getConverter(String ns,
Class targetClass)
Get the Converter that converts a string attribute value into the target class. |
Creator |
getCreator(String ns,
String tag)
Get the Creator object factory associated with the namespace and tag. |
String |
getNameSpace()
Get the namespace of the tag library. |
Setter |
getSetter(String ns,
String tag,
String attrNS,
String attr)
Get the Setter delegate associated with the namespace and tag. |
SpecialCreator |
getSpecialCreator()
Get the SpecialCreator for the TagLibrary. |
void |
setAdder(String tag,
Adder adder)
Insert the adder for a tag into the tag library. |
void |
setConverter(Class targetClass,
Converter converter)
Insert a class converter into the tag library. |
void |
setCreator(String tag,
Creator creator)
Insert an object factory (Creator) for a tag into the tag library. |
void |
setNameSpace(String ns)
Set the namespace of the tag library. |
void |
setSetter(String tag,
String attr,
Setter setter)
Insert a setter delegate for a tag and the attribute into the tag library. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SingleNSTagLibrary()
public SingleNSTagLibrary(TagLibrary parentTagLibrary)
Note that the namespace for the parent and child tag library can be different.
parentTagLibrary
- the parent tag library.Method Detail |
public void setNameSpace(String ns)
ns
- the namespace of the tag library.public String getNameSpace()
public SpecialCreator getSpecialCreator()
TagLibrary
Most TagLibrary implementations should simply return the parent tag library implementation if it does not handle it for sure. TagLibrary implementations that pool several TagLibraries should pool multiple SpecialCreator instances into one.
getSpecialCreator
in interface TagLibrary
public Creator getCreator(String ns, String tag)
TagLibrary
getCreator
in interface TagLibrary
ns
- the namespace.tag
- the tag name.
public Setter getSetter(String ns, String tag, String attrNS, String attr)
TagLibrary
getSetter
in interface TagLibrary
ns
- the namespace.tag
- the tag name.attrNS
- the attribute namespace.attr
- the attribute name @return the Setter delegate.public Adder getAdder(String ns, String tag)
TagLibrary
getAdder
in interface TagLibrary
ns
- the tag namespace.tag
- the tag name.
public Converter getConverter(String ns, Class targetClass)
TagLibrary
getConverter
in interface TagLibrary
ns
- the attribute namespace.targetClass
- the target class type.
public void setCreator(String tag, Creator creator)
tag
- the tag name.creator
- the Creator object.public void setSetter(String tag, String attr, Setter setter)
tag
- the tag name.attr
- the tag attribute.setter
- the Setter object.public void setAdder(String tag, Adder adder)
tag
- the tag name.adder
- the Adder object.public void setConverter(Class targetClass, Converter converter)
targetClass
- the tag name.converter
- the Converter object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |