public class DefaultTagProcessorFactory extends Object implements TagProcessorFactory
ClassLoaders this Processor can
also load the processors when they are only stored with there fully qualified
class names.| Modifier and Type | Class and Description |
|---|---|
protected class |
DefaultTagProcessorFactory.FactoryObject
Internal Object to keep TagProcessors.
|
| Constructor and Description |
|---|
DefaultTagProcessorFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessor(String className,
String... tags)
Add one tag processor that handles multiple tags.
|
void |
addProcessor(String tag,
String className)
Add an unloaded TagProcessor.
|
void |
addProcessor(String tag,
TagProcessor processor)
Add a loaded TagProcessor.
|
void |
addProcessor(TagProcessor processor,
String... tags)
Add a tag processor and the tags it maps to.
|
TagProcessor |
getProcessor(String tag,
String nameSpace)
Looks up a TagProcessor for the given tag.
|
protected TagProcessor |
load(String className)
Tries to load given processor with Class.forName
|
protected TagProcessor |
load(String className,
ClassLoader loader)
Tries to load given processor with Class.forName
|
void |
removeProcessor(String tag)
Removes a TagProcessor for a specific tag.
|
protected TagProcessor load(String className) throws NoTagProcessorException
className - fully qualified classNameNoTagProcessorException - if TagProcessor could not be loaded.protected TagProcessor load(String className, ClassLoader loader) throws NoTagProcessorException
className - fully qualified classNameloader - the classloader to useNoTagProcessorException - if TagProcessor could not be loaded.public TagProcessor getProcessor(String tag, String nameSpace)
TagProcessorFactorygetProcessor in interface TagProcessorFactorytag - the tag to find a processor for.nameSpace - the namespaceTagProcessor mapped to this tag.NoTagProcessorException - when the processor was not found for the given tag.public void addProcessor(String tag, String className)
tag - the tag the processor with the given className maps toclassName - the fully qualified class name (class has to be found on classpath, will be loaded with Class.forName()public void addProcessor(String tag, TagProcessor processor)
tag - the tag the processor with the given className maps toprocessor - the TagProcessorpublic void addProcessor(TagProcessor processor, String... tags)
TagProcessorFactoryaddProcessor in interface TagProcessorFactoryprocessor - the TagProcessor.tags - tags this processor maps to.public void addProcessor(String className, String... tags)
className - the fully qualified class name (class has to be found on classpath)tags - list of tags this processor maps to.public void removeProcessor(String tag)
TagProcessorFactoryremoveProcessor in interface TagProcessorFactorytag - the tag to remove the processor for.Copyright © 2020. All rights reserved.