org.nodal.nav
Interface PathOperator

All Known Implementing Classes:
PathOp

public interface PathOperator

A functional operator that can be applied to a Path to obtain a new Path.

Author:
Lee Iverson

Method Summary
 Path applyTo(Path p)
          Create a new Path by applying this operator.
 java.lang.Object arg(int i)
          Get the i-th argument for the function represented by this PathOperator.
 java.lang.String[] args()
          Each PathOperator can be described by an operator name and a set of arguments.
 Getter bindFrom(Path parent)
          Extract the appropriate Getter by applying this operator.
 java.lang.String encoded()
          The encoded string representing this PathOperator
 java.lang.String functionName()
          Each PathOperator can be described by an operator name and a set of arguments.
 boolean isAbsolute()
          Whether or not this PathOperator represents a direct reference to a Node.
 boolean isDocumentOp()
          Is this PathOperator a document-level operator?
 boolean isFragmentOp()
          Is this PathOperator a fragment-level operator?
 

Method Detail

isDocumentOp

public boolean isDocumentOp()
Is this PathOperator a document-level operator?

All Path operators either select a Document or a location within a Document. Those that select Documents are referred to as "document" operators.

PathOperators may work on both levels (e.g. DerefOp)


isFragmentOp

public boolean isFragmentOp()
Is this PathOperator a fragment-level operator?

All Path operators either select a Document or a location within a Document. Those that operate inside Documents are referred to as "fragment" operators.

PathOperators may work on both levels (e.g. DerefOp)


isAbsolute

public boolean isAbsolute()
Whether or not this PathOperator represents a direct reference to a Node. An absolute Path is defined as one with an absolute PathOperator at its head.


encoded

public java.lang.String encoded()
The encoded string representing this PathOperator

Returns:
the encoded String representing this PathOperator

applyTo

public Path applyTo(Path p)
             throws Path.Failure
Create a new Path by applying this operator. Defining this method represents the functional role associated with this PathOperator.

Throws:
Path.Failure

bindFrom

public Getter bindFrom(Path parent)
                throws Path.Failure
Extract the appropriate Getter by applying this operator. Defining this method represents the functional role associated with this PathOperator.

Returns:
null if do not have permission to access content
Throws:
Path.Failure - if there is a type mismatch when accessing the Getter

functionName

public java.lang.String functionName()
Each PathOperator can be described by an operator name and a set of arguments. This function returns the name of the function that this PathOperator performs.

Returns:
the name of the PathOperator function

args

public java.lang.String[] args()
Each PathOperator can be described by an operator name and a set of arguments. This function returns the arguments of the function that this PathOperator performs.

Returns:
the arguments of the PathOperator function

arg

public java.lang.Object arg(int i)
Get the i-th argument for the function represented by this PathOperator.

Parameters:
i - the index of the argument requested
Returns:
the value of the argument requested