Java 类groovy.lang.ReadOnlyPropertyException 实例源码

项目:pipeline-github    文件:CommitGroovyObject.java   
@Override
public void setProperty(final String property, final Object newValue) {
    if (property == null) {
        throw new MissingPropertyException("null", getClass());
    }
    switch (property) {
        case "sha":
        case "url":
        case "author":
        case "committer":
        case "parents":
        case "message":
        case "comment_count":
        case "comments":
        case "additions":
        case "deletions":
        case "total_changes":
        case "files":
        case "statuses":
            throw new ReadOnlyPropertyException(property, getClass());
        default:
            throw new MissingPropertyException(property, getClass());
    }
}
项目:pipeline-github    文件:CommitFileGroovyObject.java   
@Override
public void setProperty(final String property, final Object newValue) {
    if (property == null) {
        throw new MissingPropertyException("null", getClass());
    }

    switch (property) {
        case "sha":
        case "filename":
        case "status":
        case "patch":
        case "additions":
        case "deletions":
        case "changes":
        case "raw_url":
        case "blob_url":
            throw new ReadOnlyPropertyException(property, getClass());
        default:
            throw new MissingPropertyException(property, getClass());
    }
}
项目:pipeline-github    文件:IssueCommentGroovyObject.java   
@Override
public void setProperty(final String property, final Object newValue) {
    if (property == null) {
        throw new MissingPropertyException("null", getClass());
    }
    switch (property) {
        case "id":
        case "url":
        case "user":
        case "created_at":
        case "updated_at":
            throw new ReadOnlyPropertyException(property, getClass());

        case "body":
            setBody(newValue.toString());
            break;

        default:
            throw new MissingPropertyException(property, getClass());
    }
}
项目:pipeline-github    文件:CommitStatusGroovyObject.java   
@Override
public void setProperty(final String property, final Object newValue) {
    if (property == null) {
        throw new MissingPropertyException("null", getClass());
    }

    switch (property) {
        case "id":
        case "url":
        case "status":
        case "context":
        case "description":
        case "target_url":
        case "created_at":
        case "updated_at":
        case "creator":
            throw new ReadOnlyPropertyException(property, getClass());
        default:
            throw new MissingPropertyException(property, getClass());
    }
}
项目:pipeline-github    文件:ReviewCommentGroovyObject.java   
@Override
public void setProperty(final String property, final Object newValue) {
    if (property == null) {
        throw new MissingPropertyException("null", this.getClass());
    }

    switch (property) {
        case "id":
        case "url":
        case "user":
        case "created_at":
        case "updated_at":
        case "commit_id":
        case "original_commit_id":
        case "path":
        case "line":
        case "position":
        case "original_position":
        case "diff_hunk":
            throw new ReadOnlyPropertyException(property, getClass());

        case "body":
            Objects.requireNonNull(newValue, "body cannot be null");
            setBody(newValue.toString());
            break;

        default:
            throw new MissingPropertyException(property, this.getClass());
    }
}
项目:ADRApp    文件:GroovySupport.java   
/**
 * Overridden to enforce read-only access to the 'pseudo-variables'
 * corpora, docs, prs and apps.
 * @throws ReadOnlyPropertyException if an attempt is made to set
 *         any of these variables.
 */
public void setVariable(String name, Object value) {
  if("corpora".equals(name) || "docs".equals(name) || "prs".equals(name)
          || "apps".equals(name)) {
    throw new ReadOnlyPropertyException(name, this.getClass());
  }
  super.setVariable(name, value);
}
项目:GettinCRAFTy    文件:GroovySupport.java   
/**
 * Overridden to enforce read-only access to the 'pseudo-variables'
 * corpora, docs, prs and apps.
 * @throws ReadOnlyPropertyException if an attempt is made to set
 *         any of these variables.
 */
public void setVariable(String name, Object value) {
  if("corpora".equals(name) || "docs".equals(name) || "prs".equals(name)
          || "apps".equals(name)) {
    throw new ReadOnlyPropertyException(name, this.getClass());
  }
  super.setVariable(name, value);
}
项目:Reer    文件:DefaultExtraPropertiesExtension.java   
public void setProperty(String name, Object newValue) {
    if (name.equals("properties")) {
        throw new ReadOnlyPropertyException("name", ExtraPropertiesExtension.class);
    }
    set(name, newValue);
}
项目:pipeline-github    文件:PullRequestGroovyObject.java   
@Override
    public void setProperty(final String property, final Object newValue) {
        if (property == null) {
            throw new MissingPropertyException("null", this.getClass());
        }

        switch (property) {
            // writable properties
            case "state":
                Objects.requireNonNull(newValue, "state cannot be null");
                setState(newValue.toString());
                break;
            case "title":
                Objects.requireNonNull(newValue, "title cannot be null");
                setTitle(newValue.toString());
                break;
            case "body":
                Objects.requireNonNull(newValue, "body cannot be null");
                setBody(newValue.toString());
                break;
            case "base":
                Objects.requireNonNull(newValue, "base cannot be null");
                setBase(newValue.toString());
                break;
            case "locked":
                Objects.requireNonNull(newValue, "locked cannot be null");
                setLocked(Boolean.valueOf(newValue.toString()));
                break;
            case "labels":
                setLabels(newValue);
                break;
            case "milestone":
//                setMilestone(Integer.valueOf(newValue.toString()));
                break;
            case "maintainer_can_modify":
                Objects.requireNonNull(newValue, "maintainer_can_modify cannot be null");
                setMaintainerCanModify(Boolean.valueOf(newValue.toString()));
                break;

            // read only properties
            case "id":
            case "number":
            case "url":
            case "patch_url":
            case "diff_url":
            case "issue_url":

            case "head":

            case "files":
            case "assignees":
            case "commits":
            case "comments":
            case "review_comments":
            case "statuses":
            case "requested_reviewers":

            case "updated_at":
            case "created_at":
            case "created_by":
            case "closed_at":
            case "closed_by":
            case "merged_at":
            case "merged_by":

            case "commit_count":
            case "comment_count":
            case "additions":
            case "deletions":
            case "changed_files":
            case "merged":
            case "mergeable":
            case "merge_commit_sha":
                throw new ReadOnlyPropertyException(property, this.getClass());

            // unknown properties
            default:
                throw new MissingPropertyException(property, this.getClass());
        }
    }
项目:groovy    文件:ResultSetMetaDataWrapper.java   
@Override
public void setProperty(String property, Object newValue) {
    throw new ReadOnlyPropertyException(property, target.getClass());
}
项目:groovy    文件:BindingProxy.java   
public void setProperty(String property, Object value) {
    throw new ReadOnlyPropertyException(property, model.getClass());
}
项目:Pushjet-Android    文件:DefaultExtraPropertiesExtension.java   
public void setProperty(String name, Object newValue) {
    if (name.equals("properties")) {
        throw new ReadOnlyPropertyException("name", ExtraPropertiesExtension.class);
    }
    set(name, newValue);
}
项目:Pushjet-Android    文件:DefaultExtraPropertiesExtension.java   
public void setProperty(String name, Object newValue) {
    if (name.equals("properties")) {
        throw new ReadOnlyPropertyException("name", ExtraPropertiesExtension.class);
    }
    set(name, newValue);
}