Class AbstractBinding
java.lang.Object
org.apache.tapestry5.ioc.BaseLocatable
org.apache.tapestry5.internal.bindings.AbstractBinding
- All Implemented Interfaces:
Binding
,Binding2
,AnnotationProvider
,Locatable
- Direct Known Subclasses:
AssetBinding
,AttributeExpansionBinding
,BlockBinding
,ComponentBinding
,InvariantBinding
,LiteralBinding
,PropBinding
,RenderVariableBinding
Abstract base class for bindings. Assumes that the binding is read only and invariant. Subclasses must provide an
implementation of
Binding.get()
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Annotation>
TgetAnnotation
(Class<T> annotationClass) Always returns null.Passes straight through togetBindingType()
.Returns the actual class, by invokingBinding.get()
.boolean
Returns true.void
Updates the current value.Methods inherited from class org.apache.tapestry5.ioc.BaseLocatable
getLocation
-
Constructor Details
-
AbstractBinding
public AbstractBinding() -
AbstractBinding
-
-
Method Details
-
set
Description copied from interface:Binding
Updates the current value. Most types of bindings are read-only, and this method will throw a runtime exception. It is the caller's responsibility to ensure that the value passed in is of the appropriate type.- Specified by:
set
in interfaceBinding
- Throws:
TapestryException
- always
-
isInvariant
Returns true. Subclasses that do not supply a fixed, read-only value should override this method to return false.- Specified by:
isInvariant
in interfaceBinding
-
getBindingType
Returns the actual class, by invokingBinding.get()
. Subclasses may override this method to work more efficiently (say, when the binding type is known statically).- Specified by:
getBindingType
in interfaceBinding
-
getBindingGenericType
Passes straight through togetBindingType()
. Subclasses may override this method to return the generic type if it is available- Specified by:
getBindingGenericType
in interfaceBinding2
- See Also:
-
getAnnotation
Always returns null. Bindings that provide access to a method or field will override this method to return the appropriate annotation.- Specified by:
getAnnotation
in interfaceAnnotationProvider
- Parameters:
annotationClass
- used to select the annotation to return- Returns:
- the annotation, or null if not found
-