Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation


      } else {
        this.contents[this.contentsOffset++] = 0;
        this.contents[this.contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      this.contents[this.contentsOffset++] = 0;
      this.contents[this.contentsOffset++] = 1;
      if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = this.constantPool.literalIndex(VALUE);
      this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        this.contentsOffset = startingContentsOffset;
      } else {
        try {
          generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, startingContentsOffset);
View Full Code Here


    LocalDeclaration localDeclaration = new LocalDeclaration(null, 0, 0);
    localDeclaration.type = createMockBinaryTypeReference(binaryTypeBinding);
    methodDeclaration.statements = new Statement[] {localDeclaration};

    SingleMemberAnnotation annotation = new SingleMemberAnnotation(
        createMockBinaryTypeReference(binaryTypeBinding), 0);
    annotation.memberValue = annotation.type;
    typeDeclaration.annotations = new Annotation[] {annotation};

    typeDeclaration.methods = new AbstractMethodDeclaration[] {methodDeclaration};
View Full Code Here

      } else {
        this.contents[this.contentsOffset++] = 0;
        this.contents[this.contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      this.contents[this.contentsOffset++] = 0;
      this.contents[this.contentsOffset++] = 1;
      if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = this.constantPool.literalIndex(VALUE);
      this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        this.contentsOffset = startingContentsOffset;
      } else {
        int memberValuePairOffset = this.contentsOffset;
        try {
View Full Code Here

      } else {
        this.contents[this.contentsOffset++] = 0;
        this.contents[this.contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      this.contents[this.contentsOffset++] = 0;
      this.contents[this.contentsOffset++] = 1;
      if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = this.constantPool.literalIndex(VALUE);
      this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        this.contentsOffset = startingContentsOffset;
      } else {
        try {
          generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, startingContentsOffset);
View Full Code Here

      } else {
        this.contents[this.contentsOffset++] = 0;
        this.contents[this.contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      this.contents[this.contentsOffset++] = 0;
      this.contents[this.contentsOffset++] = 1;
      if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = this.constantPool.literalIndex(VALUE);
      this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        this.contentsOffset = startingContentsOffset;
      } else {
        try {
          generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, startingContentsOffset);
View Full Code Here

      } else {
        this.contents[this.contentsOffset++] = 0;
        this.contents[this.contentsOffset++] = 0;
      }
    } else if (annotation instanceof SingleMemberAnnotation) {
      SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
      // this is a single member annotation (one member value)
      this.contents[this.contentsOffset++] = 0;
      this.contents[this.contentsOffset++] = 1;
      if (this.contentsOffset + 2 >= this.contents.length) {
        resizeContents(2);
      }
      final int elementNameIndex = this.constantPool.literalIndex(VALUE);
      this.contents[this.contentsOffset++] = (byte) (elementNameIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) elementNameIndex;
      MethodBinding methodBinding = singleMemberAnnotation.memberValuePairs()[0].binding;
      if (methodBinding == null) {
        this.contentsOffset = startingContentsOffset;
      } else {
        try {
          generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, startingContentsOffset);
View Full Code Here

  pushOnAstStack(new AssertStatement(this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--]));
}
protected void consumeSingleMemberAnnotation(boolean isTypeAnnotation) {
  // SingleMemberTypeAnnotation ::= TypeAnnotationName '(' SingleMemberAnnotationMemberValue ')'
  // SingleMemberAnnotation ::= AnnotationName '(' SingleMemberAnnotationMemberValue ')'
  SingleMemberAnnotation singleMemberAnnotation = null;

  int oldIndex = this.identifierPtr;

  TypeReference typeReference = getAnnotationType();
  singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]);
  singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--];
  this.expressionLengthPtr--;
  singleMemberAnnotation.declarationSourceEnd = this.rParenPos;
 
  if (isTypeAnnotation) {
View Full Code Here

          break;
        case SINGLE_MEMBER:
          if (parser.expressionPtr > -1) {
            Expression memberValue = parser.expressionStack[parser.expressionPtr--];

            SingleMemberAnnotation singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.sourceStart);
            singleMemberAnnotation.memberValue = memberValue;
            singleMemberAnnotation.declarationSourceEnd = memberValue.sourceEnd;
            singleMemberAnnotation.bits |= ASTNode.IsRecovered;

            annot = singleMemberAnnotation;
View Full Code Here

  if ((index = this.indexOfAssistIdentifier()) < 0) {
    super.consumeSingleMemberAnnotation(isTypeAnnotation);
    return;
  }

  SingleMemberAnnotation singleMemberAnnotation = null;
  int length = this.identifierLengthStack[this.identifierLengthPtr];
  TypeReference typeReference;

  /* retrieve identifiers subset and whole positions, the assist node positions
    should include the entire replaced source. */

  char[][] subset = identifierSubSet(index);
  this.identifierLengthPtr--;
  this.identifierPtr -= length;
  long[] positions = new long[length];
  System.arraycopy(
    this.identifierPositionStack,
    this.identifierPtr + 1,
    positions,
    0,
    length);

  /* build specific assist on type reference */

  if (index == 0) {
    /* assist inside first identifier */
    typeReference = createSingleAssistTypeReference(
            assistIdentifier(),
            positions[0]);
  } else {
    /* assist inside subsequent identifier */
    typeReference =  createQualifiedAssistTypeReference(
            subset,
            assistIdentifier(),
            positions);
  }
  this.assistNode = typeReference;
  this.lastCheckPoint = typeReference.sourceEnd + 1;

  singleMemberAnnotation = new SingleMemberAnnotation(typeReference, this.intStack[this.intPtr--]);
  singleMemberAnnotation.memberValue = this.expressionStack[this.expressionPtr--];
  this.expressionLengthPtr--;
  singleMemberAnnotation.declarationSourceEnd = this.rParenPos;
  if (isTypeAnnotation) {
    pushOnTypeAnnotationStack(singleMemberAnnotation);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation

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.