org.sourceprojects.xmlparser
Class XmlParserFactory

java.lang.Object
  extended by org.sourceprojects.xmlparser.XmlParserFactory

public final class XmlParserFactory
extends java.lang.Object

Defines a factory API that enables applications to obtain instances of the XmlParser either by given standard implementations or by configuring own implementations.

Since:
0.0.1
Author:
noctarius

Field Summary
static java.lang.String STANDARD_XMLPARSER_CLASS
          Classname for the standard XmlParser class to be created if no special implementation is given
 
Constructor Summary
XmlParserFactory()
           
 
Method Summary
static
<B> XmlParser<B>
newInstance()
          Obtain a new instance of a XmlParser .
static
<B> XmlParser<B>
newInstance(java.lang.ClassLoader classLoader)
          Obtain a new instance of a XmlParser .
static
<B> XmlParser<B>
newInstance(java.lang.String parserImplementationClassname, java.lang.String contextImplementationClassname, java.lang.ClassLoader classLoader)
          Obtain a new instance of a XmlParser .
static
<B> XmlParser<B>
newInstance(java.lang.String parserImplementationClassname, java.lang.String contextImplementationClassname, java.lang.ClassLoader classLoader, boolean createResourceResolver)
          Obtain a new instance of a XmlParser .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_XMLPARSER_CLASS

public static final java.lang.String STANDARD_XMLPARSER_CLASS
Classname for the standard XmlParser class to be created if no special implementation is given

See Also:
Constant Field Values
Constructor Detail

XmlParserFactory

public XmlParserFactory()
Method Detail

newInstance

public static final <B> XmlParser<B> newInstance()
                                      throws XmlParserInitializationException
Obtain a new instance of a XmlParser .
Implementations that used for XmlParser and ParserContext are the standard internal ones. The classloader to load up those implementations is the actual ContextClassLoader of the actual thread.

Type Parameters:
B - Type of output class to use in parsing and transforming
Returns:
New instance of standard XmlParser implementation
Throws:
XmlParserInitializationException - If some exception occurs on initialization of the new instance the exception is wrapped into a XmlParserInitializationException

newInstance

public static final <B> XmlParser<B> newInstance(java.lang.ClassLoader classLoader)
                                      throws XmlParserInitializationException
Obtain a new instance of a XmlParser .
Implementations that used for XmlParser and ParserContext are the standard internal ones. The classloader to load up those implementations is the given classloader.

Type Parameters:
B - Type of output class to use in parsing and transforming
Parameters:
classLoader - The classloader to load classes
Returns:
New instance of standard XmlParser implementation
Throws:
XmlParserInitializationException - If some exception occurs on initialization of the new instance the exception is wrapped into a XmlParserInitializationException

newInstance

public static final <B> XmlParser<B> newInstance(java.lang.String parserImplementationClassname,
                                                 java.lang.String contextImplementationClassname,
                                                 java.lang.ClassLoader classLoader)
                                      throws XmlParserInitializationException
Obtain a new instance of a XmlParser .
Implementations that used for XmlParser and ParserContext must be given as parameters to the method. The classloader to load up those implementations is the given classloader.
XmlParserInitializationException will be thrown if one of both implementations is null or not found.

Type Parameters:
B - Type of output class to use in parsing and transforming
Parameters:
parserImplementationClassname - Classname of the implementation used for XmlParser
contextImplementationClassname - Classname of the implementation used for ParserContext
classLoader - The classloader to load classes
Returns:
New instance of standard XmlParser implementation
Throws:
XmlParserInitializationException - If some exception occurs on initialization of the new instance the exception is wrapped into a XmlParserInitializationException

newInstance

public static final <B> XmlParser<B> newInstance(java.lang.String parserImplementationClassname,
                                                 java.lang.String contextImplementationClassname,
                                                 java.lang.ClassLoader classLoader,
                                                 boolean createResourceResolver)
                                      throws XmlParserInitializationException
Obtain a new instance of a XmlParser .
Implementations that used for XmlParser and ParserContext must be given as parameters to the method. The classloader to load up those implementations is the given classloader.
XmlParserInitializationException will be thrown if one of both implementations is null or not found.

Type Parameters:
B - Type of output class to use in parsing and transforming
Parameters:
parserImplementationClassname - Classname of the implementation used for XmlParser
contextImplementationClassname - Classname of the implementation used for ParserContext
classLoader - The classloader to load classes
createResourceResolver - Automatically create a basic ResourceResolver for the
Returns:
New instance of standard XmlParser implementation XmlParser instance
Throws:
XmlParserInitializationException - If some exception occurs on initialization of the new instance the exception is wrapped into a XmlParserInitializationException
Since:
0.0.6


Copyright © 2010. All Rights Reserved.