src/share/classes/java/beans/Expression.java

Print this page




 130      * as the result of <code>getValue</code>. If the value property
 131      * was already set, either by a call to <code>setValue</code>
 132      * or a previous call to <code>getValue</code> then the value
 133      * property is returned without either looking up or calling the method.
 134      * <p>
 135      * The value property of an <code>Expression</code> is set to
 136      * a unique private (non-<code>null</code>) value by default and
 137      * this value is used as an internal indication that the method
 138      * has not yet been called. A return value of <code>null</code>
 139      * replaces this default value in the same way that any other value
 140      * would, ensuring that expressions are never evaluated more than once.
 141      * <p>
 142      * See the <code>excecute</code> method for details on how
 143      * methods are chosen using the dynamic types of the target
 144      * and arguments.
 145      *
 146      * @see Statement#execute
 147      * @see #setValue
 148      *
 149      * @return The result of applying this method to these arguments.


 150      */
 151     public Object getValue() throws Exception {
 152         if (value == unbound) {
 153             setValue(invoke());
 154         }
 155         return value;
 156     }
 157 
 158     /**
 159      * Sets the value of this expression to <code>value</code>.
 160      * This value will be returned by the getValue method
 161      * without calling the method associated with this
 162      * expression.
 163      *
 164      * @param value The value of this expression.
 165      *
 166      * @see #getValue
 167      */
 168     public void setValue(Object value) {
 169         this.value = value;


 130      * as the result of <code>getValue</code>. If the value property
 131      * was already set, either by a call to <code>setValue</code>
 132      * or a previous call to <code>getValue</code> then the value
 133      * property is returned without either looking up or calling the method.
 134      * <p>
 135      * The value property of an <code>Expression</code> is set to
 136      * a unique private (non-<code>null</code>) value by default and
 137      * this value is used as an internal indication that the method
 138      * has not yet been called. A return value of <code>null</code>
 139      * replaces this default value in the same way that any other value
 140      * would, ensuring that expressions are never evaluated more than once.
 141      * <p>
 142      * See the <code>excecute</code> method for details on how
 143      * methods are chosen using the dynamic types of the target
 144      * and arguments.
 145      *
 146      * @see Statement#execute
 147      * @see #setValue
 148      *
 149      * @return The result of applying this method to these arguments.
 150      * @throws Exception if the method with the specified methodName
 151      * throws an exception
 152      */
 153     public Object getValue() throws Exception {
 154         if (value == unbound) {
 155             setValue(invoke());
 156         }
 157         return value;
 158     }
 159 
 160     /**
 161      * Sets the value of this expression to <code>value</code>.
 162      * This value will be returned by the getValue method
 163      * without calling the method associated with this
 164      * expression.
 165      *
 166      * @param value The value of this expression.
 167      *
 168      * @see #getValue
 169      */
 170     public void setValue(Object value) {
 171         this.value = value;