Package groovy.lang

Examples of groovy.lang.MissingPropertyException


     * @return Returns the matches.
     */
    @Override
    public String getMatches() {
        if (isNotValidStringType()) {
            throw new MissingPropertyException("Matches constraint only applies to a String property",
                    MATCHES_CONSTRAINT, owningClass);
        }
        MatchesConstraint c = (MatchesConstraint)appliedConstraints.get(MATCHES_CONSTRAINT);
        return c == null ? null : c.getRegex();
    }
View Full Code Here


    /**
     * @param regex The matches to set.
     */
    public void setMatches(String regex) {
        if (isNotValidStringType()) {
            throw new MissingPropertyException("Matches constraint can only be applied to a String property",
                    MATCHES_CONSTRAINT, owningClass);
        }

        Constraint c = appliedConstraints.get(MATCHES_CONSTRAINT);
        if (regex == null) {
View Full Code Here

     * @return Returns the url.
     */
    @Override
    public boolean isUrl() {
        if (isNotValidStringType()) {
            throw new MissingPropertyException("URL constraint can only be applied to a String property",
                    URL_CONSTRAINT, owningClass);
        }
        return appliedConstraints.containsKey(URL_CONSTRAINT);
    }
View Full Code Here

    /**
     * @param url The url to set.
     */
    public void setUrl(boolean url) {
        if (isNotValidStringType()) {
            throw new MissingPropertyException("URL constraint can only be applied to a String property",URL_CONSTRAINT,owningClass);
        }

        Constraint c = appliedConstraints.get(URL_CONSTRAINT);
        if (url) {
            if (c == null) {
View Full Code Here

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

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

* @author max
*/
class InitializingExpando extends Expando {
  public Object getProperty(String property) {
    Object result = super.getProperty(property);
    if (result == null) throw new MissingPropertyException(property, getClass());
    return result;
  }
View Full Code Here

            return this.version;
        }
        if(propertyName == "type"){
            return this.type;
        }
        throw new MissingPropertyException("No such property " + propertyName);
    }
View Full Code Here

            } else if(value instanceof String){
                this.type = EDEType.valueOf((String)value);
            }
            return;
        }
        throw new MissingPropertyException("No such property " + propertyName);
    }
View Full Code Here

    @Override
    public Object getVariable(String name) {
        Object result = context.get(name);
        if (result == null && !context.has(name)) {
            throw new MissingPropertyException(name, this.getClass());
        }
        return result;
    }
View Full Code Here

        try {
            Object key = lookupKeyIgnoringCase(property);
            if (key != null) {
                return result.get(key);
            }
            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.