org.apache.commons.jxpath
Class JXPathContextFactory

java.lang.Object
  extended byorg.apache.commons.jxpath.JXPathContextFactory
Direct Known Subclasses:
JXPathContextFactoryReferenceImpl

public abstract class JXPathContextFactory
extends java.lang.Object

Defines a factory API that enables applications to obtain a JXPathContext instance. To acquire a JXPathContext, first call the static newInstance() method of JXPathContextFactory. This method returns a concrete JXPathContextFactory. Then call newContext() on that instance. You will rarely need to perform these steps explicitly: usually you can call one of the JXPathContex.newContext methods, which will perform these steps for you.

Version:
$Revision: 1.8 $ $Date: 2004/02/29 14:17:42 $
Author:
Dmitri Plotnikov
See Also:
JXPathContext.newContext(Object), JXPathContext.newContext(JXPathContext,Object)

Field Summary
private static boolean debug
          Temp debug code - this will be removed after we test everything
private static java.lang.String DEFAULT_FACTORY_CLASS
          The default factory class
static java.lang.String FACTORY_NAME_PROPERTY
          The default property
private static java.lang.String factoryImplName
          Avoid reading all the files when the findFactory method is called the second time ( cache the result of finding the default impl )
 
Constructor Summary
protected JXPathContextFactory()
           
 
Method Summary
private static java.lang.String findFactory(java.lang.String property, java.lang.String defaultFactory)
          Private implementation method - will find the implementation class in the specified order.
abstract  JXPathContext newContext(JXPathContext parentContext, java.lang.Object contextBean)
          Creates a new instance of a JXPathContext using the currently configured parameters.
static JXPathContextFactory newInstance()
          Obtain a new instance of a JXPathContextFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY_NAME_PROPERTY

public static final java.lang.String FACTORY_NAME_PROPERTY
The default property

See Also:
Constant Field Values

DEFAULT_FACTORY_CLASS

private static final java.lang.String DEFAULT_FACTORY_CLASS
The default factory class

See Also:
Constant Field Values

factoryImplName

private static java.lang.String factoryImplName
Avoid reading all the files when the findFactory method is called the second time ( cache the result of finding the default impl )


debug

private static boolean debug
Temp debug code - this will be removed after we test everything

Constructor Detail

JXPathContextFactory

protected JXPathContextFactory()
Method Detail

newInstance

public static JXPathContextFactory newInstance()
Obtain a new instance of a JXPathContextFactory. This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the JXPathContextFactory implementation class to load: Once an application has obtained a reference to a JXPathContextFactory it can use the factory to obtain JXPathContext instances.

Throws:
JXPathFactoryConfigurationError - if the implementation is not available or cannot be instantiated.

newContext

public abstract JXPathContext newContext(JXPathContext parentContext,
                                         java.lang.Object contextBean)
                                  throws JXPathContextFactoryConfigurationError
Creates a new instance of a JXPathContext using the currently configured parameters.

Throws:
JXPathContextFactoryConfigurationError - if a JXPathContext cannot be created which satisfies the configuration requested

findFactory

private static java.lang.String findFactory(java.lang.String property,
                                            java.lang.String defaultFactory)
Private implementation method - will find the implementation class in the specified order.

Parameters:
property - Property name
defaultFactory - Default implementation, if nothing else is found
Returns:
class name of the JXPathContextFactory