public class TagHandlerRegistry extends Object implements com.tridion.configuration.Configurable
TagHandler classes for tags.
Each tag consists of a namespace and a name. Each tag may be handled by a chain of TagHandlers.
This registry provides access to the configuration of these tags and produces a list (chain) of TagHandlers
for a given tag.| Constructor and Description |
|---|
TagHandlerRegistry()
Constructs an empty TagHandlerRegistry.
|
TagHandlerRegistry(boolean registerInternal)
Constructs the TagHandlerRegistry, when [registerInternal] is true it will register all tcdl internal tag
handlers for Tridion.
|
TagHandlerRegistry(boolean registerInternal,
TCDLMode mode)
Constructs the TagHandlerRegistry, when [registerInternal] is true it will register all tcdl internal tag
handlers for Tridion.
|
TagHandlerRegistry(TCDLMode mode,
DefaultTagSet tagSet)
Constructs the TagHandlerRegistry, when [registerInternal] is true it will register all tcdl internal tag
handlers using [tagSet] for specific service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(com.tridion.configuration.Configuration configuration)
Allows for the registration of tags and their handlers using a Tridion configuration file
Note that calling this method will cause registration entries to be added to any existing
entries.
|
Collection<String> |
getNamespaceList()
Returns the unique set of namespace identifiers currently present in the registry.
|
Collection<TagMetaEventListener> |
getTagMetaEventListeners() |
boolean |
hasHandlerForTag(Tag tag)
Returns true if the registry has at least one TagHandler for the tag.
|
boolean |
hasIterationSupportForTag(Tag tag)
Returns true if the registry has at least one TagHandler for the tag
that provides IterationTag support.
|
Collection<TagHandlerBase> |
newHandlerChain(Tag tag)
Returns a Collection of TagHandlers (e.g.
|
void |
registerHandler(String tagNamespace,
String tagName,
String className,
boolean mayGenerateCodeBlock)
Same as
registerHandler(String, String, String, String, boolean), but without explicit content
namespace. |
void |
registerHandler(String tagNamespace,
String tagName,
String className,
String namespace,
boolean mayGenerateCodeBlock)
Registers a TagHandler by its class name for the given namespace and tag name.
|
Object |
unwrap(Object container)
Unwraps an object if the registry knows the wrapper type.
|
public TagHandlerRegistry()
public TagHandlerRegistry(boolean registerInternal)
throws TCDLTransformerException
registerInternal - when true all internal tag handlers are setup correctlyTCDLTransformerException - if any trouble during registering occursTCDLTransformerExceptionpublic TagHandlerRegistry(boolean registerInternal,
TCDLMode mode)
throws TCDLTransformerException
registerInternal - when true all internal tag handlers are setup correctly.mode - The mode for the internal TCDL handlers to register (i.e. TRANSFORMATION or RENDER).TCDLTransformerException - if any trouble during registering occurs.TCDLTransformerExceptionpublic TagHandlerRegistry(TCDLMode mode, DefaultTagSet tagSet) throws TCDLTransformerException
mode - The mode for the internal TCDL handlers to register (i.e. TRANSFORMATION or RENDER).tagSet - The default tags handlers to register (i.e. TCM or ISH).TCDLTransformerException - if any trouble during registering occurs.TCDLTransformerExceptionpublic Collection<TagHandlerBase> newHandlerChain(Tag tag) throws TCDLTransformerException
tag - Tag for which the TagHandlers must.TCDLTransformerException - If a TagHandler class could not be created.TCDLTransformerExceptionpublic boolean hasIterationSupportForTag(Tag tag) throws TCDLTransformerException
tag - the tag to check for a TagHandler.TCDLTransformerExceptionpublic boolean hasHandlerForTag(Tag tag)
tag - the tag to check for a TagHandler.public Object unwrap(Object container)
container - object to unwrappublic void registerHandler(String tagNamespace, String tagName, String className, String namespace, boolean mayGenerateCodeBlock) throws TCDLTransformerException
tagNamespace - Namespace in which the Tag livestagName - name of the Tag the TagHandler should be associated withclassName - Name of the TagHandler classnamespace - Content namespace (e.g., "ish" or "tcm")mayGenerateCodeBlock - if the body result of this TagHandler may be wrapped in a code block
(although the handler has the final say in this)TCDLTransformerException - If the registration could not be completed.
Most likely due to duplicate registration of a TagHandler for the same Tag.TCDLTransformerExceptionpublic void registerHandler(String tagNamespace, String tagName, String className, boolean mayGenerateCodeBlock) throws TCDLTransformerException
registerHandler(String, String, String, String, boolean), but without explicit content
namespace.TCDLTransformerExceptionpublic Collection<TagMetaEventListener> getTagMetaEventListeners()
public Collection<String> getNamespaceList()
public void configure(com.tridion.configuration.Configuration configuration)
throws com.tridion.configuration.ConfigurationException
configure in interface com.tridion.configuration.Configurableconfiguration - containing the tag configuration to add to this registrycom.tridion.configuration.ConfigurationExceptionCopyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries