public class SingleNSTagLibrary extends java.lang.Object implements DocletTagLibrary
However, this library can inherit tag libraries of different namespaces. 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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
Adder |
getAdder(java.lang.String ns,
java.lang.String tag)
Get the Adder delegate associated with the namespace and tag.
|
java.util.Map |
getAttributes(java.lang.String ns,
java.lang.String tag)
This function reports the attributes associated with a particular tag.
|
Converter |
getConverter(java.lang.String ns,
java.lang.Class targetClass)
Get the Converter that converts a string attribute value into the target class.
|
java.util.Map |
getConverters(java.lang.String ns)
This function reports the converters associated with a namespace.
|
Creator |
getCreator(java.lang.String ns,
java.lang.String tag)
Get the Creator object factory associated with the namespace and tag.
|
java.lang.String |
getNameSpace()
Get the namespace of the tag library.
|
java.lang.String[] |
getNameSpaces()
This function reports the namespaces this tag library holds.
|
TagLibrary |
getParent()
This function reports the parent tagLibrary.
|
Setter |
getSetter(java.lang.String ns,
java.lang.String tag,
java.lang.String attrNS,
java.lang.String attr)
Get the Setter delegate associated with the namespace and tag.
|
SpecialCreator |
getSpecialCreator()
Get the SpecialCreator for the TagLibrary.
|
java.util.Map |
getTags()
This function reports the tags having the creators and are located
inside this tag library.
|
void |
setAdder(java.lang.String tag,
Adder adder)
Insert the adder for a tag into the tag library.
|
void |
setConverter(java.lang.Class targetClass,
Converter converter)
Insert a class converter into the tag library.
|
void |
setCreator(java.lang.String tag,
Creator creator)
Insert an object factory (Creator) for a tag into the tag library.
|
void |
setNameSpace(java.lang.String ns)
Set the namespace of the tag library.
|
void |
setSetter(java.lang.String tag,
java.lang.String attr,
Setter setter)
Insert a setter delegate for a tag and the attribute into the tag library.
|
public SingleNSTagLibrary()
public SingleNSTagLibrary(TagLibrary parentTagLibrary)
parentTagLibrary - the parent tag library.public void setNameSpace(java.lang.String ns)
ns - the namespace of the tag library.public java.lang.String getNameSpace()
public SpecialCreator getSpecialCreator()
TagLibraryMost 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 TagLibrarypublic Creator getCreator(java.lang.String ns, java.lang.String tag)
TagLibrarygetCreator in interface TagLibraryns - the namespace.tag - the tag name.public Setter getSetter(java.lang.String ns, java.lang.String tag, java.lang.String attrNS, java.lang.String attr)
TagLibrarygetSetter in interface TagLibraryns - the namespace.tag - the tag name.attrNS - the attribute namespace.attr - the attribute name @return the Setter delegate.public Adder getAdder(java.lang.String ns, java.lang.String tag)
TagLibrarygetAdder in interface TagLibraryns - the tag namespace.tag - the tag name.public Converter getConverter(java.lang.String ns, java.lang.Class targetClass)
TagLibrarygetConverter in interface TagLibraryns - the attribute namespace.targetClass - the target class type.public void setCreator(java.lang.String tag,
Creator creator)
tag - the tag name.creator - the Creator object.public void setSetter(java.lang.String tag,
java.lang.String attr,
Setter setter)
tag - the tag name.attr - the tag attribute.setter - the Setter object.public void setAdder(java.lang.String tag,
Adder adder)
tag - the tag name.adder - the Adder object.public void setConverter(java.lang.Class targetClass,
Converter converter)
targetClass - the tag name.converter - the Converter object.public TagLibrary getParent()
DocletTagLibrarygetParent in interface DocletTagLibrarypublic java.lang.String[] getNameSpaces()
DocletTagLibraryNote that a namespace (a value inside the string array) can be null to indicate that the tag library does not handle namespaces.
getNameSpaces in interface DocletTagLibrarypublic java.util.Map getTags()
DocletTagLibraryThe returned map uses XML namespace as the key, and a string array of tag names as the value as its entries.
getTags in interface DocletTagLibrarypublic java.util.Map getAttributes(java.lang.String ns,
java.lang.String tag)
DocletTagLibraryThe returned map uses XML namespace as the key, and a string array of attribute names as the value as its entries.
getAttributes in interface DocletTagLibraryns - the namespace of the tag.tag - the tag name.public java.util.Map getConverters(java.lang.String ns)
DocletTagLibrarygetConverters in interface DocletTagLibraryns - the namespace.