org.formaria.aria
Class PathEvaluator

java.lang.Object
  extended by org.formaria.aria.PathEvaluator

public class PathEvaluator
extends java.lang.Object

A class used by Page to implement its evaluation of paths

Copyright (c) Formaria Ltd., 2008

License: see license.txt

$Revision: 1.1 $


Field Summary
protected  Project currentProject
          The project to which this object belongs
protected  DefaultAttributeEvaluator evaluator
          The default attribute expression evaluator
protected  PageSupport ownerPage
          The enclosing context
 
Constructor Summary
PathEvaluator(Project project, PageSupport page)
          Creates a new instance of PathEvaluator
 
Method Summary
 java.lang.Object evaluateAttribute(java.lang.String attribValue)
          Evaluates an attribute value.
 java.lang.String evaluatePath(java.lang.String path)
          Evaluates a path (potentially) containing a method call
 java.lang.String stripAttributeValues(java.lang.String path)
          Remove the attribute paths from a path e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

evaluator

protected DefaultAttributeEvaluator evaluator
The default attribute expression evaluator


ownerPage

protected PageSupport ownerPage
The enclosing context


currentProject

protected Project currentProject
The project to which this object belongs

Constructor Detail

PathEvaluator

public PathEvaluator(Project project,
                     PageSupport page)
Creates a new instance of PathEvaluator

Parameters:
project - the owner project
page - the enclosing context
Method Detail

evaluateAttribute

public java.lang.Object evaluateAttribute(java.lang.String attribValue)
Evaluates an attribute value. An attribute may be a value or a method call. If brackets are part of the value it is assumed that a method call is intended. The method call is indicated by the '$' symbol e.g. ${myMethod()}

Parameters:
attribValue - the raw attribute value
Returns:
the evaluated attribute

evaluatePath

public java.lang.String evaluatePath(java.lang.String path)
Evaluates a path (potentially) containing a method call

Parameters:
path - the raw path
Returns:
the evaluated path

stripAttributeValues

public java.lang.String stripAttributeValues(java.lang.String path)
Remove the attribute paths from a path e.g. remove @value=ignore

Parameters:
path - the path to strip
Returns:
the stripped path