org.apache.tapestry5.internal.bindings
Class PropBinding

java.lang.Object
  extended by org.apache.tapestry5.ioc.BaseLocatable
      extended by org.apache.tapestry5.internal.bindings.AbstractBinding
          extended by org.apache.tapestry5.internal.bindings.PropBinding
All Implemented Interfaces:
Binding, InternalPropBinding, AnnotationProvider, Locatable

public class PropBinding
extends AbstractBinding
implements InternalPropBinding

Base class for bindings created by the PropBindingFactory. A subclass of this is created at runtime.


Constructor Summary
PropBinding(Location location, Object root, PropertyConduit conduit, String toString)
           
 
Method Summary
 Object get()
          The default implementation of get() will throw a TapestryException (binding is write only).
<T extends Annotation>
T
getAnnotation(Class<T> annotationClass)
          Always returns null.
 Class getBindingType()
          Returns the actual class, by invoking Binding.get().
 String getPropertyName()
          Returns the name of the property, if exists.
 boolean isInvariant()
          Almost always returns false, unless the conduit provides the Invariant annotation.
 void set(Object value)
          Updates the current value.
 String toString()
           
 
Methods inherited from class org.apache.tapestry5.ioc.BaseLocatable
getLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropBinding

public PropBinding(Location location,
                   Object root,
                   PropertyConduit conduit,
                   String toString)
Method Detail

get

public 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()).

Specified by:
get in interface Binding

set

public void set(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 interface Binding
Overrides:
set in class AbstractBinding

toString

public String toString()
Overrides:
toString in class Object

isInvariant

public boolean isInvariant()
Almost always returns false, unless the conduit provides the Invariant annotation.

Specified by:
isInvariant in interface Binding
Overrides:
isInvariant in class AbstractBinding

getBindingType

public Class getBindingType()
Description copied from class: AbstractBinding
Returns the actual class, by invoking Binding.get(). Subclasses may override this method to work more efficiently (say, when the binding type is known statically).

Specified by:
getBindingType in interface Binding
Overrides:
getBindingType in class AbstractBinding

getAnnotation

public <T extends Annotation> T getAnnotation(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 interface AnnotationProvider
Overrides:
getAnnotation in class AbstractBinding
Parameters:
annotationClass - used to select the annotation to return
Returns:
the annotation, or null if not found

getPropertyName

public String getPropertyName()
Description copied from interface: InternalPropBinding
Returns the name of the property, if exists.

Specified by:
getPropertyName in interface InternalPropBinding


Copyright © 2003-2012 The Apache Software Foundation.