net.shibboleth.metadata.dom
Class XPathItemSelectionStrategy

java.lang.Object
  extended by net.shibboleth.metadata.dom.XPathItemSelectionStrategy
All Implemented Interfaces:
com.google.common.base.Predicate<DomElementItem>

@ThreadSafe
public class XPathItemSelectionStrategy
extends Object
implements com.google.common.base.Predicate<DomElementItem>

Item selection strategy which selects items on the basis of a boolean XPath expression.


Field Summary
private  XPathExpression compiledExpression
          Compiled form of the expression.
private  Logger log
          Class logger.
private  NamespaceContext namespaceContext
          The NamespaceContext to use in interpreting the XPath expression.
 
Constructor Summary
XPathItemSelectionStrategy(String expression, NamespaceContext context)
          Constructor.
 
Method Summary
 boolean apply(DomElementItem item)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Predicate
equals
 

Field Detail

log

private final Logger log
Class logger.


compiledExpression

private final XPathExpression compiledExpression
Compiled form of the expression. XPathExpression objects are reusable but are not thread-safe, so access to the compiled expression must be protected.


namespaceContext

private final NamespaceContext namespaceContext
The NamespaceContext to use in interpreting the XPath expression.

Constructor Detail

XPathItemSelectionStrategy

public XPathItemSelectionStrategy(@Nonnull@NotEmpty
                                  String expression,
                                  @Nonnull
                                  NamespaceContext context)
                           throws XPathExpressionException
Constructor.

Parameters:
expression - XPath expression to execute.
context - Namespace context to use for the expression, expressed as a NamespaceContext.
Throws:
XPathExpressionException - if there is a problem compiling the expression
Method Detail

apply

public boolean apply(@Nonnull
                     DomElementItem item)

Specified by:
apply in interface com.google.common.base.Predicate<DomElementItem>


Copyright © 1999-2012. All Rights Reserved.