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 Details

    • setContextPath

      ParserConfigurator setContextPath(List<String> contextPath)
      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

      List<String> getContextPath()
      Returns the list of paths to be searched for binding information.
      Returns:
      the list of paths to be searched for binding information.
    • setClassLoader

      ParserConfigurator setClassLoader(ClassLoader loader)
      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

      ParserConfigurator setHandler(javax.xml.bind.ValidationEventHandler handler)
      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

      ParserConfigurator setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
      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

      ParserConfigurator addProperty(String key, Object val)
      Adds a property with the given key and value for the underlying parser to use.
      Parameters:
      key - the unique key for the entry
      val - the value of the property
      Returns:
      a configurator with the specified property set
    • addProperties

      ParserConfigurator addProperties(Map<String,Object> properties)
      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

      Map<String,Object> getProperties()
      Returns the properties associated with the underlying parser.
      Returns:
      the associated properties