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

Quick Search    Search Deep

org.apache.commons.jxpath.ri
Class JXPathCompiledExpression  view JXPathCompiledExpression download JXPathCompiledExpression.java

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.JXPathCompiledExpression
All Implemented Interfaces:
org.apache.commons.jxpath.CompiledExpression

public class JXPathCompiledExpression
extends java.lang.Object
implements org.apache.commons.jxpath.CompiledExpression

Version:
$Revision: 1.9 $ $Date: 2004/02/29 14:17:45 $

Field Summary
private  org.apache.commons.jxpath.ri.compiler.Expression expression
           
private  java.lang.String xpath
           
 
Constructor Summary
JXPathCompiledExpression(java.lang.String xpath, org.apache.commons.jxpath.ri.compiler.Expression expression)
           
 
Method Summary
 org.apache.commons.jxpath.Pointer createPath(org.apache.commons.jxpath.JXPathContext context)
          Creates intermediate elements of the path by invoking an AbstractFactory, which should first be installed on the context by calling "setFactory".
 org.apache.commons.jxpath.Pointer createPathAndSetValue(org.apache.commons.jxpath.JXPathContext context, java.lang.Object value)
          The same as setValue, except it creates intermediate elements of the path by invoking an AbstractFactory, which should first be installed on the context by calling "setFactory".
protected  org.apache.commons.jxpath.ri.compiler.Expression getExpression()
           
 org.apache.commons.jxpath.Pointer getPointer(org.apache.commons.jxpath.JXPathContext context, java.lang.String xpath)
          Traverses the xpath and returns a Pointer.
 java.lang.Object getValue(org.apache.commons.jxpath.JXPathContext context)
          Evaluates the xpath and returns the resulting object.
 java.lang.Object getValue(org.apache.commons.jxpath.JXPathContext context, java.lang.Class requiredType)
          Evaluates the xpath, converts the result to the specified class and returns the resulting object.
protected  java.lang.String getXPath()
           
 java.util.Iterator iterate(org.apache.commons.jxpath.JXPathContext context)
          Traverses the xpath and returns a Iterator of all results found for the path.
 java.util.Iterator iteratePointers(org.apache.commons.jxpath.JXPathContext context)
          Traverses the xpath and returns an Iterator of Pointers.
 void removeAll(org.apache.commons.jxpath.JXPathContext context)
          Remove all graph elements described by this expression
 void removePath(org.apache.commons.jxpath.JXPathContext context)
          Remove the graph element described by this expression
 void setValue(org.apache.commons.jxpath.JXPathContext context, java.lang.Object value)
          Modifies the value of the property described by the supplied xpath.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xpath

private java.lang.String xpath

expression

private org.apache.commons.jxpath.ri.compiler.Expression expression
Constructor Detail

JXPathCompiledExpression

public JXPathCompiledExpression(java.lang.String xpath,
                                org.apache.commons.jxpath.ri.compiler.Expression expression)
Method Detail

getXPath

protected java.lang.String getXPath()

getExpression

protected org.apache.commons.jxpath.ri.compiler.Expression getExpression()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getValue

public java.lang.Object getValue(org.apache.commons.jxpath.JXPathContext context)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Evaluates the xpath and returns the resulting object. Primitive types are wrapped into objects.

Specified by:
getValue in interface org.apache.commons.jxpath.CompiledExpression

getValue

public java.lang.Object getValue(org.apache.commons.jxpath.JXPathContext context,
                                 java.lang.Class requiredType)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Evaluates the xpath, converts the result to the specified class and returns the resulting object.

Specified by:
getValue in interface org.apache.commons.jxpath.CompiledExpression

setValue

public void setValue(org.apache.commons.jxpath.JXPathContext context,
                     java.lang.Object value)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Modifies the value of the property described by the supplied xpath. Will throw an exception if one of the following conditions occurs:
  • The xpath does not in fact describe an existing property
  • The property is not writable (no public, non-static set method)

Specified by:
setValue in interface org.apache.commons.jxpath.CompiledExpression

createPath

public org.apache.commons.jxpath.Pointer createPath(org.apache.commons.jxpath.JXPathContext context)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Creates intermediate elements of the path by invoking an AbstractFactory, which should first be installed on the context by calling "setFactory".

Specified by:
createPath in interface org.apache.commons.jxpath.CompiledExpression

createPathAndSetValue

public org.apache.commons.jxpath.Pointer createPathAndSetValue(org.apache.commons.jxpath.JXPathContext context,
                                                               java.lang.Object value)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
The same as setValue, except it creates intermediate elements of the path by invoking an AbstractFactory, which should first be installed on the context by calling "setFactory".

Will throw an exception if one of the following conditions occurs:

  • Elements of the xpath aleady exist, by the path does not in fact describe an existing property
  • The AbstractFactory fails to create an instance for an intermediate element.
  • The property is not writable (no public, non-static set method)

Specified by:
createPathAndSetValue in interface org.apache.commons.jxpath.CompiledExpression

iterate

public java.util.Iterator iterate(org.apache.commons.jxpath.JXPathContext context)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Traverses the xpath and returns a Iterator of all results found for the path. If the xpath matches no properties in the graph, the Iterator will not be null.

Specified by:
iterate in interface org.apache.commons.jxpath.CompiledExpression

getPointer

public org.apache.commons.jxpath.Pointer getPointer(org.apache.commons.jxpath.JXPathContext context,
                                                    java.lang.String xpath)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Traverses the xpath and returns a Pointer. A Pointer provides easy access to a property. If the xpath matches no properties in the graph, the pointer will be null.

Specified by:
getPointer in interface org.apache.commons.jxpath.CompiledExpression

iteratePointers

public java.util.Iterator iteratePointers(org.apache.commons.jxpath.JXPathContext context)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Traverses the xpath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the xpath matches no properties in the graph, the Iterator be empty, but not null.

Specified by:
iteratePointers in interface org.apache.commons.jxpath.CompiledExpression

removePath

public void removePath(org.apache.commons.jxpath.JXPathContext context)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Remove the graph element described by this expression

Specified by:
removePath in interface org.apache.commons.jxpath.CompiledExpression

removeAll

public void removeAll(org.apache.commons.jxpath.JXPathContext context)
Description copied from interface: org.apache.commons.jxpath.CompiledExpression
Remove all graph elements described by this expression

Specified by:
removeAll in interface org.apache.commons.jxpath.CompiledExpression