org.apache.tapestry
Interface IBinding

All Superinterfaces:
org.apache.hivemind.Locatable
All Known Implementing Classes:
AbstractBinding, AssetBinding, BeanBinding, ClientIdBinding, ClientIdListBinding, ComponentBinding, ExpressionBinding, HiveMindBinding, ListenerMethodBinding, LiteralBinding, MessageBinding, MetaBinding, StateBinding, TranslatorBinding, UserAttributeBinding, ValidatorBinding, ValidatorsBinding

public interface IBinding
extends org.apache.hivemind.Locatable

A binding is the mechanism used to provide values for parameters of specific IComponent instances. The component doesn't care where the required value comes from, it simply requires that a value be provided when needed.

Bindings are set inside the containing component's specification or template. Bindings may be invariant or dynamic (though that is irrelevant to the component). Components may also use a binding to write a value back through a property to some other object (typically, another component).

Author:
Howard Lewis Ship

Method Summary
 String getDescription()
          Returns a description of how the binding is used; this description is localized and incorporated into some exception messages.
 Object getObject()
          Returns the value of this binding.
 Object getObject(Class type)
          Returns the value for the binding after performing some basic checks.
 boolean isInvariant()
          Returns true if the value is invariant (not changing; the same value returned each time).
 void setObject(Object value)
          Updates the value of the binding, if possible.
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

getObject

Object getObject()
Returns the value of this binding. This is the essential method.


getObject

Object getObject(Class type)
Returns the value for the binding after performing some basic checks.

Note: In release 4.0, the parameterName parameter was removed.

Parameters:
type - if not null, the value must be assignable to the specific class
Throws:
BindingException - if the value is not assignable to the specified type
Since:
0.2.9

isInvariant

boolean isInvariant()
Returns true if the value is invariant (not changing; the same value returned each time). Static and message bindings are always invariant, and ExpressionBindings may be marked invariant (as an optimization).

Since:
2.0.3

setObject

void setObject(Object value)
Updates the value of the binding, if possible.

Throws:
BindingException - If the binding is read only.

getDescription

String getDescription()
Returns a description of how the binding is used; this description is localized and incorporated into some exception messages.

Since:
4.0


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.