Package com.asakusafw.utils.java.model.syntax

Examples of com.asakusafw.utils.java.model.syntax.Expression


                .toLocalVariableDeclaration(t(List.class, t(StageInput.class)), list));
            statements.add(new ExpressionBuilder(factory, Models.toNullLiteral(factory))
                .toLocalVariableDeclaration(t(Map.class, t(String.class), t(String.class)), attributes));

            for (Process process : stage.getProcesses()) {
                Expression mapperType = dotClass(process.getMapperTypeName());
                for (Source source : process.getResolvedSources()) {
                    SourceInfo info = source.getInputInfo();
                    Class<?> inputFormatType = info.getFormat();
                    statements.add(new ExpressionBuilder(factory, attributes)
                        .assignFrom(new TypeBuilder(factory, t(HashMap.class, t(String.class), t(String.class)))
View Full Code Here


            List<Statement> statements = Lists.create();
            statements.add(new TypeBuilder(factory, t(ArrayList.class, t(StageOutput.class)))
                .newObject()
                .toLocalVariableDeclaration(t(List.class, t(StageOutput.class)), list));
            for (Delivery process : stage.getDeliveries()) {
                Expression valueType = factory.newClassLiteral(t(process.getDataType()));
                Class<?> outputFormatType = process.getOutputFormatType();
                for (Location location : process.getInputInfo().getLocations()) {
                    statements.add(new ExpressionBuilder(factory, list)
                        .method("add", new TypeBuilder(factory, t(StageOutput.class))
                            .newObject(
View Full Code Here

        private List<Statement> createStatements(SimpleName argument) {
            assert argument != null;
            List<Statement> results = Lists.create();

            LinePartProcessor.Context context = createPartConext(argument);
            Expression shuffleInput = preprocess(context, results);

            results.add(new ExpressionBuilder(factory, factory.newThis())
                .field(keyModel)
                .method(Naming.getShuffleKeySetter(segment.getPortId()),
                        shuffleInput)
View Full Code Here

        results.add(createBuildRightKey());
        return results;
    }

    private MethodDeclaration createGetCacheName() {
        Expression result = Models.toLiteral(factory, resource.getCacheName());
        return factory.newMethodDeclaration(
                null,
                new AttributeBuilder(factory)
                    .Protected()
                    .toAttributes(),
View Full Code Here

                Collections.singletonList(new ExpressionBuilder(factory, result)
                    .toReturnStatement()));
    }

    private MethodDeclaration createCreateValueObject() {
        Expression result = new TypeBuilder(factory, importer.toType(resource.getMasterDataClass().getType()))
            .newObject()
            .toExpression();
        return factory.newMethodDeclaration(
                null,
                new AttributeBuilder(factory)
View Full Code Here

         */
        public void addAttribute(Enum<? extends FlowElementAttribute> constant) {
            Precondition.checkMustNotBeNull(constant, "constant"); //$NON-NLS-1$
            ModelFactory f = context.environment.getFactory();
            ImportBuilder ib = context.importer;
            Expression attribute = new TypeBuilder(f, ib.toType(constant.getDeclaringClass()))
                .field(constant.name())
                .toExpression();
            addAttribute(attribute);
        }
View Full Code Here

                TypeMirror type = context.environment.getErasure(parameter.asType());
                parameterTypeLiterals.add(new TypeBuilder(f, ib.resolve(conv.convert(type)))
                    .dotClass()
                    .toExpression());
            }
            Expression attribute = new TypeBuilder(f, ib.toType(OperatorHelper.class))
                .newObject(new Expression[] {
                        // name
                        Models.toLiteral(f, helperMethod.getSimpleName().toString()),
                        // parameter types
                        new TypeBuilder(f, ib.toType(Arrays.class))
View Full Code Here

         * @return 対応する結果オブジェクト
         * @throws IllegalArgumentException 指定のポートを発見できない場合
         */
        public ResultMirror getOutput(FlowElementPortDescription port) {
            Precondition.checkMustNotBeNull(port, "port"); //$NON-NLS-1$
            Expression result = outputs.get(port);
            if (result == null) {
                throw new IllegalArgumentException();
            }
            return new ResultMirror(factory, result);
        }
View Full Code Here

public class ConvertFlowProcessor extends LineEndProcessor {

    @Override
    public void emitLineEnd(Context context) {
        ModelFactory f = context.getModelFactory();
        Expression input = context.getInput();
        Expression impl = context.createImplementation();
        OperatorDescription desc = context.getOperatorDescription();

        FlowElementPortDescription converted = context.getOutputPort(Convert.ID_OUTPUT_CONVERTED);
        FlowElementPortDescription original = context.getOutputPort(Convert.ID_OUTPUT_ORIGINAL);

        List<Expression> arguments = Lists.create();
        arguments.add(input);
        for (OperatorDescription.Parameter param : desc.getParameters()) {
            arguments.add(Models.toLiteral(f, param.getValue()));
        }
        Expression result = context.createLocalVariable(
                converted.getDataType(),
                new ExpressionBuilder(f, impl)
                    .method(desc.getDeclaration().getName(), arguments)
                    .toExpression());
View Full Code Here

        process.add(resultCache.createReset());
        Joined annotation = TypeUtil.erase(joinedPort.getDataType()).getAnnotation(Joined.class);
        Set<String> saw = Sets.create();
        for (Joined.Term term : annotation.terms()) {
            DataClass inputType = getEnvironment().getDataClasses().load(term.source());
            Expression input;
            if (term.source().equals(context.getInputPort(SideDataJoin.ID_INPUT_TRANSACTION).getDataType())) {
                input = context.getInput();
            } else {
                input = helper.getGetRawMasterExpression();
            }
View Full Code Here

TOP

Related Classes of com.asakusafw.utils.java.model.syntax.Expression

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.