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

Quick Search    Search Deep

org.apache.commons.jxpath.functions.* (2)org.apache.commons.jxpath.ri.* (139)
org.apache.commons.jxpath.servlet.* (12)org.apache.commons.jxpath.util.* (6)
org.apache.commons.jxpath.xml.* (5)

org.apache.commons.jxpath: Javadoc index of package org.apache.commons.jxpath.


Package Samples:

org.apache.commons.jxpath.ri.model.jdom: The "model" package defines APIs that are implemented for every object model to be supported by JXPath.  
org.apache.commons.jxpath.xml: Public, abstract part of JXPath: interfaces and configuration.  
org.apache.commons.jxpath.ri.parser: Reference implementation of JXPath.  
org.apache.commons.jxpath.functions
org.apache.commons.jxpath.ri.axes
org.apache.commons.jxpath.ri.compiler
org.apache.commons.jxpath.ri.model.beans
org.apache.commons.jxpath.ri.model.container
org.apache.commons.jxpath.ri.model.dom
org.apache.commons.jxpath.ri.model.dynabeans
org.apache.commons.jxpath.ri.model.dynamic
org.apache.commons.jxpath.ri.model
org.apache.commons.jxpath.ri
org.apache.commons.jxpath.servlet
org.apache.commons.jxpath.util

Classes:

JXPathContext: JXPathContext provides APIs for the traversal of graphs of JavaBeans using the XPath syntax. Using JXPathContext, you can read and write properties of JavaBeans, arrays, collections and maps. JXPathContext uses JavaBeans introspection to enumerate and access JavaBeans properties. JXPathContext allows alternative implementations. This is why instead of allocating JXPathContext directly, you should call a static newContext method. This method will utilize the JXPathContextFactory API to locate a suitable implementation of JXPath. Bundled with JXPath comes a default implementation called Reference ...
JXPathServletContexts: Static methods that allocate and cache JXPathContexts bound to PageContext, ServletRequest, HttpSession and ServletContext. The JXPathContext returned by getPageContext() 55 provides access to all scopes via the PageContext.findAttribute() method. Thus, an expression like "foo" will first look for the attribute named "foo" in the "page" context, then the "request" context, then the "session" one and finally in the "application" context. If you need to limit the attibute lookup to just one scope, you can use the pre-definded variables "page", "request", "session" and "application". For example, ...
PackageFunctions: Extension functions provided by Java classes. The class prefix specified in the constructor is used when a constructor or a static method is called. Usually, a class prefix is a package name (hence the name of this class). Let's say, we declared a PackageFunction like this: new PackageFunctions("java.util.", "util") We can now use XPaths like: "util:Date.new()" Equivalent to new java.util.Date() "util:Collections.singleton('foo')" Equivalent to java.util.Collections.singleton("foo") "util:substring('foo', 1, 2)" Equivalent to "foo".substring(1, 2) . Note that in this case, the class prefix is not ...
Compiler: The Compiler APIs are completely agnostic to the actual types of objects produced and consumed by the APIs. Arguments and return values are declared as java.lang.Object. Since objects returned by Compiler methods are passed as arguments to other Compiler methods, the descriptions of these methods use virtual types. There are four virtual object types: EXPRESSION, QNAME, STEP and NODE_TEST. The following example illustrates this notion. This sequence compiles the xpath "foo[round(1 div 2)]/text()": Object qname1 = compiler.qname(null, "foo") Object expr1 = compiler.number("1"); Object expr2 = compiler.number("2"); ...
Pointer: Pointers represent locations of objects and their properties in Java object graphs. JXPathContext has methods ( getPointer() 55 and ( iteratePointers() 55 , which, given an XPath, produce Pointers for the objects or properties described the the path. For example, ctx.getPointer ("foo/bar") will produce a Pointer that can get and set the property "bar" of the object which is the value of the property "foo" of the root object. The value of ctx.getPointer("aMap/aKey[3]") will be a pointer to the 3'rd element of the array, which is the value for the key "aKey" of the map, which is the value of the ...
ExpressionContext: If an extenstion function has an argument of type ExpressionContext, it can gain access to the current node of an XPath expression context. Example: public class MyExtenstionFunctions { public static String objectType(ExpressionContext context){ Object value = context.getContextNodePointer().getValue(); if (value == null){ return "null"; } return value.getClass().getName(); } } You can then register this extension function using a ClassFunctions object and call it like this: "/descendent-or-self::node()[ns:objectType() = 'java.util.Date']" This expression will find all nodes of the graph that are ...
Function: Extension function interface. Extension functions are grouped into Functions objects, which are installed on JXPathContexts using the JXPathContext.setFunctions() 55 call. The Function interface can be implemented directly. However, most of the time JXPath's built-in implementations should suffice. See ClassFunctions and PackageFunctions .
DynamicPropertyHandler: A generic mechanism for accessing collections of name/value pairs. Examples of such collections are HashMap, Properties, ServletContext. In order to add support for a new such collection type to JXPath, perform the following two steps: Build an implementation of the DynamicPropertyHandler interface for the desired collection type. Invoke the static method JXPathIntrospector.registerDynamicClass(class, handlerClass) 55 JXPath allows access to dynamic properties using these three formats: "myMap/myKey" "myMap[@name = 'myKey']" "myMap[name(.) = 'myKey']"
JXPathBeanInfo: JXPathBeanInfo is similar to java.beans.BeanInfo in that it describes properties of a JavaBean class. By default, JXPathBeanInfo classes are automatically generated by JXPathIntrospector based on the java.beans.BeanInfo. As with JavaBeans, the user can supply an alternative implementation of JXPathBeanInfo for a custom class. The alternative implementation is located by class name, which is the same as the name of the class it represents with the suffix "XBeanInfo". So, for example, if you need to provide an alternative JXPathBeanInfo class for class "com.foo.Bar", write a class "com.foo.BarXBeanInfo" ...
ClassFunctions: Extension functions provided by a Java class. Let's say, we declared a ClassFunction like this: new ClassFunctions(Integer.class, "int") We can now use XPaths like: "int:new(3)" Equivalent to new Integer(3) "int:getInteger('foo')" Equivalent to Integer.getInteger("foo") "int:floatValue(int:new(4))" Equivalent to new Integer(4).floatValue() If the first argument of a method is ExpressionContext, the expression context in which the function is evaluated is passed to the method.
CompiledExpression: Represents a compiled XPath. The interpretation of compiled XPaths may be faster, because it bypasses the compilation step. The reference implementation of JXPathContext also globally caches some of the results of compilation, so the direct use of JXPathContext is not always less efficient than the use of CompiledExpression. Use CompiledExpression only when there is a need to evaluate the same expression multiple times and the CompiledExpression can be conveniently cached. To acqure a CompiledExpression, call JXPathContext.compile 55
AbstractFactory: 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.
JXPathContextFactory: 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.
XMLDocumentContainer: An XML document container reads and parses XML only when it is accessed. JXPath traverses Containers transparently - you use the same paths to access objects in containers as you do to access those objects directly. You can create XMLDocumentContainers for various XML documents that may or may not be accessed by XPaths. If they are, they will be automatically read, parsed and traversed. If they are not - they won't be read at all.
DocumentContainer: An XML document container reads and parses XML only when it is accessed. JXPath traverses Containers transparently - you use the same paths to access objects in containers as you do to access those objects directly. You can create XMLDocumentContainers for various XML documents that may or may not be accessed by XPaths. If they are, they will be automatically read, parsed and traversed. If they are not - they won't be read at all.
Functions: A group of Function objects sharing a common namespace or a set of common namespaces. Use the classes ClassFunctions and PackageFunctions to register extension functions implemented as Java methods.
NullElementPointer: Used when there is a need to construct a Pointer for a collection element that does not exist. For example, if the path is "foo[3]", but the collection "foo" only has one element or is empty or is null, the NullElementPointer can be used to capture this situation without putting a regular NodePointer into an invalid state. Just create a NullElementPointer with index 2 (= 3 - 1) and a "foo" pointer as the parent.
JXPathTestSuite: Test Suite for the JXPath class. The majority of these tests use instances of the TestBean class, so be sure to update the tests if you change the characteristics of that class. Note that the tests are dependent upon the static aspects (such as array sizes...) of the TestBean.java class, so ensure that all changes to TestBean are reflected here and in other JXPath tests.
Variables: Variables provide access to a global set of values accessible via XPath. XPath can reference variables using the "$varname" syntax. To use a custom implementation of this interface, pass it to JXPathContext.setVariables() 55
SimplePathInterpreter: An evaluation mechanism for simple XPaths, which is much faster than the usual process. It is only used for xpaths which have no context-dependent parts, consist entirely of child::name and self::node() steps with predicates that either integer or have the form [@name = ...] .
Expression: Common superclass for several types of nodes in the parse tree. Provides APIs for optimization of evaluation of expressions. Specifically, an expression only needs to executed once during the evaluation of an xpath if that expression is context-independent. Expression.isContextDependent() provides that hint.
ParseException: This exception is thrown when parse errors are encountered. You can explicitly create objects of this exception type by calling the method generateParseException in the generated parser. You can modify this class to customize your error reporting mechanisms so long as you retain the public fields.
IdentityManager: A delegate of JXPathContext that implements the XPath "id()" function. This delegate is only used when there is no default implementation of the id() function. For example, it is not used when the root of the context is a DOM Node.
Container: A Container is an object implementing an indirection mechanism transparent to JXPath. For example, if property "foo" of the context node has a Container as its value, the XPath "foo" will produce the contents of that Container, rather than the container itself.
NodePointer: Common superclass for Pointers of all kinds. A NodePointer maps to a deterministic XPath that represents the location of a node in an object graph. This XPath uses only simple axes: child, namespace and attribute and only simple, context-independent predicates.

Home | Contact Us | Privacy Policy | Terms of Service