Example usage for org.eclipse.jdt.core.dom MemberValuePair VALUE_PROPERTY

List of usage examples for org.eclipse.jdt.core.dom MemberValuePair VALUE_PROPERTY

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom MemberValuePair VALUE_PROPERTY.

Prototype

ChildPropertyDescriptor VALUE_PROPERTY

To view the source code for org.eclipse.jdt.core.dom MemberValuePair VALUE_PROPERTY.

Click Source Link

Document

The "value" structural property of this node type (child type: Expression ).

Usage

From source file:org.moe.natjgen.EditContext.java

License:Apache License

protected void setNAField(Annotation annotation, int index, String key, Expression value)
        throws GeneratorException {
    editLock();/*from   w w w. j av a  2s.co m*/

    MemberValuePair mvp = getNAField(annotation, key);

    if (mvp == null) {
        mvp = getAST().newMemberValuePair();
        ListRewrite vlrw = getRewrite().getListRewrite(annotation, NormalAnnotation.VALUES_PROPERTY);
        vlrw.insertLast(mvp, getEditGroup());
        getRewrite().set(mvp, MemberValuePair.NAME_PROPERTY, getAST().newSimpleName(key), getEditGroup());
    }

    getRewrite().set(mvp, MemberValuePair.VALUE_PROPERTY, value, getEditGroup());
}

From source file:org.moe.natjgen.EditContext.java

License:Apache License

protected Expression getNAValue(Annotation annotation, String key) {
    MemberValuePair mvp = getNAField(annotation, key);
    if (mvp != null) {
        return (Expression) getRewrite().get(mvp, MemberValuePair.VALUE_PROPERTY);
    }/*from   ww w.ja  va2s  . c o  m*/
    return null;
}