org.apache.tapestry5.services
Interface PropertyConduitSource
- All Known Implementing Classes:
- PropertyConduitSourceImpl
public interface PropertyConduitSource
A source for PropertyConduits, which can be thought of as a compiled property path
expression. PropertyConduits are the basis of the "prop:" binding factory, thus this service defines the expression
format used by the PropBindingFactory.
The expression consist of one or more terms, seperated by periods. Each term may be either the name of a JavaBean
property, or the name of a method (a method that takes no parameters). Method names are distinguished from property
names by appending empty parens. Using a method term as the final term will make the expression read-only.
Alternately, the seperator between property names may be "?." (i.e., "user?.name"). This allows an "if not null"
connection: if the term is null, then the expression evaluates to null, otherwise, the expression evaluation
continues to the next property. The helps avoid NullPointerExceptions.
create
PropertyConduit create(Class rootClass,
String expression)
- Returns property conduit instance for the given expression. PropertyConduitSource caches the conduits it returns,
so despite the name, this method does not always create a new conduit. The cache is cleared if a change
to component classes is observed.
- Parameters:
rootClass - the class of the root object to which the expression is appliedexpression - expression to be evaluated on instances of the root class
- Returns:
- RuntimeException if the expression is invalid (poorly formed, references non-existent properties, etc.)
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.