Search in sources :

Example 1 with IMemberValuePair

use of org.eclipse.jdt.core.IMemberValuePair in project che by eclipse.

the class SourcesFromBytecodeGenerator method appendAnnotationLabel.

public void appendAnnotationLabel(IAnnotation annotation, long flags, StringBuilder builder) throws JavaModelException {
    builder.append('@');
    appendTypeSignatureLabel(annotation, Signature.createTypeSignature(annotation.getElementName(), false), flags, builder);
    IMemberValuePair[] memberValuePairs = annotation.getMemberValuePairs();
    if (memberValuePairs.length == 0)
        return;
    builder.append('(');
    for (int i = 0; i < memberValuePairs.length; i++) {
        if (i > 0)
            builder.append(JavaElementLabels.COMMA_STRING);
        IMemberValuePair memberValuePair = memberValuePairs[i];
        builder.append(getMemberName(annotation, annotation.getElementName(), memberValuePair.getMemberName()));
        builder.append('=');
        appendAnnotationValue(annotation, memberValuePair.getValue(), memberValuePair.getValueKind(), flags, builder);
    }
    builder.append(')');
}
Also used : IMemberValuePair(org.eclipse.jdt.core.IMemberValuePair)

Example 2 with IMemberValuePair

use of org.eclipse.jdt.core.IMemberValuePair in project che by eclipse.

the class StubCreator method appendAnnotation.

private void appendAnnotation(IAnnotation annotation) throws JavaModelException {
    String name = annotation.getElementName();
    if (//$NON-NLS-1$
    !fStubInvisible && name.startsWith("sun."))
        // skip Sun-internal annotations 
        return;
    fBuffer.append('@');
    fBuffer.append(name);
    fBuffer.append('(');
    IMemberValuePair[] memberValuePairs = annotation.getMemberValuePairs();
    for (IMemberValuePair pair : memberValuePairs) {
        fBuffer.append(pair.getMemberName());
        fBuffer.append('=');
        appendAnnotationValue(pair.getValue(), pair.getValueKind());
        fBuffer.append(',');
    }
    if (memberValuePairs.length > 0)
        fBuffer.deleteCharAt(fBuffer.length() - 1);
    fBuffer.append(')').append('\n');
}
Also used : IMemberValuePair(org.eclipse.jdt.core.IMemberValuePair)

Example 3 with IMemberValuePair

use of org.eclipse.jdt.core.IMemberValuePair in project che by eclipse.

the class JavaElementLabelComposer method appendAnnotationLabel.

public void appendAnnotationLabel(IAnnotation annotation, long flags) throws JavaModelException {
    fBuffer.append('@');
    appendTypeSignatureLabel(annotation, Signature.createTypeSignature(annotation.getElementName(), false), flags);
    IMemberValuePair[] memberValuePairs = annotation.getMemberValuePairs();
    if (memberValuePairs.length == 0)
        return;
    fBuffer.append('(');
    for (int i = 0; i < memberValuePairs.length; i++) {
        if (i > 0)
            fBuffer.append(JavaElementLabels.COMMA_STRING);
        IMemberValuePair memberValuePair = memberValuePairs[i];
        fBuffer.append(getMemberName(annotation, annotation.getElementName(), memberValuePair.getMemberName()));
        fBuffer.append('=');
        appendAnnotationValue(annotation, memberValuePair.getValue(), memberValuePair.getValueKind(), flags);
    }
    fBuffer.append(')');
}
Also used : IMemberValuePair(org.eclipse.jdt.core.IMemberValuePair)

Aggregations

IMemberValuePair (org.eclipse.jdt.core.IMemberValuePair)3