+ private static final Predicate<StmtContext<?, ?,?>> IS_UNKNOWN_STATEMENT_CONTEXT =
+ new Predicate<StmtContext<?,?,?>>() {
+ @Override
+ public boolean apply(final StmtContext<?, ?, ?> input) {
+ return StmtContextUtils.isUnknownStatement(input);
+ }
+ };
+
+ private final List<? extends EffectiveStatement<?, ?>> substatements;
+
+ /**
+ * Constructor.
+ *
+ * @param ctx
+ * context of statement.
+ */
+ protected EffectiveStatementBase(final StmtContext<A, D, ?> ctx) {
+ final Collection<StatementContextBase<?, ?, ?>> effectiveSubstatements = ctx.effectiveSubstatements();
+ final Collection<StatementContextBase<?, ?, ?>> substatementsInit = new ArrayList<>();
+
+ for(StatementContextBase<?, ?, ?> declaredSubstatement : ctx.declaredSubstatements()) {
+ if (declaredSubstatement.getPublicDefinition().equals(Rfc6020Mapping.USES)) {
+ substatementsInit.add(declaredSubstatement);
+ substatementsInit.addAll(declaredSubstatement.getEffectOfStatement());
+ ((StatementContextBase<?, ?, ?>) ctx).removeStatementsFromEffectiveSubstatements(declaredSubstatement
+ .getEffectOfStatement());
+ } else {
+ substatementsInit.add(declaredSubstatement);
+ }
+ }