+ public void removeStatementFromEffectiveSubstatements(final StatementDefinition refineSubstatementDef) {
+ Iterator<StatementContextBase<?, ?, ?>> iterator = effective.iterator();
+ while (iterator.hasNext()) {
+ StatementContextBase<?, ?, ?> next = iterator.next();
+ if (next.getPublicDefinition().equals(refineSubstatementDef)) {
+ iterator.remove();
+ }
+ }
+ }
+
+ /**
+ * adds effective statement to collection of substatements
+ *
+ * @throws IllegalStateException
+ * if added in declared phase
+ * @throws NullPointerException
+ * if statement parameter is null
+ *
+ * @param substatement substatement
+ */
+ public void addEffectiveSubstatement(final StatementContextBase<?, ?, ?> substatement) {
+
+ final ModelProcessingPhase inProgressPhase = getRoot().getSourceContext().getInProgressPhase();
+ Preconditions.checkState(inProgressPhase == ModelProcessingPhase.FULL_DECLARATION
+ || inProgressPhase == ModelProcessingPhase.EFFECTIVE_MODEL,
+ "Effective statement cannot be added in declared phase at: %s", getStatementSourceReference());
+
+ effective.add(Preconditions.checkNotNull(substatement,
+ "StatementContextBase effective substatement cannot be null at: %s", getStatementSourceReference()));