com.primix.tapestry.binding
Class FieldBinding

java.lang.Object
  |
  +--com.primix.tapestry.binding.AbstractBinding
        |
        +--com.primix.tapestry.binding.FieldBinding
All Implemented Interfaces:
IBinding

public class FieldBinding
extends AbstractBinding

A type of static IBinding that gets it value from a public field (static class variable) of some class or interface.

The binding uses a field name, which consists of a fully qualified class name and a static field of that class seperated by a dot. For example: com.foobar.SomeClass.SOME_FIELD.

If the class specified is for the java.lang package, then the package may be ommitted. This allows Boolean.TRUE to be recognized as a valid value.

The PageSource maintains a cache of FieldBindings. This means that each field will be represented by a single binding ... that means that for any field, the accessValue() method (which obtains the value for the field using reflection) will only be invoked once.

Version:
$Id: FieldBinding.java,v 1.8 2001/08/23 20:19:32 hship Exp $
Author:
Howard Ship

Constructor Summary
FieldBinding(IResourceResolver resolver, java.lang.String fieldName)
           
 
Method Summary
 java.lang.Object getObject()
          Returns the value of the Binding.
 java.lang.Class getType()
          Returns the class of the object, or null if the field evaluates to null (a rare case).
 java.lang.String toString()
           
 
Methods inherited from class com.primix.tapestry.binding.AbstractBinding
getBoolean, getDouble, getInt, getObject, getString, isStatic, setBoolean, setDouble, setInt, setObject, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldBinding

public FieldBinding(IResourceResolver resolver,
                    java.lang.String fieldName)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getObject

public java.lang.Object getObject()
Description copied from interface: IBinding
Returns the value of the Binding. This is the essential method. Other methods get this value and cast or coerce the value.

getType

public java.lang.Class getType()
Returns the class of the object, or null if the field evaluates to null (a rare case).
Since:
1.0.5