org.apache.tapestry5.internal
Interface ParameterAccess

All Superinterfaces:
AnnotationProvider

public interface ParameterAccess
extends AnnotationProvider

A wrapper around a named parameter provided by InternalComponentResources. The parameter may be bound or unbound.

Since:
5.0.19

Method Summary
 Class getBoundType()
          Returns the actual type of the bound parameter, or null if the parameter is not bound.
 boolean isBound()
          Is the parameter bound?
 boolean isInvariant()
          Returns true if the binding is bound, and the binding is invariant.
<T> T
read(Class<T> expectedType)
          Reads the value of a parameter, via the parameter's Binding.
 Object read(String desiredTypeName)
          Reads the current value of the parameter via the parameter's Binding.
<T> void
write(T parameterValue)
          Updates the parameter to a new value.
 
Methods inherited from interface org.apache.tapestry5.ioc.AnnotationProvider
getAnnotation
 

Method Detail

isBound

boolean isBound()
Is the parameter bound?

Returns:
true if bound

read

Object read(String desiredTypeName)
Reads the current value of the parameter via the parameter's Binding. This method is intended for use from generated code (where it is easier to specify the type as a name than a Class instance).

Parameters:
desiredTypeName - the fully qualified name of the Java type to coerce the result to
Returns:
the value of the parameter, or null if not bound
Throws:
NullPointerException - if the parameter's value is null and null is not allowed

read

<T> T read(Class<T> expectedType)
Reads the value of a parameter, via the parameter's Binding.

Type Parameters:
T -
Parameters:
expectedType - the expected type of parameter
Returns:
the value for the parameter, or null if the parameter is not bound.

write

<T> void write(T parameterValue)
Updates the parameter to a new value. If the parameter is not bound, this method does nothing.

Type Parameters:
T -
Parameters:
parameterValue - new value for parameter

isInvariant

boolean isInvariant()
Returns true if the binding is bound, and the binding is invariant.

Returns:
true if invariant
See Also:
Binding.isInvariant()

getBoundType

Class getBoundType()
Returns the actual type of the bound parameter, or null if the parameter is not bound. This is primarily used with property bindings, and is used to determine the actual type of the property, rather than the type of parameter (remember that type coercion automatically occurs, which can mask significant differences between the parameter type and the bound property type).

Returns:
the type of the bound parameter, or null if the parameter is not bound
See Also:
Binding.getBindingType()


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