Class DefaultTagProcessorFactory
java.lang.Object
com.itextpdf.tool.xml.html.DefaultTagProcessorFactory
- All Implemented Interfaces:
TagProcessorFactory
A Default implementation of the TagProcessorFactory that uses a map to store
the TagProcessors. Within the same
Note: this implementation does not use namespaces (yet)!
ClassLoaders this Processor can
also load the processors when they are only stored with there fully qualified
class names.Note: this implementation does not use namespaces (yet)!
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected final classInternal Object to keep TagProcessors. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, DefaultTagProcessorFactory.FactoryObject> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessor(TagProcessor processor, String... tags) Add a tag processor and the tags it maps to.voidaddProcessor(String tag, TagProcessor processor) Add a loaded TagProcessor.voidaddProcessor(String tag, String className) Add an unloaded TagProcessor.voidaddProcessor(String className, String... tags) Add one tag processor that handles multiple tags.getProcessor(String tag, String nameSpace) Looks up a TagProcessor for the given tag.protected TagProcessorTries to load given processor with Class.forNameprotected TagProcessorload(String className, ClassLoader loader) Tries to load given processor with Class.forNamevoidremoveProcessor(String tag) Removes a TagProcessor for a specific tag.
-
Field Details
-
map
-
-
Constructor Details
-
DefaultTagProcessorFactory
public DefaultTagProcessorFactory()
-
-
Method Details
-
load
Tries to load given processor with Class.forName- Parameters:
className- fully qualified className- Returns:
- the loaded tag processor
- Throws:
NoTagProcessorException- if TagProcessor could not be loaded.
-
load
Tries to load given processor with Class.forName- Parameters:
className- fully qualified classNameloader- the classloader to use- Returns:
- the loaded tag processor
- Throws:
NoTagProcessorException- if TagProcessor could not be loaded.
-
getProcessor
Description copied from interface:TagProcessorFactoryLooks up a TagProcessor for the given tag.- Specified by:
getProcessorin interfaceTagProcessorFactory- Parameters:
tag- the tag to find a processor for.nameSpace- the namespace- Returns:
- the
TagProcessormapped to this tag. - Throws:
NoTagProcessorException- when the processor was not found for the given tag.
-
addProcessor
-
addProcessor
Add a loaded TagProcessor.- Parameters:
tag- the tag the processor with the given className maps toprocessor- the TagProcessor
-
addProcessor
Description copied from interface:TagProcessorFactoryAdd a tag processor and the tags it maps to.- Specified by:
addProcessorin interfaceTagProcessorFactory- Parameters:
processor- the TagProcessor.tags- tags this processor maps to.
-
addProcessor
-
removeProcessor
Description copied from interface:TagProcessorFactoryRemoves a TagProcessor for a specific tag.- Specified by:
removeProcessorin interfaceTagProcessorFactory- Parameters:
tag- the tag to remove the processor for.
-