Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.jxpath
Class AbstractFactory  view AbstractFactory download AbstractFactory.java

java.lang.Object
  extended byorg.apache.commons.jxpath.AbstractFactory

public abstract class AbstractFactory
extends java.lang.Object

The JXPathContext.createPath() 55 method of JXPathContext can create missing objects as it traverses an XPath; it utilizes an AbstractFactory for that purpose. Install a factory on JXPathContext by calling JXPathContext. setFactory() 55 .

All methods of this class return false. Override any of them to return true to indicate that the factory has successfully created the described object.

Version:
$Revision: 1.8 $ $Date: 2004/02/29 14:17:42 $

Constructor Summary
AbstractFactory()
           
 
Method Summary
 boolean createObject(JXPathContext context, Pointer pointer, java.lang.Object parent, java.lang.String name, int index)
          The parameters may describe a collection element or an individual object.
 boolean declareVariable(JXPathContext context, java.lang.String name)
          Declare the specified variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFactory

public AbstractFactory()
Method Detail

createObject

public boolean createObject(JXPathContext context,
                            Pointer pointer,
                            java.lang.Object parent,
                            java.lang.String name,
                            int index)
The parameters may describe a collection element or an individual object. It is up to the factory to infer which one it is. If it is a collection, the factory should check if the collection exists. If not, it should create the collection. Then it should create the index'th element of the collection and return true.


declareVariable

public boolean declareVariable(JXPathContext context,
                               java.lang.String name)
Declare the specified variable