Package org.htmlcleaner
Class ConfigFileTagProvider
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap
-
- org.htmlcleaner.ConfigFileTagProvider
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map
,ITagInfoProvider
public class ConfigFileTagProvider extends java.util.HashMap implements ITagInfoProvider
Configuration file tag provider - reads XML file in specified format and creates a Tag Provider. Used to create custom tag providers when used on the command line.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ConfigFileTagProvider.ConfigParser
SAX parser for tag configuration files.
-
Field Summary
Fields Modifier and Type Field Description private boolean
generateCode
(package private) static javax.xml.parsers.SAXParserFactory
parserFactory
-
Constructor Summary
Constructors Modifier Constructor Description private
ConfigFileTagProvider()
ConfigFileTagProvider(java.io.File file)
ConfigFileTagProvider(java.net.URL url)
ConfigFileTagProvider(org.xml.sax.InputSource inputSource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TagInfo
getTagInfo(java.lang.String tagName)
static void
main(java.lang.String[] args)
Generates code for tag provider class from specified configuration XML file.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
ConfigFileTagProvider
private ConfigFileTagProvider()
-
ConfigFileTagProvider
public ConfigFileTagProvider(org.xml.sax.InputSource inputSource)
-
ConfigFileTagProvider
public ConfigFileTagProvider(java.io.File file)
-
ConfigFileTagProvider
public ConfigFileTagProvider(java.net.URL url)
-
-
Method Detail
-
getTagInfo
public TagInfo getTagInfo(java.lang.String tagName)
- Specified by:
getTagInfo
in interfaceITagInfoProvider
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
Generates code for tag provider class from specified configuration XML file. In order to create custom tag info provider, make config file and call this main method with the specified file. Output will be generated on the standard output. This way a custom tag provider (class CustomTagProvider) is generated from an XML file. An example XML file, "example.xml", can be found in the source distribution.- Parameters:
args
-- Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
-
-