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

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


}
public int lastMemberEnd() {
  int lastMemberEnd = this.typeDeclaration.bodyStart;

  if (this.fieldCount > 0) {
    FieldDeclaration lastField = this.fields[this.fieldCount - 1].fieldDeclaration;
    if (lastMemberEnd < lastField.declarationSourceEnd && lastField.declarationSourceEnd != 0) {
      lastMemberEnd = lastField.declarationSourceEnd;
    }
  }
View Full Code Here


    char[] genericSignature = fieldBinding.genericSignature();
    if (genericSignature != null) {
      attributesNumber += generateSignatureAttribute(genericSignature);
    }
    if (this.targetJDK >= ClassFileConstants.JDK1_4) {
      FieldDeclaration fieldDeclaration = fieldBinding.sourceField();
      if (fieldDeclaration != null) {
        Annotation[] annotations = fieldDeclaration.annotations;
        if (annotations != null) {
          attributesNumber += generateRuntimeAnnotations(annotations);
        }
View Full Code Here

    this.contents[this.contentsOffset++] = (byte) (fieldCount >> 8);
    this.contents[this.contentsOffset++] = (byte) fieldCount;

    FieldDeclaration[] fieldDecls = currentBinding.scope.referenceContext.fields;
    for (int i = 0, max = fieldDecls == null ? 0 : fieldDecls.length; i < max; i++) {
      FieldDeclaration fieldDecl = fieldDecls[i];
      if (fieldDecl.binding != null) {
        addFieldInfo(fieldDecl.binding);
      }
    }
View Full Code Here

      FieldBinding originalField = original();
      if (originalField.declaringClass instanceof SourceTypeBinding) {
        SourceTypeBinding sourceType = (SourceTypeBinding) originalField.declaringClass;
        if (sourceType.scope != null) {
          TypeDeclaration typeDecl = sourceType.scope.referenceContext;
          FieldDeclaration fieldDecl = typeDecl.declarationOf(originalField);
          MethodScope initScope = originalField.isStatic() ? typeDecl.staticInitializerScope : typeDecl.initializerScope;
          boolean old = initScope.insideTypeAnnotation;
          try {
            initScope.insideTypeAnnotation = false;
            fieldDecl.resolve(initScope); //side effect on binding
          } finally {
            initScope.insideTypeAnnotation = old;
          }
          fieldConstant = originalField.constant == null ? Constant.NotAConstant : originalField.constant;
        } else {
View Full Code Here

    if (scope == null) { // synthetic fields do not have a scope nor any annotations
      this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
      return 0;
    }
    TypeDeclaration typeDecl = scope.referenceContext;
    FieldDeclaration fieldDecl = typeDecl.declarationOf(originalField);
    if (fieldDecl != null) {
      MethodScope initializationScope = isStatic() ? typeDecl.staticInitializerScope : typeDecl.initializerScope;
      FieldBinding previousField = initializationScope.initializedField;
      int previousFieldID = initializationScope.lastVisibleFieldID;
      try {
View Full Code Here

    this.superTypeNames[this.nestedTypeIndex++] = implicitSuperclassName;
  }
  while ((fieldIndex < fieldCounter)
      || (memberTypeIndex < memberTypeCounter)
      || (methodIndex < methodCounter)) {
    FieldDeclaration nextFieldDeclaration = null;
    AbstractMethodDeclaration nextMethodDeclaration = null;
    TypeDeclaration nextMemberDeclaration = null;
   
    int position = Integer.MAX_VALUE;
    int nextDeclarationType = -1;
View Full Code Here

    if ((existingField = getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      FieldDeclaration[] fieldDeclarations = typeDecl.fields;
      int max = fieldDeclarations == null ? 0 : fieldDeclarations.length;
      for (int i = 0; i < max; i++) {
        FieldDeclaration fieldDecl = fieldDeclarations[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_OUTER_LOCAL_PREFIX,
            actualOuterLocalVariable.name,
            ("$" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
View Full Code Here

    if ((existingField = getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      FieldDeclaration[] fieldDeclarations = typeDecl.fields;
      int max = fieldDeclarations == null ? 0 : fieldDeclarations.length;
      for (int i = 0; i < max; i++) {
        FieldDeclaration fieldDecl = fieldDeclarations[i];
        if (fieldDecl.binding == existingField) {
          if (this.scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_5) {
            synthField.name = CharOperation.concat(
              synthField.name,
              "$".toCharArray()); //$NON-NLS-1$
View Full Code Here

  if ((existingField = getField(synthField.name, true /*resolve*/)) != null) {
    TypeDeclaration typeDecl = blockScope.referenceType();
    FieldDeclaration[] typeDeclarationFields = typeDecl.fields;
    int max = typeDeclarationFields == null ? 0 : typeDeclarationFields.length;
    for (int i = 0; i < max; i++) {
      FieldDeclaration fieldDecl = typeDeclarationFields[i];
      if (fieldDecl.binding == existingField) {
        blockScope.problemReporter().duplicateFieldInType(this, fieldDecl);
        break;
      }
    }
View Full Code Here

    FieldBinding existingField;
    if ((existingField = getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      int max = (typeDecl.fields == null) ? 0 : typeDecl.fields.length;
      for (int i = 0; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_ASSERT_DISABLED,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here

TOP

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

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.