net.shibboleth.metadata.dom
Class XPathItemSelectionStrategy

java.lang.Object
  extended by net.shibboleth.metadata.dom.XPathItemSelectionStrategy
All Implemented Interfaces:
ItemSelectionStrategy<DomElementItem>

@ThreadSafe
public class XPathItemSelectionStrategy
extends Object
implements ItemSelectionStrategy<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 isSelectedItem(DomElementItem item)
          Determines if the item meets the expected criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(String expression,
                                  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

isSelectedItem

public boolean isSelectedItem(DomElementItem item)
Determines if the item meets the expected criteria.

Specified by:
isSelectedItem in interface ItemSelectionStrategy<DomElementItem>
Parameters:
item - the being inspected, never null
Returns:
true of the item meets the expected criteria, false otherwise


Copyright © 2009-2011. All Rights Reserved.