Examples of MethodDeclaration


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

  /**
   * Recovery rule for when someone tries to use * or + in an ITD
   */
  private void consumeInterTypeFieldHeaderIllegallyAttemptingToUseATypePattern(String badToken) {
    consumeInterTypeFieldHeader(false); // make the best of what we did get
    MethodDeclaration errorNode = (MethodDeclaration) astStack[astPtr];
    problemReporter().parseErrorDeleteToken(errorNode.sourceStart -2// '+.'
                                        errorNode.sourceStart, 
                                        TokenNameIdentifier,
                                        badToken.toCharArray(),
                                        badToken);    
View Full Code Here

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

  /**
   * Recovery rule for when someone tries to use * or + in an ITD
   */
  private void consumeInterTypeConstructorHeaderNameIllegallyUsingTypePattern(String badToken) {
    consumeInterTypeConstructorHeaderName(false,false); // make the best of what we did get
    MethodDeclaration errorNode = (MethodDeclaration) astStack[astPtr];
    problemReporter().parseErrorDeleteToken(errorNode.sourceStart -2// '+.'
                                        errorNode.sourceStart, 
                                        TokenNameIdentifier,
                                        badToken.toCharArray(),
                                        badToken);      
View Full Code Here

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

  /**
   * Recovery rule for when someone tries to use * or + in an ITD
   */
  private void consumeInterTypeMethodHeaderNameIllegallyUsingTypePattern(String badToken) {
    consumeInterTypeMethodHeaderName(false,false); // make the best of what we did get
    MethodDeclaration errorNode = (MethodDeclaration) astStack[astPtr];
    problemReporter().parseErrorDeleteToken(errorNode.sourceStart -2// '+.'
                                        errorNode.sourceStart, 
                                        TokenNameIdentifier,
                                        badToken.toCharArray(),
                                        badToken);      
View Full Code Here

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

    AstUtil.addMethodDeclaration(typeDec, testMethod);
  }

  // XXX todo: make sure that errors in Arguments only get displayed once
  private MethodDeclaration makeMethod(CompilationResult result, MethodDeclaration enclosingDec) {
    MethodDeclaration ret = new IfMethodDeclaration(result, pointcut);
    ret.modifiers = ClassFileConstants.AccStatic | ClassFileConstants.AccFinal | ClassFileConstants.AccPublic;
    ret.returnType = AstUtil.makeTypeReference(TypeBinding.BOOLEAN);
    // create a more stable name 277508
    StringBuffer ifSelector = new StringBuffer();
    ifSelector.append("ajc$if$");
View Full Code Here

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

    // Use reset() rather than init()
    // XXX We need a scope to keep reset happy, initializerScope is *not* the right one, but it works !
    // codeStream.init(classFile);
    // codeStream.initializeMaxLocals(methodBinding);
    MethodDeclaration md = AstUtil.makeMethodDeclaration(methodBinding);
    md.scope = initializerScope;
    codeStream.reset(md, classFile);
    // body starts here
    gen.generate(codeStream);
    // body ends here
View Full Code Here

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

    UnresolvedType aspectTypeX = world.fromBinding(binding.declaringClass);
    UnresolvedType targetTypeX = world.fromBinding(onTypeBinding);

    ArrayBinding objectArrayBinding = scope.createArrayType(scope.getJavaLangObject(), 1);

    MethodDeclaration pre = new MethodDeclaration(compilationResult);
    pre.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
    pre.returnType = AstUtil.makeTypeReference(objectArrayBinding);
    pre.selector = NameMangler.postIntroducedConstructor(aspectTypeX, targetTypeX).toCharArray();

    pre.arguments = AstUtil.copyArguments(this.arguments);

    // XXX should do exceptions

    pre.scope = new MethodScope(scope, pre, true);
    // ??? do we need to do anything with scope???

    // Use the factory to build a semi-correct resolvedmember - then patch it up with
    // reset calls. This is SAFE
    ResolvedMemberImpl preIntroducedConstructorRM = world.makeResolvedMember(binding);
    preIntroducedConstructorRM.resetName(NameMangler.preIntroducedConstructor(aspectTypeX, targetTypeX));
    preIntroducedConstructorRM.resetModifiers(Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL);
    preIntroducedConstructorRM.resetReturnTypeToObjectArray();

    pre.binding = world.makeMethodBinding(preIntroducedConstructorRM);

    pre.bindArguments();
    pre.bindThrownExceptions();

    if (explicitConstructorCall == null) {
      pre.statements = new Statement[] {};
    } else {
      pre.statements = new Statement[] { explicitConstructorCall };
    }

    InterTypeScope newParent = new InterTypeScope(scope, onTypeBinding);
    pre.scope.parent = newParent;

    pre.resolveStatements(); // newParent);

    int nParams = pre.arguments.length;
    MethodBinding explicitConstructor = null;
    if (explicitConstructorCall != null) {
      explicitConstructor = explicitConstructorCall.binding;
View Full Code Here

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

  public static ReturnStatement makeReturnStatement(Expression expr) {
    return new ReturnStatement(expr, 0, 0);
  }

  public static MethodDeclaration makeMethodDeclaration(MethodBinding binding) {
    MethodDeclaration ret = new MethodDeclaration(null);
    ret.binding = binding;
    int nargs = binding.parameters.length;
    ret.arguments = new Argument[nargs];
    for (int i = 0; i < nargs; i++) {
      ret.arguments[i] = makeFinalArgument(("arg" + i).toCharArray(), binding.parameters[i]);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.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 */
      decl.returnType = createTypeReference(Signature.toString(method.getReturnType()).toCharArray());
      methodDeclaration = decl;
    }
    methodDeclaration.selector = method.getElementName().toCharArray();
View Full Code Here

Examples of org.directwebremoting.extend.MethodDeclaration

        Calls calls = new Calls();
        calls.addCall(call);

        // Which method are we using?
        call.findMethod(moduleManager, converterManager, inboundContext, 0);
        MethodDeclaration method = call.getMethodDeclaration();

        // Check this method is accessible
        accessControl.assertGeneralExecutionIsPossible(call.getScriptName(), method);

        // We are now sure we have the set of input lined up. They may
        // cross-reference so we do the de-referencing all in one go.
        try
        {
            inboundContext.dereference();
        }
        catch (ConversionException ex)
        {
            log.warn("Dereferencing exception", ex);
            throw new JsonpCallException("Error dereferencing call. See logs for more details.");
        }

        // Convert all the parameters to the correct types
        Object[] params = new Object[method.getParameterTypes().length];
        for (int j = 0; j < method.getParameterTypes().length; j++)
        {
            Class<?> paramType = method.getParameterTypes()[j];
            InboundVariable param = inboundContext.getParameter(0, j);
            Property property = new ParameterProperty(method, j);

            try
            {
View Full Code Here

Examples of org.eclipse.dltk.ast.declarations.MethodDeclaration

    return null;
  }

  public static String getNodeChildName(ASTNode node) {
    if (node instanceof MethodDeclaration) {
      MethodDeclaration method = (MethodDeclaration) node;
      String name = method.getName();
      if (name.indexOf("::") != -1) {
        return name.substring(name.lastIndexOf("::") + 2);
      }
      return name;
    } else if (node instanceof TypeDeclaration) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.