Package org.codice.ddf.parser
Interface ParserConfigurator
public interface ParserConfigurator
Configuration helper for setting up necessary environment for underlying parser implementations.
This is designed as a fluent interface for ease of use, so implementing classes should respect
that and return this and not a new instance of ParserConfigurator on all
setXXX methods.
-
Method Summary
Modifier and TypeMethodDescriptionaddProperties(Map<String, Object> properties) Adds a collection of properties with the given key-value mappings for the underlying parser.addProperty(String key, Object val) Adds a property with the given key and value for the underlying parser to use.javax.xml.bind.annotation.adapters.XmlAdapterGets XML-specific adapter.Returns the classloader to be used by the underlying parser.Returns the list of paths to be searched for binding information.javax.xml.bind.ValidationEventHandlerGets XML-specific validation handler.Returns the properties associated with the underlying parser.setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter) Sets XML-specific adapter.setClassLoader(ClassLoader loader) Sets the classloader to be used by underlying implementations.setContextPath(List<String> contextPath) Sets the list of paths that implementations can search in order to find binding information.setHandler(javax.xml.bind.ValidationEventHandler handler) Sets XML-specific validation handler.
-
Method Details
-
setContextPath
Sets the list of paths that implementations can search in order to find binding information.- Parameters:
contextPath- a list of paths that implementations can search in order to find binding information- Returns:
- a configuration with the specified context path
-
getContextPath
Returns the list of paths to be searched for binding information.- Returns:
- the list of paths to be searched for binding information.
-
setClassLoader
Sets the classloader to be used by underlying implementations.- Parameters:
loader- the classloader for the parser to use- Returns:
- a configuration with the specified classloader
-
getClassLoader
ClassLoader getClassLoader()Returns the classloader to be used by the underlying parser.- Returns:
- the classloader
-
setHandler
Sets XML-specific validation handler.This is one of two XML-specific settings on the configurator. As XML is a ubiquitous externalizable format, these concessions have been made to provide first-class support to its parsers.
- Parameters:
handler- the validation handler to pass to the underlying parser- Returns:
- a configurator with the specified event handler
-
getHandler
javax.xml.bind.ValidationEventHandler getHandler()Gets XML-specific validation handler.- Returns:
- the validation handler associated with the underlying parser
-
setAdapter
Sets XML-specific adapter.This is one of two XML-specific settings on the configurator. As XML is a ubiquitous externalizable format, these concessions have been made to provide first-class support to its parsers.
- Parameters:
adapter- the adapter to pass to the underlying parser- Returns:
- a configurator with the specified adapter
-
getAdapter
javax.xml.bind.annotation.adapters.XmlAdapter getAdapter()Gets XML-specific adapter.- Returns:
- the adapter associated with the underlying parser
-
addProperty
Adds a property with the given key and value for the underlying parser to use.- Parameters:
key- the unique key for the entryval- the value of the property- Returns:
- a configurator with the specified property set
-
addProperties
Adds a collection of properties with the given key-value mappings for the underlying parser.- Parameters:
properties- a collection of key-value objects to set- Returns:
- a configurator with the specified properties set
-
getProperties
Returns the properties associated with the underlying parser.- Returns:
- the associated properties
-