Package org.eclipse.jdt.internal.compiler.codegen

Examples of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext


          int size = allTypeAnnotationContexts.size();
          if (size != 0) {
            AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
            allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
            for (int i = 0, max = allTypeAnnotationContextsArray.length; i < max; i++) {
              AnnotationContext annotationContext = allTypeAnnotationContextsArray[i];
              if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
                invisibleTypeAnnotationsCounter++;
                allTypeAnnotationContexts.add(annotationContext);
              } else {
                visibleTypeAnnotationsCounter++;
View Full Code Here


    int size = allTypeAnnotationContexts.size();
    if (size != 0) {
      AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
      allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
      for (int j = 0, max2 = allTypeAnnotationContextsArray.length; j < max2; j++) {
        AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
        if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
          invisibleTypeAnnotationsCounter++;
        } else {
          visibleTypeAnnotationsCounter++;
        }
View Full Code Here

      int size = allTypeAnnotationContexts.size();
      if (size != 0) {
        AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
        allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
        for (int j = 0, max2 = allTypeAnnotationContextsArray.length; j < max2; j++) {
          AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
          if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
            invisibleTypeAnnotationsCounter++;
          } else {
            visibleTypeAnnotationsCounter++;
          }
View Full Code Here

      this.contentsOffset += 2; // leave space for the annotations length

      int counter = 0;
      loop: for (int i = 0; i < length; i++) {
        if (invisibleTypeAnnotationsCounter == 0) break loop;
        AnnotationContext annotationContext = annotationContexts[i];
        if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
          int currentAnnotationOffset = this.contentsOffset;
          generateTypeAnnotation(annotationContext, currentAnnotationOffset);
          invisibleTypeAnnotationsCounter--;
          if (this.contentsOffset != currentAnnotationOffset) {
            counter++;
          }
        }
      }
      if (counter != 0) {
        this.contents[annotationsLengthOffset++] = (byte) (counter >> 8);
        this.contents[annotationsLengthOffset++] = (byte) counter;

        int attributeLength = this.contentsOffset - attributeLengthOffset - 4;
        this.contents[attributeLengthOffset++] = (byte) (attributeLength >> 24);
        this.contents[attributeLengthOffset++] = (byte) (attributeLength >> 16);
        this.contents[attributeLengthOffset++] = (byte) (attributeLength >> 8);
        this.contents[attributeLengthOffset++] = (byte) attributeLength;
        attributesNumber++;
      } else {
        this.contentsOffset = annotationAttributeOffset;
        // reset the constant pool to its state before the clinit
        this.constantPool.resetForAttributeName(AttributeNamesConstants.RuntimeInvisibleTypeAnnotationsName, constantPoolIndex, constantPOffset);
      }
    }

    annotationAttributeOffset = this.contentsOffset;
    constantPOffset = this.constantPool.currentOffset;
    constantPoolIndex = this.constantPool.currentIndex;
    if (visibleTypeAnnotationsCounter != 0) {
      if (this.contentsOffset + 10 >= this.contents.length) {
        resizeContents(10);
      }
      int runtimeVisibleAnnotationsAttributeNameIndex =
        this.constantPool.literalIndex(AttributeNamesConstants.RuntimeVisibleTypeAnnotationsName);
      this.contents[this.contentsOffset++] = (byte) (runtimeVisibleAnnotationsAttributeNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) runtimeVisibleAnnotationsAttributeNameIndex;
      int attributeLengthOffset = this.contentsOffset;
      this.contentsOffset += 4; // leave space for the attribute length

      int annotationsLengthOffset = this.contentsOffset;
      this.contentsOffset += 2; // leave space for the annotations length

      int counter = 0;
      loop: for (int i = 0; i < length; i++) {
        if (visibleTypeAnnotationsCounter == 0) break loop;
        AnnotationContext annotationContext = annotationContexts[i];
        if ((annotationContext.visibility & AnnotationContext.VISIBLE) != 0) {
          visibleTypeAnnotationsCounter--;
          int currentAnnotationOffset = this.contentsOffset;
          generateTypeAnnotation(annotationContext, currentAnnotationOffset);
          if (this.contentsOffset != currentAnnotationOffset) {
View Full Code Here

    int size = allTypeAnnotationContexts.size();
    if (size != 0) {
      AnnotationContext[] allTypeAnnotationContextsArray = new AnnotationContext[size];
      allTypeAnnotationContexts.toArray(allTypeAnnotationContextsArray);
      for (int j = 0, max = allTypeAnnotationContextsArray.length; j < max; j++) {
        AnnotationContext annotationContext = allTypeAnnotationContextsArray[j];
        if ((annotationContext.visibility & AnnotationContext.INVISIBLE) != 0) {
          invisibleTypeAnnotationsCounter++;
          allTypeAnnotationContexts.add(annotationContext);
        } else {
          visibleTypeAnnotationsCounter++;
View Full Code Here

    // of the dimensions.
    this.dimensions = dimensions;
  }
 
  private boolean internalVisit(Annotation annotation) {
    AnnotationContext annotationContext = null;
    if (annotation.isRuntimeTypeInvisible()) {
      annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, AnnotationContext.INVISIBLE);
    } else if (annotation.isRuntimeTypeVisible()) {
      annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, AnnotationContext.VISIBLE);
    }
    if (annotationContext != null) {
      annotationContext.wildcard = this.currentWildcard;
      switch(this.targetType) {
        case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER :
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.codegen.AnnotationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.