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));