Package org.adjective.syntactic.convert.j8to7

Examples of org.adjective.syntactic.convert.j8to7.Convert8To7Visitor


        {
            System.err.println("Output '" + expected.getAbsolutePath() + "' for '" + input + "' does not exist");
            return;
        }
        System.err.println("Running test: " + input);
        new Convert8To7Visitor().convert(ast);
        final ByteArrayOutputStream output = new ByteArrayOutputStream();
        new PrintSourceVisitor().print(ast, output);
        final byte[] read = IOUtil.read(new FileInputStream(expected));
        Assert.assertEquals(new String(read), new String(output.toByteArray()));
    }
View Full Code Here


            ASTClassOrInterfaceDeclaration local = _localTypes.get(qualifiedName);
            if (local == null)
            {
                return null;
            }
            return new ASTTypeInfo(local, parameters);
        }
        return new ClassInfo(cls, parameters);
    }
View Full Code Here

            {
                return null;
            }
            return new ASTTypeInfo(local, parameters);
        }
        return new ClassInfo(cls, parameters);
    }
View Full Code Here

        super(importer, classFinder);
    }

    public ExpressionNode convertLambda(final ASTLambdaExpression lambda, final JavaType forType)
    {
        final MethodInfo methodInfo = getFunctionalMethod(forType);
        final ASTMethodDeclaration astMethod = makeMethodDeclaration(methodInfo,
                                                                     lambda.getParameters(),
                                                                     lambda.getBody());
        return makeAnonymousInnerClass(forType, methodInfo, astMethod);
    }
View Full Code Here

        super(importer, classFinder);
    }

    public ExpressionNode convertReference(final ExpressionNode target, final ASTMemberReference reference, final JavaType forType)
    {
        final MethodInfo methodInfo = getFunctionalMethod(forType);
        final ASTMethodDeclaration astMethod = makeMethodDeclaration(methodInfo, target, reference);
        return makeAnonymousInnerClass(forType, methodInfo, astMethod);
    }
View Full Code Here

            return new ASTAllocationExpression(javaType, arguments, null);
        }
        else
        {
            final String methodName = reference.getName().getIdentifier();
            MethodInfo refMethod = refType.findMethod(methodName, arguments.getNumberOfArguments());
            if (refMethod != null && refMethod.getModifiers().is(ModifierSet.Modifier.STATIC))
            {
                return makeStaticMethodCall(javaType, refMethod, arguments);
            }
            if (arguments.getNumberOfArguments() > 0)
            {
View Full Code Here

    }

    protected TypeInfo getTypeInfo(final JavaType forType)
    {
        final String name = _importer.getQualifiedName(forType);
        final TypeInfo typeInfo = _classFinder.getClass(name, getTypeParameters(forType));
        if (typeInfo == null)
        {
            throw new ConversionException("Cannot find '" + name + "' in " + _classFinder);
        }
        return typeInfo;
View Full Code Here

        return new SimpleJavaType(name, type.getArrayDepth());
    }

    protected MethodInfo getFunctionalMethod(final JavaType forType)
    {
        final TypeInfo typeInfo = getTypeInfo(forType);
        return getFunctionalMethod(typeInfo);
    }
View Full Code Here

        String qualifiedName = _importer.getQualifiedName(name);
        if (qualifiedName == null)
        {
            qualifiedName = name;
        }
        final TypeInfo typeInfo = _classFinder.getClass(qualifiedName, new TypeParameter[0]);
        return typeInfo;
    }
View Full Code Here

        ExpressionNode expression = null;
        if (target instanceof ASTQualifiedIdentifier)
        {
            // Might be a class reference [static member ref, receiver member ref, or constructor ref]
            final TypeInfo refType = findType(target.as(ASTQualifiedIdentifier.class).getName());
            if (refType != null)
            {
                expression = makeMethodBody(method, refType, reference);
            }
        }
View Full Code Here

TOP

Related Classes of org.adjective.syntactic.convert.j8to7.Convert8To7Visitor

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.