COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification

org.eclipse.cosmos.rm.validation.internal.reference
Class XPointerExpression

java.lang.Object
  extended by org.eclipse.cosmos.rm.validation.internal.reference.XPointerExpression

public class XPointerExpression
extends java.lang.Object

This class is used to represent an XPointer expression that can be evaluated. Instances of this class should be obtained by compiling a string representation of the XPointer expression: XPointer.compile(String)


Field Summary
protected static byte BARE_NAME_TYPE
          Indicates a bare name type
protected static byte CHILD_SEQUENCE_TYPE
          Indicates a child sequence type
protected static byte FULL_XPOINTER_TYPE
          Indicates a full xpointer type
 
Constructor Summary
protected XPointerExpression(byte type)
          The visibility of the constructor is limited.
 
Method Summary
 void addChildSequence(int child)
          Add a child sequence to this expression
 void addScheme(IXScheme scheme)
          Add a scheme to this expression
 java.lang.Object evaluate(java.lang.Object context)
          Evaluates this expression using the context that is passed in
 java.lang.String getBareName()
           
 int[] getChildSequence()
          Retuns a copy of the child sequence
 java.util.List getScheme()
          Returns the schemes associated with this XPointer expression
 byte getType()
           
 void setBareName(java.lang.String bareName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BARE_NAME_TYPE

protected static final byte BARE_NAME_TYPE
Indicates a bare name type

See Also:
Constant Field Values

CHILD_SEQUENCE_TYPE

protected static final byte CHILD_SEQUENCE_TYPE
Indicates a child sequence type

See Also:
Constant Field Values

FULL_XPOINTER_TYPE

protected static final byte FULL_XPOINTER_TYPE
Indicates a full xpointer type

See Also:
Constant Field Values
Constructor Detail

XPointerExpression

protected XPointerExpression(byte type)
The visibility of the constructor is limited.

Parameters:
type - The type of this expression
See Also:
BARE_NAME_TYPE, CHILD_SEQUENCE_TYPE, FULL_XPOINTER_TYPE
Method Detail

getBareName

public java.lang.String getBareName()
Returns:
the bareName

setBareName

public void setBareName(java.lang.String bareName)
Parameters:
bareName - the bareName to set

getType

public byte getType()
Returns:
the type

addScheme

public void addScheme(IXScheme scheme)
Add a scheme to this expression

Parameters:
scheme - The scheme to be added

addChildSequence

public void addChildSequence(int child)
Add a child sequence to this expression

Parameters:
child -

evaluate

public java.lang.Object evaluate(java.lang.Object context)
                          throws BadContextException,
                                 BadExpressionException
Evaluates this expression using the context that is passed in

Parameters:
context - The context to be used to evaluate this expression
Returns:
An object resulting from evaluating this expression
Throws:
BadContextException - If the context of the expression is not valid.
BadExpressionException - If the expression of a scheme is invalid

getScheme

public java.util.List getScheme()
Returns the schemes associated with this XPointer expression

Returns:
The schemes of this expression

getChildSequence

public int[] getChildSequence()
Retuns a copy of the child sequence

Returns:
The child sequence associated with this expression

COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification