Class PropBinding
- java.lang.Object
-
- org.apache.tapestry5.ioc.BaseLocatable
-
- org.apache.tapestry5.internal.bindings.AbstractBinding
-
- org.apache.tapestry5.internal.bindings.PropBinding
-
- All Implemented Interfaces:
Binding
,Binding2
,AnnotationProvider
,Locatable
,InternalPropBinding
public class PropBinding extends AbstractBinding implements InternalPropBinding
Base class for bindings created by thePropBindingFactory
. A subclass of this is created at runtime.
-
-
Constructor Summary
Constructors Constructor Description PropBinding(Location location, java.lang.Object root, PropertyConduit conduit, java.lang.String expression, java.lang.String toString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get()
The default implementation of get() will throw a TapestryException (binding is write only).<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
Always returns null.java.lang.reflect.Type
getBindingGenericType()
Get the generic type from the underlying propertyjava.lang.Class
getBindingType()
Returns the actual class, by invokingBinding.get()
.java.lang.String
getExpression()
java.lang.String
getPropertyName()
Returns the name of the property, if exists.boolean
isInvariant()
Almost always returns false, unless the conduit provides theInvariant
annotation.void
set(java.lang.Object value)
Updates the current value.java.lang.String
toString()
-
Methods inherited from class org.apache.tapestry5.ioc.BaseLocatable
getLocation
-
-
-
-
Constructor Detail
-
PropBinding
public PropBinding(Location location, java.lang.Object root, PropertyConduit conduit, java.lang.String expression, java.lang.String toString)
-
-
Method Detail
-
get
public java.lang.Object get()
The default implementation of get() will throw a TapestryException (binding is write only). The fabricated subclass may override this method (as well as set()).
-
set
public void set(java.lang.Object value)
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
- Overrides:
set
in classAbstractBinding
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isInvariant
public boolean isInvariant()
Almost always returns false, unless the conduit provides theInvariant
annotation.- Specified by:
isInvariant
in interfaceBinding
- Overrides:
isInvariant
in classAbstractBinding
-
getBindingType
public java.lang.Class getBindingType()
Description copied from class:AbstractBinding
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
- Overrides:
getBindingType
in classAbstractBinding
-
getBindingGenericType
public java.lang.reflect.Type getBindingGenericType()
Get the generic type from the underlying property- Specified by:
getBindingGenericType
in interfaceBinding2
- Overrides:
getBindingGenericType
in classAbstractBinding
- See Also:
PropertyConduit2.getPropertyGenericType()
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
Description copied from class:AbstractBinding
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
- Overrides:
getAnnotation
in classAbstractBinding
- Parameters:
annotationClass
- used to select the annotation to return- Returns:
- the annotation, or null if not found
-
getPropertyName
public java.lang.String getPropertyName()
Description copied from interface:InternalPropBinding
Returns the name of the property, if exists.- Specified by:
getPropertyName
in interfaceInternalPropBinding
-
getExpression
public java.lang.String getExpression()
-
-