public class DefaultTagProcessorFactory extends Object implements TagProcessorFactory
ClassLoader
s 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 className
NoTagProcessorException
- if TagProcessor could not be loaded.
protected TagProcessor load(String className, ClassLoader loader) throws NoTagProcessorException
className
- fully qualified className
loader
- the classloader to use
NoTagProcessorException
- if TagProcessor could not be loaded.
public TagProcessor getProcessor(String tag, String nameSpace)
TagProcessorFactory
getProcessor
in interface TagProcessorFactory
tag
- the tag to find a processor for.
nameSpace
- the namespace
TagProcessor
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 to
className
- 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 to
processor
- the TagProcessor
public void addProcessor(TagProcessor processor, String... tags)
TagProcessorFactory
addProcessor
in interface TagProcessorFactory
processor
- 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)
TagProcessorFactory
removeProcessor
in interface TagProcessorFactory
tag
- the tag to remove the processor for.
Copyright © 1998–2017. All rights reserved.