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

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration


    // if selecting a type for an anonymous type creation, we have to
    // find its target super constructor (if extending a class) or its target
    // super interface (if extending an interface)
    if (anonymousType.binding.superInterfaces == Binding.NO_SUPERINTERFACES) {
      // find the constructor binding inside the super constructor call
      ConstructorDeclaration constructor = (ConstructorDeclaration) anonymousType.declarationOf(binding.original());
      throw new SelectionNodeFound(constructor.constructorCall.binding);
    } else {
      // open on the only superinterface
      throw new SelectionNodeFound(anonymousType.binding.superInterfaces[0]);
    }
View Full Code Here


    }
    return internalFormatExpression(source, indentationLevel, lineSeparator, expression, offset, length);
  }

  private TextEdit formatStatements(String source, int indentationLevel, String lineSeparator, int offset, int length) {
    ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false);
   
    if (constructorDeclaration.statements == null) {
      // a problem occured while parsing the source
      return null;
    }
View Full Code Here

    if (bodyDeclarations != null) {
      return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, offset, length);
    }

    // probe for statements
    ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false);
    if (constructorDeclaration.statements != null) {
      return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, offset, length);
    }

    // this has to be a compilation unit
View Full Code Here

    if (this.sourceLength == -1) {
      this.sourceLength = this.rawSource.length;
    }
    switch(this.astKind) {
      case K_STATEMENTS :
        ConstructorDeclaration constructorDeclaration = codeSnippetParsingUtil.parseStatements(this.rawSource, this.sourceOffset, this.sourceLength, this.compilerOptions, true, this.statementsRecovery);
        RecoveryScannerData data = constructorDeclaration.compilationResult.recoveryScannerData;
        if(data != null) {
          Scanner scanner = converter.scanner;
          converter.scanner = new RecoveryScanner(scanner, data.removeUnused());
          converter.docParser.scanner = converter.scanner;
View Full Code Here

    if (block != null){
      methodDeclaration.statements = block.statements;

      /* first statement might be an explict constructor call destinated to a special slot */
      if (methodDeclaration.isConstructor()) {
        ConstructorDeclaration constructor = (ConstructorDeclaration)methodDeclaration;
        if (methodDeclaration.statements != null
          && methodDeclaration.statements[0] instanceof ExplicitConstructorCall){
          constructor.constructorCall = (ExplicitConstructorCall)methodDeclaration.statements[0];
          int length = methodDeclaration.statements.length;
          System.arraycopy(
View Full Code Here

  private static AbstractMethodDeclaration convert(IMethod method, IType type, CompilationResult compilationResult) throws JavaModelException {

    AbstractMethodDeclaration methodDeclaration;

    if (method.isConstructor()) {
      ConstructorDeclaration decl = new ConstructorDeclaration(compilationResult);
      decl.bits &= ~ASTNode.IsDefaultConstructor;
      methodDeclaration = decl;
    } else {
      MethodDeclaration decl = type.isAnnotation() ? new AnnotationMethodDeclaration(compilationResult) : new MethodDeclaration(compilationResult);
      /* convert return type */
 
View Full Code Here

        compilerOptions.defaultEncoding);

    final CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
    CompilationUnitDeclaration compilationUnitDeclaration = new CompilationUnitDeclaration(problemReporter, compilationResult, length);   

    ConstructorDeclaration constructorDeclaration = new ConstructorDeclaration(compilationResult);
    constructorDeclaration.sourceEnd  = -1;
    constructorDeclaration.declarationSourceEnd = offset + length - 1;
    constructorDeclaration.bodyStart = offset;
    constructorDeclaration.bodyEnd = offset + length - 1;
   
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration

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.