Package groovy.lang

Examples of groovy.lang.MissingPropertyException


        if (value instanceof Closure) {
            map(name, (Closure) value);
        } else if (value instanceof ConventionValue) {
            map(name, (ConventionValue) value);
        } else {
            throw new MissingPropertyException(name, getClass());
        }
    }
View Full Code Here


            dynamicObject = new BeanDynamicObject(object);
            if (dynamicObject.hasProperty(name)) {
                return dynamicObject.getProperty(name);
            }
        }
        throw new MissingPropertyException(name, Convention.class);
    }
View Full Code Here

            if (dynamicObject.hasProperty(property)) {
                dynamicObject.setProperty(property, value);
                return;
            }
        }
        throw new MissingPropertyException(property, Convention.class);
    }
View Full Code Here

        return helper;
    }

    private class InheritedDynamicObject implements DynamicObject {
        public void setProperty(String name, Object value) {
            throw new MissingPropertyException(String.format("Could not find property '%s' inherited from %s.", name,
                    delegateObject.getDisplayName()));
        }
View Full Code Here

                synchronized (context) {
                    final int scope = context.getAttributesScope(name);
                    if (scope != -1) {
                        return context.getAttribute(name, scope);
                    }
                    throw new MissingPropertyException(name, getClass());
                }
            }

            @Override
            public void setVariable(final String name, final Object value) {
View Full Code Here

    private Object doGetProperty(String property) {
        Closure[] accessors = resolveExplicitProperty(property);
        if (accessors != null) {
            if (accessors[0] == null) {
                // write only property
                throw new MissingPropertyException(property + " is declared as write only");
            } else {
                return accessors[0].call();
            }
        } else {
            return super.getProperty(property);
View Full Code Here

    private void doSetProperty(String property, Object newValue) {
        Closure[] accessors = resolveExplicitProperty(property);
        if (accessors != null) {
            if (accessors[1] == null) {
                // read only property
                throw new MissingPropertyException(property + " is declared as read only");
            } else {
                accessors[1].call(newValue);
            }
        } else {
            super.setProperty(property, newValue);
View Full Code Here

    public static void checkPropNames(Object instance, Map<String, Object> args) {
        final MetaClass metaClass = InvokerHelper.getMetaClass(instance);
        for (String k : args.keySet()) {
            if (metaClass.hasProperty(instance, k) == null)
                throw new MissingPropertyException(k, instance.getClass());
        }
    }
View Full Code Here

                    int scope = ctx.getAttributesScope(name);
                    if (scope != -1) {
                        return ctx.getAttribute(name, scope);
                    }
                }
                throw new MissingPropertyException(name, getClass());
            }

            @Override
            public void setVariable(String name, Object value) {
                synchronized (ctx) {
View Full Code Here

            if (value != null)
                return value;
            // if property exists and value is null, return null
            if (result.containsKey(propertyUpper))
                return null;
            throw new MissingPropertyException(property, GroovyRowResult.class);
        }
        catch (Exception e) {
            throw new MissingPropertyException(property, GroovyRowResult.class, e);
        }
    }
View Full Code Here

TOP

Related Classes of groovy.lang.MissingPropertyException

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.