class ScalesXPath extends ScalesBaseJaxenXPath
Use evaluate every time, select nodes will not work.
NB: This class is only available with the scales-jaxen dependencies.
- Alphabetic
- By Inheritance
- ScalesXPath
- ScalesBaseJaxenXPath
- Serializable
- XPath
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ScalesXPath(xpath: String, nsMap: Map[String, String] = Map(), nameConversion: (QName) ⇒ QName = ScalesXPath.defaultNoConversion)
- nsMap
a prefix -> namespace map. Use the companion object to pass in PrefixedNamespaces
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addNamespace(prefix: String, uri: String): Unit
Add a namespace prefix-to-URI mapping for this XPath expression.
Add a namespace prefix-to-URI mapping for this XPath expression.
Namespace prefix-to-URI mappings in an XPath are independent of those used within any document. Only the mapping explicitly added to this XPath will be available for resolving the XPath expression.
This is a convenience method for adding mappings to the default
NamespaceContextin place for this XPath. If you have installed a customNamespaceContextthat is not aSimpleNamespaceContext, then this method will throw aJaxenException.- prefix
the namespace prefix
- uri
the namespace URI
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
JaxenExceptionif theNamespaceContextused by this XPath is not aSimpleNamespaceContext
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
attributePaths(path: xml.XmlPath): Iterable[AttributePath]
Evaluates path returning only matching AttributePaths
-
def
booleanValueOf(node: Any): Boolean
Retrieve a boolean-value interpretation of this XPath expression when evaluated against a given context.
Retrieve a boolean-value interpretation of this XPath expression when evaluated against a given context.
The boolean-value of the expression is determined per the
boolean(..)function defined in the XPath specification. This means that an expression that selects zero nodes will returnfalse, while an expression that selects one or more nodes will returntrue.- node
the node, node-set or Context object for evaluation. This value can be null.
- returns
the boolean-value of the result of evaluating this expression with the specified context node
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
createFunctionContext(): FunctionContext
Create a default
FunctionContext.Create a default
FunctionContext.- returns
a default
FunctionContext
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
-
def
createNamespaceContext(): NamespaceContext
Create a default
NamespaceContext.Create a default
NamespaceContext.- returns
a default
NamespaceContextinstance
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
-
def
createVariableContext(): VariableContext
Create a default
VariableContext.Create a default
VariableContext.- returns
a default
VariableContextinstance
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
-
def
debug(): String
Returns a string representation of the parse tree.
Returns a string representation of the parse tree.
- returns
a string representation of the parse tree.
- Definition Classes
- ScalesBaseJaxenXPath
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
evaluate(path: xml.XmlPath): Iterable[Either[AttributePath, xml.XmlPath]]
Jaxen can't sort non identity/reference equality based object models.
Jaxen can't sort non identity/reference equality based object models. So we do the work for it and cut out the existing sorting.
Additionally its nice to get a somewhat better result
-
def
evaluate(context: Any): AnyRef
Evaluate this XPath against a given context.
Evaluate this XPath against a given context. The context of evaluation may be any object type the navigator recognizes as a node. The return value is either a
String,Double,Boolean, orListof nodes.When using this method, one must be careful to test the class of the returned object. If the returned object is a list, then the items in this list will be the actual
Document,Element,Attribute, etc. objects as defined by the concrete XML object-model implementation, directly from the context document. This method does not return copies of anything, but merely returns references to objects within the source document.- context
the node, node-set or Context object for evaluation. This value can be null.
- returns
the result of evaluating the XPath expression against the supplied context
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
ClassCastExceptionif the context is not a nodeJaxenExceptionif an XPath error occurs during expression evaluation
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get[T](path: xml.XmlPath): T
Single primitive version with hidden cast :<
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getContext(node: Any): Context
Create a
Contextwrapper for the provided implementation-specific object.Create a
Contextwrapper for the provided implementation-specific object.- node
the implementation-specific object to be used as the context
- returns
a
Contextwrapper around the object
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
-
def
getContextSupport(): ContextSupport
Retrieve the
ContextSupportaggregation ofNamespaceContext,FunctionContext,VariableContext, andNavigator.Retrieve the
ContextSupportaggregation ofNamespaceContext,FunctionContext,VariableContext, andNavigator.- returns
aggregate
ContextSupportfor this XPath expression
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
-
def
getFunctionContext(): FunctionContext
Retrieve the
FunctionContextused by this XPath expression.Retrieve the
FunctionContextused by this XPath expression.A
FunctionContextis responsible for resolving all function calls used within the expression.If this XPath expression has not previously had a
FunctionContextinstalled, a new defaultFunctionContextwill be created, installed and returned.- returns
the
FunctionContextused by this expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- See also
FunctionContext
-
def
getNamespaceContext(): NamespaceContext
Retrieve the
NamespaceContextused by this XPath expression.Retrieve the
NamespaceContextused by this XPath expression.A
NamespaceContextis responsible for mapping prefixes used within the expression to namespace URIs.If this XPath expression has not previously had a
NamespaceContextinstalled, a new defaultNamespaceContextwill be created, installed and returned.- returns
the
NamespaceContextused by this expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- See also
NamespaceContext
-
def
getNavigator(): Navigator
Retrieve the XML object-model-specific
Navigatorfor us in evaluating this XPath expression.Retrieve the XML object-model-specific
Navigatorfor us in evaluating this XPath expression.- returns
the implementation-specific
Navigator
- Definition Classes
- ScalesBaseJaxenXPath → XPath
-
def
getRootExpr(): Expr
Retrieve the root expression of the internal compiled form of this XPath expression.
Retrieve the root expression of the internal compiled form of this XPath expression.
Internally, Jaxen maintains a form of Abstract Syntax Tree (AST) to represent the structure of the XPath expression. This is normally not required during normal consumer-grade usage of Jaxen. This method is provided for hard-core users who wish to manipulate or inspect a tree-based version of the expression.
- returns
the root of the AST of this expression
- Definition Classes
- ScalesBaseJaxenXPath
-
def
getVariableContext(): VariableContext
Retrieve the
VariableContextused by this XPath expression.Retrieve the
VariableContextused by this XPath expression.A
VariableContextis responsible for resolving all variables referenced within the expression.If this XPath expression has not previously had a
VariableContextinstalled, a new defaultVariableContextwill be created, installed and returned.- returns
the
VariableContextused by this expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- See also
VariableContext
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val nameConversion: (QName) ⇒ QName
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val nsMap: Map[String, String]
-
def
numberValueOf(node: Any): Number
Retrieve a number-value interpretation of this XPath expression when evaluated against a given context.
Retrieve a number-value interpretation of this XPath expression when evaluated against a given context.
The number-value of the expression is determined per the
number(..)core function as defined in the XPath specification. This means that if this expression selects multiple nodes, the number-value of the first node is returned.- node
the node, node-set or Context object for evaluation. This value can be null.
- returns
a
Doubleindicating the numeric value of evaluating this expression against the specified context
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation
-
def
selectNodes(node: Any): List[_]
Select all nodes that are selected by this XPath expression.
Select all nodes that are selected by this XPath expression. If multiple nodes match, multiple nodes will be returned. Nodes will be returned in document-order, as defined by the XPath specification. If the expression selects a non-node-set (i.e. a number, boolean, or string) then a List containing just that one object is returned.
- node
the node, node-set or Context object for evaluation. This value can be null.
- returns
the node-set of all items selected by this XPath expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation- See also
#selectNodesForContext
-
def
selectNodesForContext(context: Context): List
Select all nodes that match this XPath expression on the given Context object.
Select all nodes that match this XPath expression on the given Context object. If multiple nodes match, multiple nodes will be returned in document-order, as defined by the XPath specification. If the expression selects a non-node-set (i.e. a number, boolean, or string) then a List containing just that one object is returned.
- context
the Context which gets evaluated
- returns
the node-set of all items selected by this XPath expression
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation
-
def
selectSingleNode(node: Any): AnyRef
Select only the first node selected by this XPath expression.
Select only the first node selected by this XPath expression. If multiple nodes match, only one node will be returned. The selected node will be the first selected node in document-order, as defined by the XPath specification.
- node
the node, node-set or Context object for evaluation. This value can be null.
- returns
the node-set of all items selected by this XPath expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation- See also
#selectNodes
-
def
selectSingleNodeForContext(context: Context): AnyRef
Return only the first node that is selected by this XPath expression.
Return only the first node that is selected by this XPath expression. If multiple nodes match, only one node will be returned. The selected node will be the first selected node in document-order, as defined by the XPath specification. If the XPath expression selects a double, String, or boolean, then that object is returned.
- context
the Context against which this expression is evaluated
- returns
the first node in document order of all nodes selected by this XPath expression
- Attributes
- protected[jaxen]
- Definition Classes
- ScalesBaseJaxenXPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation- See also
#selectNodesForContext
-
def
setFunctionContext(functionContext: FunctionContext): Unit
Set a
FunctionContextfor use with this XPath expression.Set a
FunctionContextfor use with this XPath expression.A
FunctionContextis responsible for resolving all function calls used within the expression.- functionContext
the
FunctionContextto install for this expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- See also
FunctionContext
FunctionContext#getFunction
-
def
setNamespaceContext(namespaceContext: NamespaceContext): Unit
Set a
NamespaceContextfor use with this XPath expression.Set a
NamespaceContextfor use with this XPath expression.A
NamespaceContextis responsible for translating namespace prefixes within the expression into namespace URIs.- namespaceContext
the
NamespaceContextto install for this expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- See also
NamespaceContext
NamespaceContext#translateNamespacePrefixToUri
-
def
setVariableContext(variableContext: VariableContext): Unit
Set a
VariableContextfor use with this XPath expression.Set a
VariableContextfor use with this XPath expression.A
VariableContextis responsible for resolving all variables referenced within the expression.- variableContext
The
VariableContextto install for this expression
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- See also
VariableContext
VariableContext#getVariableValue
-
def
stringValueOf(node: Any): String
Retrieves the string-value of the result of evaluating this XPath expression when evaluated against the specified context.
Retrieves the string-value of the result of evaluating this XPath expression when evaluated against the specified context.
The string-value of the expression is determined per the
string(..)core function defined in the XPath specification. This means that an expression that selects zero nodes will return the empty string, while an expression that selects one-or-more nodes will return the string-value of the first node.- node
the node, node-set or Context object for evaluation. This value can be null.
- returns
the string-value of the result of evaluating this expression with the specified context node
- Definition Classes
- ScalesBaseJaxenXPath → XPath
- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
Return the original expression text.
Return the original expression text.
- returns
the normalized XPath expression string
- Definition Classes
- ScalesBaseJaxenXPath → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withNameConversion(conversion: (QName) ⇒ QName): ScalesXPath
Provides a conversion function for QNames, this allows a caller to remove namespaces, for example via ScalesXPath.localOnly
-
def
xmlPaths(path: xml.XmlPath): Iterable[xml.XmlPath]
Evaluates path returning only matching XmlPaths
- val xpath: String
Deprecated Value Members
-
def
valueOf(node: Any): String
Returns the XPath string-value of the argument node.
Returns the XPath string-value of the argument node.
- node
the node whose value to take
- returns
the XPath string value of this node
- Definition Classes
- ScalesBaseJaxenXPath
- Deprecated
replaced by
#stringValueOf- Exceptions thrown
JaxenExceptionif an XPath error occurs during expression evaluation