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

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


        TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
        FieldDeclaration[] fields = typeDeclaration.fields;
        if (fields != null) {
          done : for (int i = 0; i < fields.length; i++) {
            if (fields[i] instanceof Initializer) {
              Initializer initializer = (Initializer) fields[i];
              if (initializer.block.sourceStart <= astNode.sourceStart &&
                  astNode.sourceStart < initializer.bodyEnd) {
                // completion is inside an initializer
                searchVisibleVariablesAndMethods(scope, this.visibleLocalVariables, this.visibleFields, this.visibleMethods, notInJavadoc);
                break done;
View Full Code Here


                int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
                if (newLinesBeforeFirstClassBodyDeclaration > 0) {
                  this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
                }
              }
              Initializer initializer = (Initializer) member;
              initializer.traverse(this, null);
            } else {
              FieldDeclaration field = (FieldDeclaration) member;
              format(field, this, null, isChunkStart, i == 0);
            }
          } else if (member instanceof AbstractMethodDeclaration) {
View Full Code Here

                  int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
                  if (newLinesBeforeFirstClassBodyDeclaration > 0) {
                    this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
                  }
                }
                Initializer initializer = (Initializer) member;
                if (initializer.isStatic()) {
                  initializer.traverse(this, typeDeclaration.staticInitializerScope);
                } else {
                  initializer.traverse(this, typeDeclaration.initializerScope);
                }
              } else {
                FieldDeclaration field = (FieldDeclaration) member;
                if (field.isStatic()) {
                  format(field, this, typeDeclaration.staticInitializerScope, isChunkStart, i == 0);
View Full Code Here

  int mods = ClassFileConstants.AccDefault;
  if(parser().recoveredStaticInitializerStart != 0) {
    mods = ClassFileConstants.AccStatic;
  }
  return this.add(new Initializer(nestedBlockDeclaration, mods), bracketBalanceValue);
}
View Full Code Here

  // might be an initializer
  if (this.bracketBalance == 1){
    Block block = new Block(0);
    Parser parser = parser();
    block.sourceStart = parser.scanner.startPosition;
    Initializer init;
    if (parser.recoveredStaticInitializerStart == 0){
      init = new Initializer(block, ClassFileConstants.AccDefault);
    } else {
      init = new Initializer(block, ClassFileConstants.AccStatic);
      init.declarationSourceStart = parser.recoveredStaticInitializerStart;
    }
    init.bodyStart = parser.scanner.currentPosition;
    return this.add(init, 1);
  }
View Full Code Here

   * Convert an initializerinfo into a parsed initializer declaration
   */
  private Initializer convert(InitializerElementInfo initializerInfo, CompilationResult compilationResult) throws JavaModelException {

    Block block = new Block(0);
    Initializer initializer = new Initializer(block, ClassFileConstants.AccDefault);

    int start = initializerInfo.getDeclarationSourceStart();
    int end = initializerInfo.getDeclarationSourceEnd();

    initializer.sourceStart = initializer.declarationSourceStart = start;
View Full Code Here

   * Convert an initializerinfo into a parsed initializer declaration
   */
  private Initializer convert(InitializerElementInfo initializerInfo, CompilationResult compilationResult) throws JavaModelException {

    Block block = new Block(0);
    Initializer initializer = new Initializer(block, ClassFileConstants.AccDefault);

    int start = initializerInfo.getDeclarationSourceStart();
    int end = initializerInfo.getDeclarationSourceEnd();

    initializer.sourceStart = initializer.declarationSourceStart = start;
View Full Code Here

                int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
                if (newLinesBeforeFirstClassBodyDeclaration > 0) {
                  this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
                }
              }
              Initializer initializer = (Initializer) member;
              initializer.traverse(this, null);
            } else {
              FieldDeclaration field = (FieldDeclaration) member;
              format(field, this, null, isChunkStart, i == 0);
            }
          } else if (member instanceof AbstractMethodDeclaration) {
View Full Code Here

                  int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
                  if (newLinesBeforeFirstClassBodyDeclaration > 0) {
                    this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
                  }
                }
                Initializer initializer = (Initializer) member;
                if (initializer.isStatic()) {
                  initializer.traverse(this, typeDeclaration.staticInitializerScope);
                } else {
                  initializer.traverse(this, typeDeclaration.initializerScope);
                }
              } else {
                FieldDeclaration field = (FieldDeclaration) member;
                if (field.isStatic()) {
                  format(field, this, typeDeclaration.staticInitializerScope, isChunkStart, i == 0);
View Full Code Here

   * Convert an initializerinfo into a parsed initializer declaration
   */
  private Initializer convert(InitializerElementInfo initializerInfo, CompilationResult compilationResult) throws JavaModelException {

    Block block = new Block(0);
    Initializer initializer = new Initializer(block, ClassFileConstants.AccDefault);

    int start = initializerInfo.getDeclarationSourceStart();
    int end = initializerInfo.getDeclarationSourceEnd();

    initializer.sourceStart = initializer.declarationSourceStart = start;
View Full Code Here

TOP

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

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.