Package org.codehaus.preon.el

Examples of org.codehaus.preon.el.BindingException


                return reference.resolve(context);
            } catch (BindingException rre) {
                // Let's try one more.
            }
        }
        throw new BindingException(
                "Failed to resolve reference for all options.");
    }
View Full Code Here


    public Reference<T> selectAttribute(String name) throws BindingException {
        return new PropertyReference<T>(this, type, name, this);
    }

    public Reference<T> selectItem(String index) throws BindingException {
        throw new BindingException("Items not supported.");
    }
View Full Code Here

        throw new BindingException("Items not supported.");
    }

    public Reference<T> selectItem(Expression<Integer, T> index)
            throws BindingException {
        throw new BindingException("Items not supported.");
    }
View Full Code Here

        this.context = context;
        try {
            field = type.getDeclaredField(name);
            field.setAccessible(true);
        } catch (SecurityException e) {
            throw new BindingException("Binding to " + name + " forbidden.");
        } catch (NoSuchFieldException e) {
            throw new BindingException("No field named " + name + ".");
        }
    }
View Full Code Here

    public Object resolve(Resolver context) {
        try {
            return field.get(reference.resolve(context));
        } catch (IllegalArgumentException e) {
            throw new BindingException("Cannot resolve " + field.getName()
                    + " on context.", e);
        } catch (IllegalAccessException e) {
            throw new BindingException("Access denied for field  "
                    + field.getName(), e);
        }
    }
View Full Code Here

        try {
            Expression<Integer, Resolver> expr = Expressions.createInteger(
                    context, index);
            return selectItem(expr);
        } catch (InvalidExpressionException e) {
            throw new BindingException("Invalid index.", e);
        }
    }
View Full Code Here

            return context.selectAttribute(name);
        }
    }

    public Reference<Resolver> selectItem(String expr) throws BindingException {
        throw new BindingException("No indexes supported.");
    }
View Full Code Here

        throw new BindingException("No indexes supported.");
    }

    public Reference<Resolver> selectItem(Expression<Integer, Resolver> expr)
            throws BindingException {
        throw new BindingException("No indexes supported.");
    }
View Full Code Here

                throws BindingException {
            Field fld = null;
            try {
                fld = imported.getField(name);
                if (fld == null || !Modifier.isStatic(fld.getModifiers())) {
                    throw new BindingException("Class "
                            + imported.getSimpleName()
                            + " does not define field " + name);
                } else {
                    fld.setAccessible(true);
                    return new StaticFieldReference(fld, context);
                }
            }
            catch (SecurityException e) {
                throw new BindingException("Not allowed to access "
                        + fld.getName());
            }
            catch (NoSuchFieldException e) {
                throw new BindingException("No attribute called " + name
                        + " defined.");
            }
        }
View Full Code Here

            }
        }

        public Reference<Resolver> selectItem(String expr)
                throws BindingException {
            throw new BindingException("No indexed values on class "
                    + imported.getSimpleName());
        }
View Full Code Here

TOP

Related Classes of org.codehaus.preon.el.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.