cookxml.core.interfaces
Interface TagLibrary

All Known Implementing Classes:
MultiNSTagLibrary, SingleNSTagLibrary

public interface TagLibrary

A tag library should contain creators, setters, adders, and converters. Depending on the namespace, the appropriate function objects are lookedup.

Since:
CookXml 3.0

Method Summary
 Adder getAdder(String tagNS, String tag)
          Get the Adder delegate associated with the namespace and tag.
 Converter getConverter(String attrNS, Class targetClass)
          Get the Converter that converts a string attribute value into the target class.
 Creator getCreator(String tagNS, String tag)
          Get the Creator object factory associated with the namespace and tag.
 Setter getSetter(String tagNS, String tag, String attrNS, String attr)
          Get the Setter delegate associated with the namespace and tag.
 SpecialCreator getSpecialCreator()
          Get the SpecialCreator for the TagLibrary.
 

Method Detail

getSpecialCreator

public SpecialCreator getSpecialCreator()
Get the SpecialCreator for the TagLibrary. This function is called only once per DecodeEngine instance.

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.

Returns:
the creator for the object creation.

getCreator

public Creator getCreator(String tagNS,
                          String tag)
Get the Creator object factory associated with the namespace and tag.

Parameters:
tagNS - the namespace.
tag - the tag name.
Returns:
the Creator object.

getSetter

public Setter getSetter(String tagNS,
                        String tag,
                        String attrNS,
                        String attr)
Get the Setter delegate associated with the namespace and tag.

Parameters:
tagNS - the namespace.
tag - the tag name.
attrNS - the attribute namespace.
attr - the attribute name @return the Setter delegate.

getAdder

public Adder getAdder(String tagNS,
                      String tag)
Get the Adder delegate associated with the namespace and tag.

Parameters:
tagNS - the tag namespace.
tag - the tag name.
Returns:
the Adder delegate.

getConverter

public Converter getConverter(String attrNS,
                              Class targetClass)
Get the Converter that converts a string attribute value into the target class.

Parameters:
attrNS - the attribute namespace.
targetClass - the target class type.
Returns:
the Converter delegate.