public abstract class JXPathContextFactory
extends java.lang.Object
JXPathContext
instance. To acquire a JXPathContext, first call the
static newInstance()
method of JXPathContextFactory.
This method returns a concrete JXPathContextFactory.
Then call newContext(org.apache.commons.jxpath.JXPathContext, java.lang.Object)
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.JXPathContext.newContext(Object)
,
JXPathContext.newContext(JXPathContext,Object)
Modifier and Type | Field and Description |
---|---|
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 )
|
Modifier | Constructor and Description |
---|---|
protected |
JXPathContextFactory()
Create a new JXPathContextFactory.
|
Modifier and Type | Method and Description |
---|---|
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 . |
public static final java.lang.String FACTORY_NAME_PROPERTY
private static final java.lang.String DEFAULT_FACTORY_CLASS
private static java.lang.String factoryImplName
private static boolean debug
protected JXPathContextFactory()
public static JXPathContextFactory newInstance()
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:
org.apache.commons.jxpath.JXPathContextFactory
system property.
org.apache.commons.jxpath.JXPathContextFactory
.
META- INF/services/org.apache.commons.jxpath.
JXPathContextFactory
in jars available to the runtime.
JXPathContextFactory
instance.
JXPathContextFactory
it can use the factory to
obtain JXPathContext instances.JXPathContextFactoryConfigurationError
- if the implementation
is not available or cannot be instantiated.public abstract JXPathContext newContext(JXPathContext parentContext, java.lang.Object contextBean)
parentContext
- parent contextcontextBean
- Object beanJXPathContextFactoryConfigurationError
- if a JXPathContext
cannot be created which satisfies the configuration requestedprivate static java.lang.String findFactory(java.lang.String property, java.lang.String defaultFactory)
property
- Property namedefaultFactory
- Default implementation, if nothing else is found