Xalan-Java: Class SimpleNodeLocator

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xalan.xpath
Class SimpleNodeLocator

    java.lang.Object
      |
      +--org.apache.xalan.xpath.SimpleNodeLocator

Direct Known Subclasses:
  DTMNodeLocator, RowSetLocator

public class SimpleNodeLocator
extends java.lang.Object
implements XLocator, java.io.Serializable

**For advanced use only** SimpleNodeLocator implements a search of one or more DOM trees. By using the connect function as an extension, the user may specify a directory and a filter specification for XML files that will be searched. This is a singleton class.

See Also:
  Serialized Form

Constructor Summary
`SimpleNodeLocator()` **For advanced use only** Create a SimpleNodeLocator object.

Method Summary
`static XLocator` | `connect(java.lang.String path, java.lang.String fileSpec)` **For advanced use only** (Same as query for the moment).
`XNodeSet` | `connectToNodes(XPath xpath, XPathSupport execContext, org.w3c.dom.Node context, int opPos, java.util.Vector connectArgs)` **For advanced use only** Execute a connection (if it was not executed by the static connect method) and process the following LocationPath, if it is present.
`double` | `doPredicate(XPath xpath, XPathSupport execContext, org.w3c.dom.Node context, int opPos, int argLen, int startOpPos)` **For advanced use only** Test a node to see if it matches the predicate test.
`static XPathFactory` | `factory()` **For advanced use only** Create an XPathFactory for this XLocator.
`static XLocator` | `getDefaultLocator()` **For advanced use only** The the default locator.
`XNodeSet` | `locationPath(XPath xpath, XPathSupport execContext, org.w3c.dom.Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo, boolean stopAtFirst)` **For advanced use only** Execute a location path.
`double` | `locationPathPattern(XPath xpath, XPathSupport execContext, org.w3c.dom.Node context, int opPos)` **For advanced use only** Execute a a location path pattern.
`double` | `nodeTest(XPath xpath, XPathSupport execContext, org.w3c.dom.Node context, int opPos, int argLen, int stepType)` **For advanced use only** Test a node to see if it matches the given node test.
`static XLocator` | `query(java.lang.String path, java.lang.String fileSpec)` **For advanced use only** Execute the proprietary connect() function, which returns an instance of XLocator.
`XNodeSet` | `union(XPath xpath, XPathSupport execContext, org.w3c.dom.Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo)` **For advanced use only** Computes the union of its operands which must be node-sets.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleNodeLocator

    public SimpleNodeLocator()

  **For advanced use only** Create a SimpleNodeLocator object.

Method Detail

### getDefaultLocator

    public static XLocator getDefaultLocator()

  **For advanced use only** The the default locator.

### query

    public static XLocator query(java.lang.String path,
                                 java.lang.String fileSpec)

  **For advanced use only** Execute the proprietary connect() function, which returns an instance of XLocator. When the XPath object sees a return type of XLocator, it will call the locationPath function that passes in the connectArgs. The opPos and args params are not used by this function. This really is just a factory function for the XLocator instance, but this fact is hidden from the user.
  Parameters:
    `opPos` - The current position in the xpath.m_opMap array.
    `args` - The function args.

### connect

    public static XLocator connect(java.lang.String path,
                                   java.lang.String fileSpec)

  **For advanced use only** (Same as query for the moment).
  Parameters:
    `opPos` - The current position in the xpath.m_opMap array.
    `args` - The function args.

### connectToNodes

    public XNodeSet connectToNodes(XPath xpath,
                                   XPathSupport execContext,
                                   org.w3c.dom.Node context,
                                   int opPos,
                                   java.util.Vector connectArgs)
                            throws org.xml.sax.SAXException

  **For advanced use only** Execute a connection (if it was not executed by the static connect method) and process the following LocationPath, if it is present. Normally, the connection functionality should be executed by this function and not the static connect function, which is really a factory method for the XLocator instance. The arguments to the static connect function are re-passed to this function.
  Specified by:
    connectToNodes in interface XLocator
  Parameters:
    `xpath` - The xpath that is executing.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.
    `connectArgs` - The same arguments that were passed to the static connect function.

### union

    public XNodeSet union(XPath xpath,
                          XPathSupport execContext,
                          org.w3c.dom.Node context,
                          int opPos,
                          NodeCallback callback,
                          java.lang.Object callbackInfo)
                   throws org.xml.sax.SAXException

  **For advanced use only** Computes the union of its operands which must be node-sets.
  Specified by:
    union in interface XLocator
  Parameters:
    `context` - The current source tree context node.
    `opPos` - The current position in the m_opMap array.

### locationPath

    public XNodeSet locationPath(XPath xpath,
                                 XPathSupport execContext,
                                 org.w3c.dom.Node context,
                                 int opPos,
                                 NodeCallback callback,
                                 java.lang.Object callbackInfo,
                                 boolean stopAtFirst)
                          throws org.xml.sax.SAXException

  **For advanced use only** Execute a location path. Normally, this method simply moves past the OP_LOCATIONPATH and it's length member, and calls the Step function, which will recursivly process the rest of the LocationPath, and then wraps the NodeList result in an XNodeSet object.
  Specified by:
    locationPath in interface XLocator
  Parameters:
    `xpath` - The xpath that is executing.
    `execContext` - The execution context.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.
    `callback` - Interface that implements the processLocatedNode method.
    `callbackInfo` - Object that will be passed to the processLocatedNode method.

### locationPathPattern

    public double locationPathPattern(XPath xpath,
                                      XPathSupport execContext,
                                      org.w3c.dom.Node context,
                                      int opPos)
                               throws org.xml.sax.SAXException

  **For advanced use only** Execute a a location path pattern. This will return a score of MATCH_SCORE_NONE, MATCH_SCORE_NODETEST, MATCH_SCORE_OTHER, MATCH_SCORE_QNAME.
  Specified by:
    locationPathPattern in interface XLocator
  Parameters:
    `xpath` - The xpath that is executing.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.

### doPredicate

    public double doPredicate(XPath xpath,
                              XPathSupport execContext,
                              org.w3c.dom.Node context,
                              int opPos,
                              int argLen,
                              int startOpPos)
                       throws org.xml.sax.SAXException

  **For advanced use only** Test a node to see if it matches the predicate test.
  Parameters:
    `xpath` - The xpath that is executing.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.
    `argLen` - The length of the argument.
    `startOpPos` - The original position in the xpath.m_opMap array.

### nodeTest

    public double nodeTest(XPath xpath,
                           XPathSupport execContext,
                           org.w3c.dom.Node context,
                           int opPos,
                           int argLen,
                           int stepType)
                    throws org.xml.sax.SAXException

  **For advanced use only** Test a node to see if it matches the given node test.
  Parameters:
    `xpath` - The xpath that is executing.
    `context` - The current source tree context node.
    `opPos` - The current position in the xpath.m_opMap array.
    `len` - The length of the argument.
    `len` - The type of the step.

### factory

    public static XPathFactory factory()

  **For advanced use only** Create an XPathFactory for this XLocator.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache XML Project. All Rights Reserved.