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

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


        private MethodDeclaration createRun() {
            List<Statement> loop = Lists.create();

            for (FlowBlock.Input input : unit.getInputs()) {
                Expression expr = fragments.getLine(input.getElementPort());
                loop.add(dataClass.assign(cache, new ExpressionBuilder(factory, context)
                    .method("getCurrentValue")
                    .toExpression()));
                loop.add(new ExpressionBuilder(factory, expr)
                    .method(FlowElementProcessor.RESULT_METHOD_NAME, cache)
View Full Code Here


            for (PropertyDeclaration property : model.getDeclaredProperties()) {
                HiveFieldTrait field = HiveFieldTrait.get(property);
                if (field.isColumnPresent() == false) {
                    continue;
                }
                Expression descriptor = createNewPropertyDescriptor(property);
                statements.add(new ExpressionBuilder(f, builder)
                    .method("property", descriptor) //$NON-NLS-1$
                    .toStatement());
            }
            statements.add(new ExpressionBuilder(f, f.newSimpleName(NAME_SINGLETON_FIELD))
View Full Code Here

                    new AttributeBuilder(f).Static().toAttributes(),
                    f.newBlock(statements));
        }

        private Expression createNewPropertyDescriptor(PropertyDeclaration property) {
            Expression columnName = Models.toLiteral(f, HiveFieldTrait.getColumnName(property));
            Expression typeDesc = computeValueType(property);
            Expression comment = null;
            AstDescription description = property.getDescription();
            if (description == null) {
                comment = Models.toNullLiteral(f);
            } else {
                comment = Models.toLiteral(f, description.getText());
View Full Code Here

        }

        private Statement createReaderStatement(PropertyDeclaration property) {
            assert property != null;
            SimpleName optionGetterName = context.getOptionGetterName(property);
            Expression option = new ExpressionBuilder(f, createModelParameterName())
                .method(optionGetterName)
                .toExpression();
            Statement fill = new ExpressionBuilder(f, createParserFieldName())
                .method("fill", option)
                .toStatement();
View Full Code Here

        }

        private Statement createWriterStatement(PropertyDeclaration property) {
            assert property != null;
            SimpleName optionGetterName = context.getOptionGetterName(property);
            Expression option = new ExpressionBuilder(f, createModelParameterName())
                .method(optionGetterName)
                .toExpression();
            Statement fill = new ExpressionBuilder(f, createEmitterFieldName())
                .method("emit", option)
                .toStatement();
View Full Code Here

        assert context != null;
        assert foldings != null;
        ModelFactory f = context.getModelFactory();
        List<Annotation> eachFolding = Lists.create();
        for (MappingFactor factor : foldings) {
            Expression aggregator = new TypeBuilder(f, context.resolve(Summarized.Aggregator.class))
                .field(convert(factor.getKind()).name())
                .toExpression();
            String source = context.getFieldName(factor.getSource().findDeclaration()).getToken();
            String target = context.getFieldName(factor.getTarget().findDeclaration()).getToken();
            eachFolding.addAll(new AttributeBuilder(f)
View Full Code Here

    private Statement createReaderStatement(ModelProperty property) {
        SimpleName optionGetterName = common.getOptionGetterNameOf(
                property.getName(),
                property.getType());

        Expression option = new ExpressionBuilder(f, createModelParameterName())
            .method(optionGetterName)
            .toExpression();

        Statement fill = new ExpressionBuilder(f, createParserFieldName())
            .method("fill", option)
View Full Code Here

    private Statement createWriterStatement(ModelProperty property) {
        SimpleName optionGetterName = common.getOptionGetterNameOf(
                property.getName(),
                property.getType());

        Expression option = new ExpressionBuilder(f, createModelParameterName())
            .method(optionGetterName)
            .toExpression();

        Statement fill = new ExpressionBuilder(f, createEmitterFieldName())
            .method("emit", option)
View Full Code Here

    private Statement createStartSummarizeFor(
            SimpleName parameterName,
            ModelProperty property) {
        Source source = property.getFrom();
        Expression to = f.newFieldAccessExpression(
                f.newThis(),
                common.getFieldNameOf(property.getName(), property.getType()));
        switch (source.getAggregator()) {
        case IDENT:
        case MAX:
View Full Code Here

    private Statement createAddSummarizeFor(
            String parameterName,
            ModelProperty property) {
        Source source = property.getFrom();
        Expression self = f.newFieldAccessExpression(
                f.newThis(),
                common.getFieldNameOf(property.getName(), property.getType()));
        Expression other = f.newFieldAccessExpression(
                f.newSimpleName(parameterName),
                common.getFieldNameOf(property.getName(), property.getType()));
        Aggregator aggregator = source.getAggregator();
        switch (aggregator) {
        case MAX:
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.