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

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


        currentMethod = ctor;
        currentMethodBody = (JMethodBody) ctor.getBody();
        currentMethodScope = x.scope;

        JMethodCall superOrThisCall = null;
        ExplicitConstructorCall ctorCall = x.constructorCall;
        if (ctorCall != null) {
          superOrThisCall = (JMethodCall) dispatch("processExpression",
              ctorCall);
        }

        /*
         * Determine if we have an explicit this call. The presence of an
         * explicit this call indicates we can skip certain initialization steps
         * (as the callee will perform those steps for us). These skippable
         * steps are 1) assigning synthetic args to fields and 2) running
         * initializers.
         */
        boolean hasExplicitThis = (ctorCall != null)
            && !ctorCall.isSuperAccess();

        JClassType enclosingType = (JClassType) ctor.getEnclosingType();

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = enclosingType.getMethods().get(0);
View Full Code Here


        currentMethod = ctor;
        currentMethodBody = (JMethodBody) ctor.getBody();
        currentMethodScope = x.scope;

        JMethodCall superOrThisCall = null;
        ExplicitConstructorCall ctorCall = x.constructorCall;
        if (ctorCall != null) {
          superOrThisCall = (JMethodCall) dispatch("processExpression",
              ctorCall);
        }

        /*
         * Determine if we have an explicit this call. The presence of an
         * explicit this call indicates we can skip certain initialization steps
         * (as the callee will perform those steps for us). These skippable
         * steps are 1) assigning synthetic args to fields and 2) running
         * initializers.
         */
        boolean hasExplicitThis = (ctorCall != null)
            && !ctorCall.isSuperAccess();

        JClassType enclosingType = (JClassType) ctor.getEnclosingType();

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = enclosingType.getMethods().get(0);
View Full Code Here

   * @see BindingResolver#resolveConstructor(ConstructorInvocation)
   */
  synchronized IMethodBinding resolveConstructor(ConstructorInvocation expression) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
    if (node instanceof ExplicitConstructorCall) {
      ExplicitConstructorCall explicitConstructorCall = (ExplicitConstructorCall) node;
      return getMethodBinding(explicitConstructorCall.binding);
    }
    return null;
  }
View Full Code Here

   * @see BindingResolver#resolveConstructor(SuperConstructorInvocation)
   */
  synchronized IMethodBinding resolveConstructor(SuperConstructorInvocation expression) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
    if (node instanceof ExplicitConstructorCall) {
      ExplicitConstructorCall explicitConstructorCall = (ExplicitConstructorCall) node;
      return getMethodBinding(explicitConstructorCall.binding);
    }
    return null;
  }
View Full Code Here

      return null;
    }

    this.lastLocalDeclarationSourceStart = -1;
    try {
      ExplicitConstructorCall explicitConstructorCall = constructorDeclaration.constructorCall;
      if (explicitConstructorCall != null && !explicitConstructorCall.isImplicitSuper()) {
        explicitConstructorCall.traverse(this, null);
      }
      Statement[] statements = constructorDeclaration.statements;
      if (statements != null) {
        formatStatements(null, statements, false);
      }
View Full Code Here

  }

  if (methodDeclaration.isDefaultConstructor()) {
    if (reportReferenceInfo) {
      ConstructorDeclaration constructorDeclaration = (ConstructorDeclaration) methodDeclaration;
      ExplicitConstructorCall constructorCall = constructorDeclaration.constructorCall;
      if (constructorCall != null) {
        switch(constructorCall.accessMode) {
          case ExplicitConstructorCall.This :
            requestor.acceptConstructorReference(
              typeNames[nestedTypeIndex-1],
              constructorCall.arguments == null ? 0 : constructorCall.arguments.length,
              constructorCall.sourceStart);
            break;
          case ExplicitConstructorCall.Super :
          case ExplicitConstructorCall.ImplicitSuper :         
            requestor.acceptConstructorReference(
              superTypeNames[nestedTypeIndex-1],
              constructorCall.arguments == null ? 0 : constructorCall.arguments.length,
              constructorCall.sourceStart);
            break;
        }
      }
    } 
    return
 
  char[][] argumentTypes = null;
  char[][] argumentNames = null;
  boolean isVarArgs = false;
  Argument[] arguments = methodDeclaration.arguments;
  if (arguments != null) {
    char[][][] argumentTypesAndNames = this.getArguments(arguments);
    argumentTypes = argumentTypesAndNames[0];
    argumentNames = argumentTypesAndNames[1];
   
    isVarArgs = arguments[arguments.length-1].isVarArgs();
  }
  char[][] thrownExceptionTypes = getThrownExceptions(methodDeclaration);
  // by default no selector end position
  int selectorSourceEnd = -1;
  if (methodDeclaration.isConstructor()) {
    selectorSourceEnd = this.sourceEnds.get(methodDeclaration);
    if (isInRange){
      int currentModifiers = methodDeclaration.modifiers;
      if (isVarArgs)
        currentModifiers |= ClassFileConstants.AccVarargs;
     
      // remember deprecation so as to not lose it below
      boolean deprecated = (currentModifiers & ClassFileConstants.AccDeprecated) != 0 || hasDeprecatedAnnotation(methodDeclaration.annotations);
     
      ISourceElementRequestor.MethodInfo methodInfo = new ISourceElementRequestor.MethodInfo();
      methodInfo.isConstructor = true;
      methodInfo.declarationStart = methodDeclaration.declarationSourceStart;
      methodInfo.modifiers = deprecated ? (currentModifiers & ExtraCompilerModifiers.AccJustFlag) | ClassFileConstants.AccDeprecated : currentModifiers & ExtraCompilerModifiers.AccJustFlag;
      methodInfo.name = methodDeclaration.selector;
      methodInfo.nameSourceStart = methodDeclaration.sourceStart;
      methodInfo.nameSourceEnd = selectorSourceEnd;
      methodInfo.parameterTypes = argumentTypes;
      methodInfo.parameterNames = argumentNames;
      methodInfo.exceptionTypes = thrownExceptionTypes;
      methodInfo.typeParameters = getTypeParameterInfos(methodDeclaration.typeParameters());
      methodInfo.categories = (char[][]) this.nodesToCategories.get(methodDeclaration);
      methodInfo.annotations = methodDeclaration.annotations;
      methodInfo.node = methodDeclaration;
      requestor.enterConstructor(methodInfo);
    }
    if (reportReferenceInfo) {
      ConstructorDeclaration constructorDeclaration = (ConstructorDeclaration) methodDeclaration;
      ExplicitConstructorCall constructorCall = constructorDeclaration.constructorCall;
      if (constructorCall != null) {
        switch(constructorCall.accessMode) {
          case ExplicitConstructorCall.This :
            requestor.acceptConstructorReference(
              typeNames[nestedTypeIndex-1],
View Full Code Here

        currentMethod = ctor;
        currentMethodScope = x.scope;

        JMethodCall superOrThisCall = null;
        ExplicitConstructorCall ctorCall = x.constructorCall;
        if (ctorCall != null) {
          superOrThisCall = (JMethodCall) dispatch("processExpression",
              ctorCall);
        }

        /*
         * Determine if we have an explicit this call. The presence of an
         * explicit this call indicates we can skip certain initialization steps
         * (as the callee will perform those steps for us). These skippable
         * steps are 1) assigning synthetic args to fields and 2) running
         * initializers.
         */
        boolean hasExplicitThis = (ctorCall != null)
            && !ctorCall.isSuperAccess();

        JClassType enclosingType = (JClassType) ctor.getEnclosingType();

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = (JMethod) enclosingType.methods.get(0);
View Full Code Here

        currentMethod = ctor;
        currentMethodBody = (JMethodBody) ctor.getBody();
        currentMethodScope = x.scope;

        JMethodCall superOrThisCall = null;
        ExplicitConstructorCall ctorCall = x.constructorCall;
        if (ctorCall != null) {
          superOrThisCall = (JMethodCall) dispatch("processExpression",
              ctorCall);
        }

        /*
         * Determine if we have an explicit this call. The presence of an
         * explicit this call indicates we can skip certain initialization steps
         * (as the callee will perform those steps for us). These skippable
         * steps are 1) assigning synthetic args to fields and 2) running
         * initializers.
         */
        boolean hasExplicitThis = (ctorCall != null)
            && !ctorCall.isSuperAccess();

        JClassType enclosingType = (JClassType) ctor.getEnclosingType();

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = enclosingType.methods.get(0);
View Full Code Here

   * @see BindingResolver#resolveConstructor(ConstructorInvocation)
   */
  synchronized IMethodBinding resolveConstructor(ConstructorInvocation expression) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
    if (node instanceof ExplicitConstructorCall) {
      ExplicitConstructorCall explicitConstructorCall = (ExplicitConstructorCall) node;
      return getMethodBinding(explicitConstructorCall.binding);
    }
    return null;
  }
View Full Code Here

   * @see BindingResolver#resolveConstructor(SuperConstructorInvocation)
   */
  synchronized IMethodBinding resolveConstructor(SuperConstructorInvocation expression) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
    if (node instanceof ExplicitConstructorCall) {
      ExplicitConstructorCall explicitConstructorCall = (ExplicitConstructorCall) node;
      return getMethodBinding(explicitConstructorCall.binding);
    }
    return null;
  }
View Full Code Here

TOP

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

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.