|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.digester3.binder.DigesterLoader
public final class DigesterLoader
This class manages the creation of Digester instances from digester rules modules.
Method Summary | |
---|---|
void |
addRules(Digester digester)
Add rules to an already created Digester instance, analyzing the digester annotations in the target class. |
RuleSet |
createRuleSet()
Creates a new RuleSet instance based on the current configuration. |
Locator |
getDocumentLocator()
Gets the document locator associated with our parser. |
ErrorHandler |
getErrorHandler()
Return the error handler for this Digester. |
ExecutorService |
getExecutorService()
Returns the executor service used to run asynchronous parse method. |
Map<String,URL> |
getRegistrations()
Return the set of DTD URL registrations, keyed by public identifier. |
boolean |
isNamespaceAware()
Return the "namespace aware" flag for parsers we create. |
boolean |
isValidating()
Return the validating parser flag. |
boolean |
isXIncludeAware()
Return the XInclude-aware flag for parsers we create; |
Digester |
newDigester()
Creates a new Digester instance that relies on the default Rules implementation. |
Digester |
newDigester(Rules rules)
Creates a new Digester instance that relies on the custom user define Rules implementation |
Digester |
newDigester(SAXParser parser)
Creates a new Digester instance that relies on the given SAXParser
and the default Rules implementation. |
Digester |
newDigester(SAXParser parser,
Rules rules)
Creates a new Digester instance that relies on the given SAXParser
and custom user define Rules implementation. |
Digester |
newDigester(XMLReader reader)
Creates a new XMLReader instance that relies on the given XMLReader
and the default Rules implementation. |
Digester |
newDigester(XMLReader reader,
Rules rules)
Creates a new XMLReader instance that relies on the given XMLReader
and custom user define Rules implementation. |
static DigesterLoader |
newLoader(Iterable<RulesModule> rulesModules)
Creates a new DigesterLoader instance given a collection of RulesModule instance. |
static DigesterLoader |
newLoader(RulesModule... rulesModules)
Creates a new DigesterLoader instance given one or more RulesModule instance. |
DigesterLoader |
register(String publicId,
String entityURL)
Convenience method that registers the string version of an entity URL instead of a URL version. |
DigesterLoader |
register(String publicId,
URL entityURL)
Register the specified DTD URL for the specified public identifier. |
DigesterLoader |
setClassLoader(ClassLoader classLoader)
Set the class loader to be used for instantiating application objects when required. |
DigesterLoader |
setDocumentLocator(Locator locator)
Sets the document locator associated with our parser. |
DigesterLoader |
setEntityResolver(EntityResolver entityResolver)
Set the EntityResolver used by SAX when resolving public id and system id. |
DigesterLoader |
setErrorHandler(ErrorHandler errorHandler)
Set the error handler for this Digester. |
DigesterLoader |
setExecutorService(ExecutorService executorService)
Sets the executor service to run asynchronous parse method. |
DigesterLoader |
setNamespaceAware(boolean namespaceAware)
Set the "namespace aware" flag for parsers we create. |
DigesterLoader |
setSchema(Schema schema)
Set the XML Schema to be used when parsing. |
DigesterLoader |
setStackAction(StackAction stackAction)
Sets the Object which will receive callbacks for every pop/push action on the default stack or named stacks. |
DigesterLoader |
setSubstitutor(Substitutor substitutor)
Sets the Substitutor to be used to convert attributes and body text. |
DigesterLoader |
setUseContextClassLoader(boolean useContextClassLoader)
Determine whether to use the Context ClassLoader (the one found by calling Thread.currentThread().getContextClassLoader() )
to resolve/load classes that are defined in various rules. |
DigesterLoader |
setValidating(boolean validating)
Set the validating parser flag. |
DigesterLoader |
setXIncludeAware(boolean xIncludeAware)
Set the XInclude-aware flag for parsers we create. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DigesterLoader newLoader(RulesModule... rulesModules)
DigesterLoader
instance given one or more RulesModule
instance.
rulesModules
- The modules containing the Rule
binding
DigesterLoader
instancepublic static DigesterLoader newLoader(Iterable<RulesModule> rulesModules)
DigesterLoader
instance given a collection of RulesModule
instance.
rulesModules
- The modules containing the Rule
binding
DigesterLoader
instancepublic DigesterLoader setUseContextClassLoader(boolean useContextClassLoader)
Thread.currentThread().getContextClassLoader()
)
to resolve/load classes that are defined in various rules. If not
using Context ClassLoader, then the class-loading defaults to
using the calling-class' ClassLoader.
useContextClassLoader
- determines whether to use Context ClassLoader.
public DigesterLoader setClassLoader(ClassLoader classLoader)
classLoader
- the class loader to be used for instantiating application objects when required.
public DigesterLoader setSubstitutor(Substitutor substitutor)
Substitutor
to be used to convert attributes and body text.
substitutor
- the Substitutor to be used to convert attributes and body text
or null if not substitution of these values is to be performed.
public DigesterLoader setNamespaceAware(boolean namespaceAware)
namespaceAware
- The new "namespace aware" flag
public boolean isNamespaceAware()
public DigesterLoader setXIncludeAware(boolean xIncludeAware)
xIncludeAware
- The new XInclude-aware flag
setNamespaceAware(boolean)
public boolean isXIncludeAware()
public DigesterLoader setValidating(boolean validating)
validating
- The new validating parser flag.
public boolean isValidating()
public DigesterLoader setSchema(Schema schema)
schema
- The Schema
instance to use.
public DigesterLoader register(String publicId, URL entityURL)
Register the specified DTD URL for the specified public identifier.
This must be called before the first call to parse()
.
Digester
contains an internal EntityResolver
implementation. This maps PUBLICID
's to URLs
(from which the resource will be loaded). A common use case for this
method is to register local URLs (possibly computed at runtime by a
classloader) for DTDs. This allows the performance advantage of using
a local version without having to ensure every SYSTEM
URI on every processed xml document is local. This implementation provides
only basic functionality. If more sophisticated features are required,
using setEntityResolver(EntityResolver)
to set a custom resolver is recommended.
Note: This method will have no effect when a custom
EntityResolver
has been set. (Setting a custom
EntityResolver
overrides the internal implementation.)
publicId
- Public identifier of the DTD to be resolvedentityURL
- The URL to use for reading this DTD
public DigesterLoader register(String publicId, String entityURL)
Convenience method that registers the string version of an entity URL instead of a URL version.
publicId
- Public identifier of the entity to be resolvedentityURL
- The URL to use for reading this entity
public Map<String,URL> getRegistrations()
public DigesterLoader setEntityResolver(EntityResolver entityResolver)
EntityResolver
used by SAX when resolving public id and system id. This must be called
before the first call to parse()
.
entityResolver
- a class that implement the EntityResolver
interface.
public DigesterLoader setStackAction(StackAction stackAction)
stackAction
- the Object which will receive callbacks for every pop/push action on the default stack
or named stacks.
public ExecutorService getExecutorService()
public DigesterLoader setExecutorService(ExecutorService executorService)
executorService
- the executor service to run asynchronous parse method
public ErrorHandler getErrorHandler()
public DigesterLoader setErrorHandler(ErrorHandler errorHandler)
errorHandler
- The new error handler
public Locator getDocumentLocator()
public DigesterLoader setDocumentLocator(Locator locator)
locator
- the document locator associated with our parser.
public Digester newDigester()
Digester
instance that relies on the default Rules
implementation.
Digester
instancepublic Digester newDigester(Rules rules)
Digester
instance that relies on the custom user define Rules
implementation
rules
- The custom user define Rules
implementation
Digester
instancepublic Digester newDigester(SAXParser parser)
Digester
instance that relies on the given SAXParser
and the default Rules
implementation.
parser
- the user defined SAXParser
Digester
instancepublic Digester newDigester(SAXParser parser, Rules rules)
Digester
instance that relies on the given SAXParser
and custom user define Rules
implementation.
parser
- The user defined SAXParser
rules
- The custom user define Rules
implementation
Digester
instancepublic Digester newDigester(XMLReader reader)
XMLReader
instance that relies on the given XMLReader
and the default Rules
implementation.
reader
- The user defined XMLReader
Digester
instancepublic Digester newDigester(XMLReader reader, Rules rules)
XMLReader
instance that relies on the given XMLReader
and custom user define Rules
implementation.
reader
- The user defined XMLReader
rules
- The custom user define Rules
implementation
Digester
instancepublic void addRules(Digester digester)
digester
- the Digester instance reference.public RuleSet createRuleSet()
RuleSet
instance based on the current configuration.
RuleSet
instance based on the current configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |