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

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


    }

    // propagate generation of (problem) member types
    if (typeDeclaration.memberTypes != null) {
      for (int i = 0, max = typeDeclaration.memberTypes.length; i < max; i++) {
        TypeDeclaration memberType = typeDeclaration.memberTypes[i];
        if (memberType.binding != null) {
          ClassFile.createProblemType(memberType, unitResult);
        }
      }
    }
View Full Code Here


        && !this.referenceBinding.isMemberType()) {
      // add enclosing method attribute (1.5 mode only)
      attributesNumber += generateEnclosingMethodAttribute();
    }
    if (this.targetJDK >= ClassFileConstants.JDK1_4) {
      TypeDeclaration typeDeclaration = this.referenceBinding.scope.referenceContext;
      if (typeDeclaration != null) {
        final Annotation[] annotations = typeDeclaration.annotations;
        if (annotations != null) {
          long targetMask;
          if (typeDeclaration.isPackageInfo())
            targetMask = TagBits.AnnotationForPackage;
          else if (this.referenceBinding.isAnnotationType())
            targetMask = TagBits.AnnotationForType | TagBits.AnnotationForAnnotationType;
          else
            targetMask = TagBits.AnnotationForType | TagBits.AnnotationForTypeUse;
View Full Code Here

          this.constantPool.literalIndex(
            ((StringConstant) fieldConstant).stringValue());
        if (stringValueIndex == -1) {
          if (!this.creatingProblemType) {
            // report an error and abort: will lead to a problem type classfile creation
            TypeDeclaration typeDeclaration = this.referenceBinding.scope.referenceContext;
            FieldDeclaration[] fieldDecls = typeDeclaration.fields;
            int max = fieldDecls == null ? 0 : fieldDecls.length;
            for (int i = 0; i < max; i++) {
              if (fieldDecls[i].binding == fieldBinding) {
                // problem should abort
View Full Code Here

        int stringValueIndex =
          this.constantPool.literalIndex(((StringConstant) constant).stringValue().toCharArray());
        if (stringValueIndex == -1) {
          if (!this.creatingProblemType) {
            // report an error and abort: will lead to a problem type classfile creation
            TypeDeclaration typeDeclaration = this.referenceBinding.scope.referenceContext;
            typeDeclaration.scope.problemReporter().stringConstantIsExceedingUtf8Limit(defaultValue);
          } else {
            // already inside a problem type creation : no attribute
            this.contentsOffset = attributeOffset;
          }
View Full Code Here

   *
   * @param methodDeclarations Array of all missing abstract methods
   */
  public void generateMissingAbstractMethods(MethodDeclaration[] methodDeclarations, CompilationResult compilationResult) {
    if (methodDeclarations != null) {
      TypeDeclaration currentDeclaration = this.referenceBinding.scope.referenceContext;
      int typeDeclarationSourceStart = currentDeclaration.sourceStart();
      int typeDeclarationSourceEnd = currentDeclaration.sourceEnd();
      for (int i = 0, max = methodDeclarations.length; i < max; i++) {
        MethodDeclaration methodDeclaration = methodDeclarations[i];
        MethodBinding methodBinding = methodDeclaration.binding;
         String readableName = new String(methodBinding.readableName());
         CategorizedProblem[] problems = compilationResult.problems;
View Full Code Here

    dumpLocations(locations);
    generateAnnotation(annotation, currentOffset);
  }

  private int generateTypeAnnotationAttributeForTypeDeclaration() {
    TypeDeclaration typeDeclaration = this.referenceBinding.scope.referenceContext;
    if ((typeDeclaration.bits & ASTNode.HasTypeAnnotations) == 0) {
      return 0;
    }
    int attributesNumber = 0;
    int visibleTypeAnnotationsCounter = 0;
View Full Code Here

public void generateSyntheticBodyForEnumInitializationMethod(SyntheticMethodBinding methodBinding) {
  // no local used
  this.maxLocals = 0;
  // generate all enum constants
  SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) methodBinding.declaringClass;
  TypeDeclaration typeDeclaration = sourceTypeBinding.scope.referenceContext;
  BlockScope staticInitializerScope = typeDeclaration.staticInitializerScope;
  FieldDeclaration[] fieldDeclarations = typeDeclaration.fields;
  for (int i = methodBinding.startIndex, max = methodBinding.endIndex; i < max; i++) {
    FieldDeclaration fieldDecl = fieldDeclarations[i];
    if (fieldDecl.isStatic()) {
View Full Code Here

  while ((fieldIndex < fieldCounter)
      || (memberTypeIndex < memberTypeCounter)
      || (methodIndex < methodCounter)) {
    FieldDeclaration nextFieldDeclaration = null;
    AbstractMethodDeclaration nextMethodDeclaration = null;
    TypeDeclaration nextMemberDeclaration = null;

    int position = Integer.MAX_VALUE;
    int nextDeclarationType = -1;
    if (fieldIndex < fieldCounter) {
      nextFieldDeclaration = fields[fieldIndex];
View Full Code Here

public long getAnnotationTagBits() {
  MethodBinding originalMethod = original();
  if ((originalMethod.tagBits & TagBits.AnnotationResolved) == 0 && originalMethod.declaringClass instanceof SourceTypeBinding) {
    ClassScope scope = ((SourceTypeBinding) originalMethod.declaringClass).scope;
    if (scope != null) {
      TypeDeclaration typeDecl = scope.referenceContext;
      AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(originalMethod);
      if (methodDecl != null)
        ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod);
      CompilerOptions options = scope.compilerOptions();
      if (options.isAnnotationBasedNullAnalysisEnabled) {
        boolean isJdk18 = options.sourceLevel >= ClassFileConstants.JDK1_8;
View Full Code Here

  while ((fieldIndex < fieldCounter)
      || (memberTypeIndex < memberTypeCounter)
      || (methodIndex < methodCounter)) {
    FieldDeclaration nextFieldDeclaration = null;
    AbstractMethodDeclaration nextMethodDeclaration = null;
    TypeDeclaration nextMemberDeclaration = null;

    int position = Integer.MAX_VALUE;
    int nextDeclarationType = -1;
    if (fieldIndex < fieldCounter) {
      nextFieldDeclaration = fields[fieldIndex];
View Full Code Here

TOP

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

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.