Class BindingSourceImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.services.BindingSourceImpl
-
- All Implemented Interfaces:
BindingSource
public class BindingSourceImpl extends java.lang.Object implements BindingSource
-
-
Constructor Summary
Constructors Constructor Description BindingSourceImpl(java.util.Map<java.lang.String,BindingFactory> factories, StringInterner interner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Binding
newBinding(java.lang.String description, ComponentResources container, java.lang.String defaultPrefix, java.lang.String expression)
A simpler version ofBindingSource.newBinding(String, ComponentResources, ComponentResources, String, String, Location)
that defaults the values for several parameters.Binding
newBinding(java.lang.String description, ComponentResources container, ComponentResources component, java.lang.String defaultPrefix, java.lang.String expression, Location location)
Examines the expression and strips off the leading prefix.
-
-
-
Constructor Detail
-
BindingSourceImpl
public BindingSourceImpl(java.util.Map<java.lang.String,BindingFactory> factories, StringInterner interner)
-
-
Method Detail
-
newBinding
public Binding newBinding(java.lang.String description, ComponentResources container, java.lang.String defaultPrefix, java.lang.String expression)
Description copied from interface:BindingSource
A simpler version ofBindingSource.newBinding(String, ComponentResources, ComponentResources, String, String, Location)
that defaults the values for several parameters. This is used in most cases. The default binding prefix will be "prop". Most often, this is used to create a new default binding.- Specified by:
newBinding
in interfaceBindingSource
- Parameters:
description
- description of the binding, such as "parameter foo"container
- typically, the parent of the component. This value will be used as the container and the component, so whatever type of expression is evaluated, will be evaulated in terms of this componentdefaultPrefix
- the default prefix used when the expression itself does not have a prefixexpression
- the binding- Returns:
- a binding
-
newBinding
public Binding newBinding(java.lang.String description, ComponentResources container, ComponentResources component, java.lang.String defaultPrefix, java.lang.String expression, Location location)
Description copied from interface:BindingSource
Examines the expression and strips off the leading prefix. The prefix is used to choose the appropriateBindingFactory
, which receives the description, the expression (after the prefix), and the location. If the prefix doesn't exist, or if there's no prefix, then the factory for the default prefix (often "literal") is used (and passed the full prefix). The binding represents a connection between the container and the component (the component is usually the child of the container, though in a few cases, it is the component itself). In most cases, the expression is evaluated in terms of the resources of the container and the component is ignored.- Specified by:
newBinding
in interfaceBindingSource
- Parameters:
description
- description of the binding, such as "parameter foo"container
- typically, the parent of the componentcomponent
- the component whose parameter is to be bounddefaultPrefix
- the default prefix used when the expression itself does not have a prefixexpression
- the bindinglocation
- location assigned to the binding (or null if not known)- Returns:
- a binding
-
-