use of org.dbflute.logic.doc.spolicy.parsed.DfSPolicyStatement in project dbflute-core by dbflute.
the class DfSPolicyMiscSecretary method parseStatement.
// ===================================================================================
// Statement
// =========
public DfSPolicyStatement parseStatement(String statement) {
if (!statement.startsWith("if ")) {
String msg = "The element of statementList should start with 'if' for SchemaPolicyCheck: " + statement;
throw new IllegalStateException(msg);
}
final ScopeInfo ifScope = Srl.extractScopeFirst(statement, "if ", " then ");
if (ifScope == null) {
final String additional = "The statement should start with 'if' and contain 'then'.";
throwSchemaPolicyCheckIllegalIfThenStatementException(statement, additional);
}
final DfSPolicyIfClause ifClause = analyzeIfClause(statement, ifScope);
final DfSPolicyThenClause thenClause = analyzeThenClause(statement, ifScope);
return new DfSPolicyStatement(statement, ifClause, thenClause);
}
Aggregations