Package groovy.lang

Examples of groovy.lang.MissingPropertyException


    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


    }

    @Override
    public void setProperty(String name, Object value) throws MissingPropertyException {
        if (!hasProperty(name)) {
            throw new MissingPropertyException(name, delegateType);
        }

        super.setProperty(name, value);
    }
View Full Code Here

    public Object get(String name) {
        boolean isAlreadyConfiguring = _configuring.get();
        _configuring.set(true);
        try {
            MissingPropertyException failure;
            try {
                return _delegate.getProperty(name);
            } catch (MissingPropertyException e) {
                if (!name.equals(e.getProperty())) {
                    throw e;
View Full Code Here

    public Object propertyMissing(String name) {
        if (getProject().getProperties().containsKey(name)) {
            return getProject().getProperties().get(name);
        }

        throw new MissingPropertyException(name, getClass());
    }
View Full Code Here

                DynamicObject 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(name)) {
                    dynamicObject.setProperty(name, value);
                    return;
                }
            }
            throw new MissingPropertyException(name, Convention.class);
        }
View Full Code Here

        return extensibleDynamicObject;
    }

    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,
                    dynamicDelegate.getDisplayName()));
        }
View Full Code Here

    public void propertyMissing(String name, Object value) {
        if (value instanceof Closure) {
            map(name, (Closure) value);
        } else {
            throw new MissingPropertyException(name, getClass());
        }
    }
View Full Code Here

        }
    }

    public NonTransformedModelDslBacking propertyMissing(String name) {
        if (!executingDsl.get()) {
            throw new MissingPropertyException(name, getClass());
        }
        return getChildPath(name);
    }
View Full Code Here

    if (isMethod(method, "methodMissing", String.class, Object.class)) {
      throw new MissingMethodException((String) normalizedArgs[0],
          mockConfiguration.getType(), new Object[] {normalizedArgs[1]}, false);
    }
    if (isMethod(method, "propertyMissing", String.class)) {
      throw new MissingPropertyException((String) normalizedArgs[0], mockConfiguration.getType());
    }

    IMockMethod mockMethod = new StaticMockMethod(method, mockConfiguration.getExactType());
    IMockInvocation invocation = new MockInvocation(mockObject, mockMethod, Arrays.asList(normalizedArgs), realMethodInvoker);
    IMockController controller = specification.getSpecificationContext().getMockController();
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.