Example usage for org.eclipse.jdt.internal.compiler.lookup TypeConstants UPPER_RUNTIME

List of usage examples for org.eclipse.jdt.internal.compiler.lookup TypeConstants UPPER_RUNTIME

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup TypeConstants UPPER_RUNTIME.

Prototype

null UPPER_RUNTIME

To view the source code for org.eclipse.jdt.internal.compiler.lookup TypeConstants UPPER_RUNTIME.

Click Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.ClassFileInfo.java

License:Open Source License

private IMemberValuePair[] getRetentionPolicy(long tagBits) {
    if ((tagBits & TagBits.AnnotationRetentionMASK) == 0)
        return Annotation.NO_MEMBER_VALUE_PAIRS;
    String retention = null;//from   w  w  w .  ja  v a 2s  . co  m
    if ((tagBits & TagBits.AnnotationRuntimeRetention) == TagBits.AnnotationRuntimeRetention) {
        // TagBits.AnnotationRuntimeRetention combines both TagBits.AnnotationClassRetention & TagBits.AnnotationSourceRetention
        retention = new String(
                CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY, '.')) + '.'
                + new String(TypeConstants.UPPER_RUNTIME);
    } else if ((tagBits & TagBits.AnnotationSourceRetention) != 0) {
        retention = new String(
                CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY, '.')) + '.'
                + new String(TypeConstants.UPPER_SOURCE);
    } else {
        retention = new String(
                CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY, '.')) + '.'
                + new String(TypeConstants.UPPER_CLASS);
    }
    final String value = retention;
    return new IMemberValuePair[] { new IMemberValuePair() {
        public int getValueKind() {
            return IMemberValuePair.K_QUALIFIED_NAME;
        }

        public Object getValue() {
            return value;
        }

        public String getMemberName() {
            return new String(TypeConstants.VALUE);
        }
    } };
}

From source file:com.codenvy.ide.ext.java.server.internal.core.search.indexing.BinaryIndexer.java

License:Open Source License

private void addBinaryRetentionAnnotation(long bits) {
    char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_RETENTIONPOLICY;
    addTypeReference(compoundName[compoundName.length - 1]);
    if ((bits & TagBits.AnnotationRuntimeRetention) == TagBits.AnnotationRuntimeRetention) {
        addFieldReference(TypeConstants.UPPER_RUNTIME);
    } else if ((bits & TagBits.AnnotationClassRetention) != 0) {
        addFieldReference(TypeConstants.UPPER_CLASS);
    } else if ((bits & TagBits.AnnotationSourceRetention) != 0) {
        addFieldReference(TypeConstants.UPPER_SOURCE);
    }// w w  w.  j  av  a 2 s.  c  o m
}