net.sf.tacos.binding
Class TemplateBinding

java.lang.Object
  extended by org.apache.tapestry.binding.AbstractBinding
      extended by net.sf.tacos.binding.TemplateBinding
All Implemented Interfaces:
Locatable, org.apache.tapestry.IBinding

public class TemplateBinding
extends org.apache.tapestry.binding.AbstractBinding

An implementation of Tapestry IBinding that provides a binding similar to LiteralBinding with the additional benefit that it can also include variables. The variables should be put into ${} .
Here's an example: <binding name="effects" value="template:some id is ${currNote.id}."/>

The binding can also get its content from resource bundles. It will still go on and process it - looking for variables to substitute.
Example: <binding name="effects" value="template:%message-code"/>


Field Summary
 
Fields inherited from class org.apache.tapestry.binding.AbstractBinding
_description
 
Constructor Summary
TemplateBinding(String description, Location location, org.apache.tapestry.coerce.ValueConverter valueConverter, org.apache.tapestry.IComponent root, String expression, org.apache.tapestry.binding.BindingFactory nestedBindingFactory)
          constructor
 
Method Summary
 Object getObject()
          Evaluate the value with inside variables.
 boolean isInvariant()
          Should be variant because of inside ognl expression.
 
Methods inherited from class org.apache.tapestry.binding.AbstractBinding
createReadOnlyBindingException, extendDescription, getComponent, getDescription, getLocation, getObject, getValueConverter, setObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplateBinding

public TemplateBinding(String description,
                       Location location,
                       org.apache.tapestry.coerce.ValueConverter valueConverter,
                       org.apache.tapestry.IComponent root,
                       String expression,
                       org.apache.tapestry.binding.BindingFactory nestedBindingFactory)
constructor

Parameters:
description -
location -
valueConverter -
root - The root object against which the nested property name is evaluated.
expression - plain string or message code in page's specification file.
nestedBindingFactory - Internal used BindingFactory
Method Detail

getObject

public Object getObject()
Evaluate the value with inside variables.

Returns:
binding value

isInvariant

public boolean isInvariant()
Should be variant because of inside ognl expression.

Specified by:
isInvariant in interface org.apache.tapestry.IBinding
Overrides:
isInvariant in class org.apache.tapestry.binding.AbstractBinding
Returns:
indicate it is variant.
See Also:
IBinding.isInvariant()


Copyright © 2005-2008 SourceForge.net. All Rights Reserved.