Package com.asakusafw.compiler.operator

Examples of com.asakusafw.compiler.operator.DataModelMirror


        assert selectorMethod != null;
        assert operatorMethod.getParameters().isEmpty() == false;
        List<? extends VariableElement> operatorParams = operatorMethod.getParameters();
        List<? extends VariableElement> selectorParams = selectorMethod.getParameters();
        checkParameterCount(operatorMethod, selectorMethod);
        DataModelMirror operatorMaster = environment.loadDataModel(operatorParams.get(0).asType());
        DataModelMirror selectorMaster = extractSelectorMaster(
                environment, selectorMethod, selectorParams.get(0).asType());
        if (isValidMaster(operatorMaster, selectorMaster) == false) {
            throw new ResolveException(MessageFormat.format(
                    "マスタ選択を行うメソッド{0}の1つめの引数は、List<{1}>の形式でなければなりません",
                    selectorMethod.getSimpleName(),
                    operatorMaster));
        }
        if (selectorParams.size() == 1) {
            return;
        }
        DataModelMirror operatorTx = environment.loadDataModel(operatorParams.get(1).asType());
        DataModelMirror selectorTx = environment.loadDataModel(selectorParams.get(1).asType());
        if (isValidTx(operatorTx, selectorTx) == false) {
            throw new ResolveException(MessageFormat.format(
                    "マスタ選択を行うメソッド{0}の2つめの引数は、{1}のスーパータイプでなければなりません",
                    selectorMethod.getSimpleName(),
                    operatorTx));
        }
        DataModelMirror selectorResult = environment.loadDataModel(selectorMethod.getReturnType());
        if (isValidResult(operatorMaster, selectorMaster, selectorResult) == false) {
            throw new ResolveException(MessageFormat.format(
                    "マスタ選択を行うメソッド{0}の戻り値は、{1}のサブタイプでなければなりません",
                    selectorMethod.getSimpleName(),
                    operatorMaster));
View Full Code Here


    }

    @Override
    public DataModelMirror load(OperatorCompilingEnvironment environment, TypeMirror type) {
        for (DataModelMirrorRepository repo : repositories) {
            DataModelMirror result = repo.load(environment, type);
            if (result != null) {
                return result;
            }
        }
        return null;
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.operator.DataModelMirror

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.