Java Code Examples for com.sun.tools.javac.code.Attribute#accept()

The following examples show how to use com.sun.tools.javac.code.Attribute#accept() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnnotationValueImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 2
Source File: AnnotationValueImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 3
Source File: AnnotationValueImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 4
Source File: AnnotationValueImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 5
Source File: AnnotationValueImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 6
Source File: AnnotationProxyMaker.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
Object getValue(Attribute attr) {
    Method method;              // runtime method of annotation element
    try {
        method = annoType.getMethod(meth.name.toString());
    } catch (NoSuchMethodException e) {
        return null;
    }
    returnClass = method.getReturnType();
    attr.accept(this);
    if (!(value instanceof ExceptionProxy) &&
        !AnnotationType.invocationHandlerReturnType(returnClass)
                                                .isInstance(value)) {
        typeMismatch(method, attr);
    }
    return value;
}
 
Example 7
Source File: AnnotationValueImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 8
Source File: AnnotationValueImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 9
Source File: AnnotationProxyMaker.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
Object getValue(Attribute attr) {
    Method method;              // runtime method of annotation element
    try {
        method = annoType.getMethod(meth.name.toString());
    } catch (NoSuchMethodException e) {
        return null;
    }
    returnClass = method.getReturnType();
    attr.accept(this);
    if (!(value instanceof ExceptionProxy) &&
        !AnnotationType.invocationHandlerReturnType(returnClass)
                                                .isInstance(value)) {
        typeMismatch(method, attr);
    }
    return value;
}
 
Example 10
Source File: AnnotationValueImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void visitArray(Attribute.Array a) {
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('{');

    boolean first = true;
    for (Attribute elem : a.values) {
        if (first) {
            first = false;
        } else {
            sb.append(", ");
        }
        elem.accept(this);
    }
    // Omit braces from singleton.
    if (a.values.length != 1) sb.append('}');
}
 
Example 11
Source File: ClassWriter.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void visitArray(Attribute.Array array) {
    databuf.appendByte('[');
    databuf.appendChar(array.values.length);
    for (Attribute a : array.values) {
        a.accept(this);
    }
}
 
Example 12
Source File: ClassReader.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
Attribute deproxy(Type t, Attribute a) {
    Type oldType = type;
    try {
        type = t;
        a.accept(this);
        return result;
    } finally {
        type = oldType;
    }
}
 
Example 13
Source File: DPrinter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 14
Source File: DPrinter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 15
Source File: DPrinter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 16
Source File: DPrinter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 17
Source File: DPrinter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 18
Source File: DPrinter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 19
Source File: DPrinter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}
 
Example 20
Source File: DPrinter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void printAttribute(String label, Attribute attr) {
    if (attr == null) {
        printNull(label);
    } else {
        printString(label, attr.getClass().getSimpleName());

        indent(+1);
        attr.accept(attrVisitor);
        indent(-1);
    }
}