org.apache.woden.internal.xpointer
Class XMLElementEvaluator

java.lang.Object
  extended by org.apache.woden.internal.xpointer.XMLElementEvaluator
Direct Known Subclasses:
DOMXMLElementEvaluator, OMXMLElementEvaluator

public abstract class XMLElementEvaluator
extends java.lang.Object

This class Evaluates an XPointer on a XMLElement, using the XPointer model in Woden. It currently supports shorthand pointer and element() scheme based pointer part.

Author:
Dan Harvey

Constructor Summary
XMLElementEvaluator(XPointer xpointer, XMLElement root)
          Constructs a new XMLElement abstract class for a XPointer and XMLElement.
 
Method Summary
 XMLElement evaluate()
          Evaluates the XPointer on the root XMLElement and returns the resulting XMLElement or null.
abstract  boolean testElementShorthand(XMLElement element, java.lang.String id)
          Tests the element for an id according to the specification at http://www.w3.org/TR/xptr-framework/#term-sdi and returns a boolean answer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLElementEvaluator

public XMLElementEvaluator(XPointer xpointer,
                           XMLElement root)
Constructs a new XMLElement abstract class for a XPointer and XMLElement.

Parameters:
xpointer - an XPointer which to evaluate.
root - an XMLElement which to evaluate the XPointer against.
Method Detail

evaluate

public XMLElement evaluate()
Evaluates the XPointer on the root XMLElement and returns the resulting XMLElement or null.

Returns:
an XMLElement from the resultant evaluation of the root XMLElement or null if evaluation fails.

testElementShorthand

public abstract boolean testElementShorthand(XMLElement element,
                                             java.lang.String id)
Tests the element for an id according to the specification at http://www.w3.org/TR/xptr-framework/#term-sdi and returns a boolean answer.

Parameters:
element - An XMLElement to test for an id.
id - A String of the id to test for.
Returns:
boolean value of whether the id matches or not.


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.