- @SuppressWarnings({ "rawtypes", "unchecked" })
- public ContextBuilder<?, ?, ?> substatementBuilder(StatementDefinitionContext<?, ?, ?> def,
- StatementSourceReference ref) {
- return new ContextBuilder(def, ref) {
-
- @Override
- public StatementContextBase build() throws SourceException {
- StatementContextBase<?, ?, ?> potential = null;
-
- if (getDefinition().getPublicView() != Rfc6020Mapping.AUGMENT) {
- potential = substatements.get(createIdentifier());
- }
- if (potential == null) {
- potential = new SubstatementContext(StatementContextBase.this, this);
- substatements.put(createIdentifier(), potential);
- getDefinition().onStatementAdded(potential);
- }
- potential.resetLists();
- switch (this.getStamementSource().getStatementSource()) {
- case DECLARATION:
- addDeclaredSubstatement(potential);
- break;
- case CONTEXT:
- addEffectiveSubstatement(potential);
- break;
- }
- return potential;
- }
- };
+ ContextBuilder<?, ?, ?> substatementBuilder(final int childId, final StatementDefinitionContext<?, ?, ?> def,
+ final StatementSourceReference ref) {
+ return new SubContextBuilder(childId, def, ref);