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

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


        }
        return compiler.getClassLoader();
    }

    private List<VolatileJavaFile> emit(DmdlSourceRepository source) throws IOException {
        ModelFactory factory = Models.getModelFactory();
        VolatileEmitter emitter = new VolatileEmitter();
        com.asakusafw.dmdl.java.Configuration conf = new com.asakusafw.dmdl.java.Configuration(
                factory,
                source,
                Models.toName(factory, "com.example"),
View Full Code Here


        }
        return compiler.getClassLoader();
    }

    private List<VolatileJavaFile> emit(DmdlSourceRepository source) throws IOException {
        ModelFactory factory = Models.getModelFactory();
        VolatileEmitter emitter = new VolatileEmitter();
        com.asakusafw.dmdl.java.Configuration conf = new com.asakusafw.dmdl.java.Configuration(
                factory,
                source,
                Models.toName(factory, "com.example"),
View Full Code Here

    }

    @Override
    protected List<? extends TypeBodyDeclaration> override(Context context) {
        ImplementationBuilder builder = new ImplementationBuilder(context);
        ModelFactory f = context.environment.getFactory();
        builder.addStatement(new TypeBuilder(f, context.importer.toType(UnsupportedOperationException.class))
            .newObject(Models.toLiteral(f, "重複検出演算子は組み込みの方法で処理されます"))
            .toThrowStatement());
        return builder.toImplementation();
    }
View Full Code Here

        return new SourceInfo(locations, TemporaryInputFormat.class);
    }

    @Override
    public List<ExternalIoStage> emitPrologue(IoContext context) throws IOException {
        ModelFactory f = getEnvironment().getModelFactory();
        return Arrays.asList(new ExternalIoStage(getId(), new CompiledStage(
                Models.toName(f, "com.example.MockPrologue"),
                "prologue"),
                context.getInputContext()));
    }
View Full Code Here

                context.getInputContext()));
    }

    @Override
    public List<ExternalIoStage> emitEpilogue(IoContext context) throws IOException {
        ModelFactory f = getEnvironment().getModelFactory();
        return Arrays.asList(new ExternalIoStage(getId(), new CompiledStage(
                Models.toName(f, "com.example.MockEpilogue"),
                "epilogue"), context.getOutputContext()));
    }
View Full Code Here

@TargetOperator(Trace.class)
public class TraceFlowProcessor extends LinePartProcessor {

    @Override
    public void emitLinePart(Context context) {
        ModelFactory f = Models.getModelFactory();
        Expression driver = context.createField(
                TraceDriver.class, "trace",
                new TypeBuilder(f, context.convert(TraceDriver.class))
                    .method("get", createTraceContext(context))
                    .toExpression());
View Full Code Here

        TraceSettingAttribute attribute = context.getOperatorDescription().getAttribute(TraceSettingAttribute.class);
        if (attribute == null) {
            throw new IllegalStateException();
        }
        Tracepoint tracepoint = attribute.getSetting().getTracepoint();
        ModelFactory f = Models.getModelFactory();
        List<Expression> arguments = new ArrayList<Expression>();

        // serial number
        arguments.add(Models.toLiteral(f, attribute.getSerialNumber()));

        // operator class
        arguments.add(Models.toLiteral(f, tracepoint.getOperatorClassName()));

        // operator method
        arguments.add(Models.toLiteral(f, tracepoint.getOperatorMethodName()));

        // port direction
        arguments.add(new TypeBuilder(f, context.convert(PortDirection.class))
                .field(tracepoint.getPortKind() == PortKind.INPUT
                        ? PortDirection.INPUT.name() : PortDirection.OUTPUT.name())
                .toExpression());

        // port name
        arguments.add(Models.toLiteral(f, tracepoint.getPortName()));

        // data type
        arguments.add(f.newClassLiteral(context.convert(context.getInputPort(0).getDataType())));

        // attributes
        Map<String, String> traceAttributes = new TreeMap<String, String>(attribute.getSetting().getAttributes());
        for (Map.Entry<String, String> entry : traceAttributes.entrySet()) {
            arguments.add(Models.toLiteral(f, entry.getKey()));
View Full Code Here

        AnalyzeTask analyzer = new AnalyzeTask("testing", getClass().getClassLoader());
        return analyzer.process(source);
    }

    private List<VolatileJavaFile> emit(DmdlSourceRepository source) throws IOException {
        ModelFactory factory = Models.getModelFactory();
        VolatileEmitter emitter = new VolatileEmitter();
        com.asakusafw.dmdl.java.Configuration conf = new com.asakusafw.dmdl.java.Configuration(
                factory,
                source,
                Models.toName(factory, "com.example"),
View Full Code Here

    }

    @Override
    protected List<? extends TypeBodyDeclaration> override(Context context) {
        ImplementationBuilder builder = new ImplementationBuilder(context);
        ModelFactory f = context.environment.getFactory();
        builder.addStatement(new TypeBuilder(f, context.importer.toType(UnsupportedOperationException.class))
            .newObject(Models.toLiteral(f, "単純集計演算子は組み込みの方法で処理されます"))
            .toThrowStatement());
        return builder.toImplementation();
    }
View Full Code Here

    }

    @Override
    protected List<? extends TypeBodyDeclaration> override(Context context) {
        ImplementationBuilder builder = new ImplementationBuilder(context);
        ModelFactory f = context.environment.getFactory();
        builder.addStatement(new TypeBuilder(f, context.importer.toType(UnsupportedOperationException.class))
            .newObject(Models.toLiteral(f, "分割演算子は組み込みの方法で処理されます"))
            .toThrowStatement());
        return builder.toImplementation();
    }
View Full Code Here

TOP

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

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.