Package org.apache.tapestry

Examples of org.apache.tapestry.BindingException


            } else
                _evaluator.write(_root, _accessor, value);
        }
        catch (Throwable ex)
        {
            throw new BindingException(ex.getMessage(), this, ex);
        }
    }
View Full Code Here


            displayName = field.getDisplayName();
        }

        if (displayName == null)
            throw new BindingException(
                Tapestry.format("FieldLabel.no-display-name", field.getExtendedId()),
                this,
                null,
                getBinding("field"),
                null);
View Full Code Here

        Field field;

        dotx = fieldName.lastIndexOf('.');

        if (dotx < 0)
            throw new BindingException(Tapestry.format("invalid-field-name", fieldName), this);

        // Hm. Should validate that there's a dot!

        className = fieldName.substring(0, dotx);
        simpleFieldName = fieldName.substring(dotx + 1);

        // Simple class names are assumed to be in the java.lang package.

        if (className.indexOf('.') < 0)
            className = "java.lang." + className;

        try
        {
            targetClass = resolver.findClass(className);
        }
        catch (Throwable t)
        {
            throw new BindingException(Tapestry.format("unable-to-resolve-class", className), this, t);
        }

        try
        {
            field = targetClass.getField(simpleFieldName);
        }
        catch (NoSuchFieldException ex)
        {
            throw new BindingException(Tapestry.format("field-not-defined", fieldName), this, ex);
        }

        // Get the value of the field.  null means look for it as a static
        // variable.

        try
        {
            value = field.get(null);
        }
        catch (IllegalAccessException ex)
        {
            throw new BindingException(Tapestry.format("illegal-field-acccess", fieldName), this, ex);
        }
        catch (NullPointerException ex)
        {
            throw new BindingException(Tapestry.format("field-is-instance", fieldName), this, ex);
        }

        // Don't look for it again, even if the value is itself null.

        accessed = true;
View Full Code Here

        return true;
    }

    public int getInt()
    {
        throw new BindingException(
            Tapestry.format("ListenerBinding.invalid-access", "getInt()"),
            this);
    }
View Full Code Here

            this);
    }

    public double getDouble()
    {
        throw new BindingException(
            Tapestry.format("ListenerBinding.invalid-access", "getDouble()"),
            this);

    }
View Full Code Here

        {
            return Ognl.getValue(_parsedExpression, getOgnlContext(), _root);
        }
        catch (Throwable t)
        {
            throw new BindingException(
                Tapestry.format(
                    "ExpressionBinding.unable-to-resolve-expression",
                    _expression,
                    _root),
                this,
View Full Code Here

        {
            _parsedExpression = OgnlUtils.getParsedExpression(_expression);
        }
        catch (Exception ex)
        {
            throw new BindingException(ex.getMessage(), this, ex);
        }

        if (checkForConstant())
            return;
View Full Code Here

                return true;
            }
        }
        catch (Exception ex)
        {
            throw new BindingException(
                Tapestry.format(
                    "ExpressionBinding.unable-to-resolve-expression",
                    _expression,
                    _root),
                this,
View Full Code Here

            if (!Ognl.isSimpleNavigationChain(_parsedExpression, getOgnlContext()))
                return;
        }
        catch (OgnlException ex)
        {
            throw new BindingException(
                Tapestry.format(
                    "ExpressionBinding.unable-to-resolve-expression",
                    _expression,
                    _root),
                this,
View Full Code Here

        {
            Ognl.setValue(_parsedExpression, getOgnlContext(), _root, value);
        }
        catch (Throwable ex)
        {
            throw new BindingException(
                Tapestry.format(
                    "ExpressionBinding.unable-to-update-expression",
                    _expression,
                    _root,
                    value),
View Full Code Here

TOP

Related Classes of org.apache.tapestry.BindingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.