Examples of ClassNode


Examples of org.apache.tapestry5.internal.plastic.asm.tree.ClassNode

        isVoid = description.returnType.equals("void");

        invocationClassName = String.format("%s$Invocation_%s_%s", plasticClass.className, description.methodName,
                PlasticUtils.nextUID());

        invocationClassNode = new ClassNode();

        invocationClassNode.visit(org.apache.tapestry5.internal.plastic.asm.Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL, plasticClass.nameCache.toInternalName(invocationClassName),
                null, PlasticClassImpl.ABSTRACT_METHOD_INVOCATION_INTERNAL_NAME, new String[]
                {plasticClass.nameCache.toInternalName(MethodInvocation.class)});
View Full Code Here

Examples of org.codehaus.enunciate.asm.tree.ClassNode

   * @param bytecode The bytecode.
   * @return The package-info file.
   */
  public String write(InputStream bytecode) throws IOException {
    org.codehaus.enunciate.asm.ClassReader cr = new org.codehaus.enunciate.asm.ClassReader(bytecode);
    ClassNode cn = new org.codehaus.enunciate.asm.tree.ClassNode();
    cr.accept(cn, 0);
    if (cn.visibleAnnotations != null && !cn.visibleAnnotations.isEmpty()) {
      StringWriter writer = new StringWriter();
      boolean jaxbFound = false;
      for (Object visibleAnnotation : cn.visibleAnnotations) {
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

            if (!isVisible(source, importedClass.getClassName())) {
                iter.remove();
            }
        }

        ClassNode scriptClass = getScriptClass(source);

        // Remove all the classes other than the main class
        Iterator<ClassNode> classes = source.getAST().getClasses().iterator();
        while (classes.hasNext()) {
            ClassNode classNode = classes.next();
            if (classNode != scriptClass) {
                classes.remove();
            }
        }
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

        return Phases.CONVERSION;
    }

    @Override
    public void call(SourceUnit source) throws CompilationFailedException {
        ClassNode scriptClass = getScriptClass(source);
        if (scriptClass == null) {
            return;
        }
        for (MethodNode methodNode : scriptClass.getMethods()) {
            if (methodNode.getName().equals("main")) {
                removeMethod(scriptClass, methodNode);
                break;
            }
        }
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

        // we operate on GroovyObject if possible
        Expression objectExpression = call.getObjectExpression();
        // message name
        Expression messageName = new CastExpression(ClassHelper.STRING_TYPE, call.getMethod());
        if (useSuper) {
            ClassNode classNode = controller.isInClosure() ? controller.getOutermostClass() : controller.getClassNode(); // GROOVY-4035
            ClassNode superClass = classNode.getSuperClass();
            makeCall(call, new ClassExpression(superClass),
                    objectExpression, messageName,
                    call.getArguments(), adapter,
                    call.isSafe(), call.isSpreadSafe(),
                    false
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

            Expression origin,
            Expression receiver, Expression message, Expression arguments,
            MethodCallerMultiAdapter adapter,
            boolean safe, boolean spreadSafe, boolean implicitThis
    ) {
        ClassNode cn = controller.getClassNode();
        if (controller.isInClosure() && !implicitThis && AsmClassGenerator.isThisExpression(receiver)) cn=cn.getOuterClass();
        makeCall(origin, new ClassExpression(cn), receiver, message, arguments,
                adapter, safe, spreadSafe, implicitThis);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

        }

        String owner = BytecodeHelper.getClassInternalName(target.getDeclaringClass());
        String desc = BytecodeHelper.getMethodDescriptor(target.getReturnType(), target.getParameters());
        mv.visitMethodInsn(opcode, owner, methodName, desc);
        ClassNode ret = target.getReturnType().redirect();
        if (ret==ClassHelper.VOID_TYPE) {
            ret = ClassHelper.OBJECT_TYPE;
            mv.visitInsn(ACONST_NULL);
        }
        argumentsToRemove += args.getExpressions().size();
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

    private boolean isClosureCall(MethodCallExpression call) {
        // are we a local variable?
        // it should not be an explicitly "this" qualified method call
        // and the current class should have a possible method
        ClassNode classNode = controller.getClassNode();
        String methodName = call.getMethodAsString();
        if (methodName==null) return false;
        if (!call.isImplicitThis()) return false;
        if (!AsmClassGenerator.isThisExpression(call.getObjectExpression())) return false;
        FieldNode field = classNode.getDeclaredField(methodName);
        if (field == null) return false;
        if (isStaticInvocation(call) && !field.isStatic()) return false;
        Expression arguments = call.getArguments();
        return ! classNode.hasPossibleMethod(methodName, arguments);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode

        unit.parse( );
        unit.nextPhase();
        unit.convert( );
        ModuleNode module = unit.getAST( );

        ClassNode classNode = ( ClassNode ) module.getClasses( ).get( 0 );
        List methods = classNode.getDeclaredMethods( "run" );
        MethodNode method = ( MethodNode ) methods.get( 0 );
        ASTNode expr = method.getCode( );

        GroovyExprVisitor visitor = new GroovyExprVisitor( );
        expr.visit( visitor );
View Full Code Here

Examples of org.deuce.objectweb.asm.tree.ClassNode

        final ClassReader cr,
        final ClassLoader loader,
        final boolean dump,
        final PrintWriter pw)
    {
        ClassNode cn = new ClassNode();
        cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG);

        Type syperType = cn.superName == null
                ? null
                : Type.getObjectType(cn.superName);
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.