import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
import org.opendaylight.yangtools.yang.parser.spi.meta.SchemaPathSupport;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport.CopyPolicy;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
private final SubstatementValidator validator;
AbstractHashedValueStatementSupport(final StatementDefinition definition) {
- super(definition, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(definition, StatementPolicy.contextIndependent());
this.validator = SubstatementValidator.builder(definition).build();
}
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
import org.opendaylight.yangtools.yang.parser.spi.meta.SchemaPathSupport;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport.CopyPolicy;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
private final SubstatementValidator validator;
GetFilterElementAttributesStatementSupport(final StatementDefinition definition) {
- super(definition, CopyPolicy.REJECT);
+ super(definition, StatementPolicy.reject());
this.validator = SubstatementValidator.builder(definition).build();
}
private final SubstatementValidator validator;
private DefaultDenyAllStatementSupport(final StatementDefinition definition) {
- super(definition, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(definition, StatementPolicy.contextIndependent());
this.validator = SubstatementValidator.builder(definition).build();
}
private final SubstatementValidator validator;
DefaultDenyWriteStatementSupport(final StatementDefinition definition) {
- super(definition, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(definition, StatementPolicy.contextIndependent());
this.validator = SubstatementValidator.builder(definition).build();
}
private static final AliasStatementSupport INSTANCE = new AliasStatementSupport();
private AliasStatementSupport() {
- super(IetfYangSmiv2ExtensionsMapping.ALIAS, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(IetfYangSmiv2ExtensionsMapping.ALIAS, StatementPolicy.contextIndependent());
}
public static AliasStatementSupport getInstance() {
private static final DefValStatementSupport INSTANCE = new DefValStatementSupport();
private DefValStatementSupport() {
- super(IetfYangSmiv2ExtensionsMapping.DEFVAL, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(IetfYangSmiv2ExtensionsMapping.DEFVAL, StatementPolicy.contextIndependent());
}
public static DefValStatementSupport getInstance() {
private static final DisplayHintStatementSupport INSTANCE = new DisplayHintStatementSupport();
private DisplayHintStatementSupport() {
- super(IetfYangSmiv2ExtensionsMapping.DISPLAY_HINT, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(IetfYangSmiv2ExtensionsMapping.DISPLAY_HINT, StatementPolicy.contextIndependent());
}
public static DisplayHintStatementSupport getInstance() {
private static final ImpliedStatementSupport INSTANCE = new ImpliedStatementSupport();
private ImpliedStatementSupport() {
- super(IetfYangSmiv2ExtensionsMapping.IMPLIED, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(IetfYangSmiv2ExtensionsMapping.IMPLIED, StatementPolicy.contextIndependent());
}
public static ImpliedStatementSupport getInstance() {
private final SubstatementValidator validator;
private YangDataStatementSupport(final StatementDefinition definition) {
- super(definition, CopyPolicy.REJECT);
+ super(definition, StatementPolicy.reject());
validator = SubstatementValidator.builder(definition)
.addMandatory(YangStmtMapping.CONTAINER)
.addOptional(YangStmtMapping.USES)
private static final OpenConfigVersionSupport INSTANCE = new OpenConfigVersionSupport();
private OpenConfigVersionSupport() {
- super(OpenConfigStatements.OPENCONFIG_VERSION, CopyPolicy.REJECT);
+ super(OpenConfigStatements.OPENCONFIG_VERSION, StatementPolicy.reject());
}
public static OpenConfigVersionSupport getInstance() {
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
/**
- * Specialization of {@link BaseStatementSupport} for Boolean statement arguments.
+ * Specialization of {@link BaseStatementSupport} for statements which carry a Boolean argument and are essentially
+ * context-independent.
*
* @param <D> Declared Statement representation
* @param <E> Effective Statement representation
private final @NonNull D emptyDeclaredTrue;
protected BaseBooleanStatementSupport(final StatementDefinition publicDefinition,
- final E emptyEffectiveFalse, final E emptyEffectiveTrue, final CopyPolicy copyPolicy) {
- super(publicDefinition, copyPolicy);
+ final E emptyEffectiveFalse, final E emptyEffectiveTrue, final StatementPolicy<Boolean, D> policy) {
+ super(publicDefinition, policy);
this.emptyEffectiveFalse = requireNonNull(emptyEffectiveFalse);
this.emptyEffectiveTrue = requireNonNull(emptyEffectiveTrue);
emptyDeclaredFalse = requireNonNull(emptyEffectiveFalse.getDeclared());
}
});
- protected BaseInternedStatementSupport(final StatementDefinition publicDefinition, final CopyPolicy copyPolicy) {
- super(publicDefinition, copyPolicy);
+ protected BaseInternedStatementSupport(final StatementDefinition publicDefinition,
+ final StatementPolicy<A, D> policy) {
+ super(publicDefinition, policy);
}
@Override
@Beta
public abstract class BaseQNameStatementSupport<D extends DeclaredStatement<QName>,
E extends EffectiveStatement<QName, D>> extends BaseStatementSupport<QName, D, E> {
+ protected BaseQNameStatementSupport(final StatementDefinition publicDefinition,
+ final StatementPolicy<QName, D> policy) {
+ super(publicDefinition, policy);
+ }
+
+ @Deprecated
protected BaseQNameStatementSupport(final StatementDefinition publicDefinition, final CopyPolicy copyPolicy) {
super(publicDefinition, copyPolicy);
}
@Beta
public abstract class BaseStringStatementSupport<D extends DeclaredStatement<String>,
E extends EffectiveStatement<String, D>> extends BaseStatementSupport<String, D, E> {
- protected BaseStringStatementSupport(final StatementDefinition publicDefinition, final CopyPolicy copyPolicy) {
- super(publicDefinition, copyPolicy);
+ protected BaseStringStatementSupport(final StatementDefinition publicDefinition,
+ final StatementPolicy<String, D> policy) {
+ super(publicDefinition, policy);
}
@Override
@Beta
public abstract class BaseVoidStatementSupport<D extends DeclaredStatement<Void>, E extends EffectiveStatement<Void, D>>
extends BaseStatementSupport<Void, D, E> {
- protected BaseVoidStatementSupport(final StatementDefinition publicDefinition, final CopyPolicy copyPolicy) {
- super(publicDefinition, copyPolicy);
+ protected BaseVoidStatementSupport(final StatementDefinition publicDefinition,
+ final StatementPolicy<Void, D> policy) {
+ super(publicDefinition, policy);
}
@Override
private static final ArgumentStatementSupport INSTANCE = new ArgumentStatementSupport();
private ArgumentStatementSupport() {
- super(YangStmtMapping.ARGUMENT, CopyPolicy.REJECT);
+ super(YangStmtMapping.ARGUMENT, StatementPolicy.reject());
}
public static ArgumentStatementSupport getInstance() {
private static final BaseStatementSupport INSTANCE = new BaseStatementSupport();
private BaseStatementSupport() {
- super(YangStmtMapping.BASE, CopyPolicy.REJECT);
+ super(YangStmtMapping.BASE, StatementPolicy.reject());
}
public static BaseStatementSupport getInstance() {
private static final BelongsToStatementSupport INSTANCE = new BelongsToStatementSupport();
private BelongsToStatementSupport() {
- super(YangStmtMapping.BELONGS_TO, CopyPolicy.REJECT);
+ super(YangStmtMapping.BELONGS_TO, StatementPolicy.reject());
}
public static BelongsToStatementSupport getInstance() {
private final SubstatementValidator validator;
private BitStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.BIT, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.BIT, StatementPolicy.contextIndependent());
this.validator = requireNonNull(validator);
}
private static final ConfigStatementSupport INSTANCE = new ConfigStatementSupport();
private ConfigStatementSupport() {
- super(YangStmtMapping.CONFIG, new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.FALSE)),
- new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.TRUE)), CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.CONFIG,
+ new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.FALSE)),
+ new EmptyConfigEffectiveStatement(new EmptyConfigStatement(Boolean.TRUE)),
+ // FIXME: This is not quite true. If we are instantiated in a context which ignores config, which should
+ // really fizzle. This needs some more analysis.
+ StatementPolicy.contextIndependent());
}
public static ConfigStatementSupport getInstance() {
private static final ContactStatementSupport INSTANCE = new ContactStatementSupport();
private ContactStatementSupport() {
- super(YangStmtMapping.CONTACT, CopyPolicy.REJECT);
+ super(YangStmtMapping.CONTACT, StatementPolicy.reject());
}
public static ContactStatementSupport getInstance() {
private static final DefaultStatementSupport INSTANCE = new DefaultStatementSupport();
private DefaultStatementSupport() {
- // Note: if we start interpreting the string we'll need to use CopyPolicy.DECLARED_COPY
- super(YangStmtMapping.DEFAULT, CopyPolicy.CONTEXT_INDEPENDENT);
+ // Note: if we start interpreting the string we'll need to use StatementPolicy.declaredCopy()
+ super(YangStmtMapping.DEFAULT, StatementPolicy.contextIndependent());
}
public static DefaultStatementSupport getInstance() {
private static final DescriptionStatementSupport INSTANCE = new DescriptionStatementSupport();
private DescriptionStatementSupport() {
- super(YangStmtMapping.DESCRIPTION, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.DESCRIPTION, StatementPolicy.contextIndependent());
}
public static DescriptionStatementSupport getInstance() {
YangStmtMapping.MANDATORY, YangStmtMapping.MAX_ELEMENTS, YangStmtMapping.MIN_ELEMENTS);
AbstractDeviateStatementSupport() {
- super(YangStmtMapping.DEVIATE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.DEVIATE, StatementPolicy.contextIndependent());
}
@Override
private static final DeviationStatementSupport INSTANCE = new DeviationStatementSupport();
private DeviationStatementSupport() {
- super(YangStmtMapping.DEVIATION, CopyPolicy.REJECT);
+ super(YangStmtMapping.DEVIATION, StatementPolicy.reject());
}
public static DeviationStatementSupport getInstance() {
private final SubstatementValidator validator;
private EnumStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.ENUM, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.ENUM, StatementPolicy.contextIndependent());
this.validator = requireNonNull(validator);
}
private static final ErrorAppTagStatementSupport INSTANCE = new ErrorAppTagStatementSupport();
private ErrorAppTagStatementSupport() {
- super(YangStmtMapping.ERROR_APP_TAG, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.ERROR_APP_TAG, StatementPolicy.contextIndependent());
}
public static ErrorAppTagStatementSupport getInstance() {
private static final ErrorMessageStatementSupport INSTANCE = new ErrorMessageStatementSupport();
private ErrorMessageStatementSupport() {
- super(YangStmtMapping.ERROR_MESSAGE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.ERROR_MESSAGE, StatementPolicy.contextIndependent());
}
public static ErrorMessageStatementSupport getInstance() {
new ThreadLocal<>();
private ExtensionStatementSupport() {
- super(YangStmtMapping.EXTENSION, CopyPolicy.REJECT);
+ super(YangStmtMapping.EXTENSION, StatementPolicy.reject());
}
public static ExtensionStatementSupport getInstance() {
private static final int EMPTY_EFFECTIVE_FLAGS = new FlagsBuilder().setStatus(Status.CURRENT).toFlags();
private FeatureStatementSupport() {
- super(YangStmtMapping.FEATURE, CopyPolicy.REJECT);
+ super(YangStmtMapping.FEATURE, StatementPolicy.reject());
}
public static FeatureStatementSupport getInstance() {
}
private FractionDigitsStatementSupport() {
- super(YangStmtMapping.FRACTION_DIGITS, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.FRACTION_DIGITS, StatementPolicy.contextIndependent());
}
public static FractionDigitsStatementSupport getInstance() {
private final SubstatementValidator validator;
private IdentityStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.IDENTITY, CopyPolicy.DECLARED_COPY);
+ super(YangStmtMapping.IDENTITY, StatementPolicy.reject());
this.validator = requireNonNull(validator);
}
.build();
AbstractIfFeatureStatementSupport() {
- super(YangStmtMapping.IF_FEATURE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.IF_FEATURE, StatementPolicy.contextIndependent());
}
@Override
private final SubstatementValidator validator;
private ImportStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.IMPORT, CopyPolicy.REJECT);
+ super(YangStmtMapping.IMPORT, StatementPolicy.reject());
this.validator = requireNonNull(validator);
}
private final SubstatementValidator validator;
IncludeStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.INCLUDE, CopyPolicy.REJECT);
+ super(YangStmtMapping.INCLUDE, StatementPolicy.reject());
this.validator = requireNonNull(validator);
}
private static final LengthStatementSupport INSTANCE = new LengthStatementSupport();
private LengthStatementSupport() {
- super(YangStmtMapping.LENGTH, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.LENGTH, StatementPolicy.contextIndependent());
}
public static LengthStatementSupport getInstance() {
super(YangStmtMapping.MANDATORY,
new EmptyMandatoryEffectiveStatement(new EmptyMandatoryStatement(Boolean.FALSE)),
new EmptyMandatoryEffectiveStatement(new EmptyMandatoryStatement(Boolean.TRUE)),
- CopyPolicy.CONTEXT_INDEPENDENT);
+ StatementPolicy.contextIndependent());
}
public static MandatoryStatementSupport getInstance() {
private static final MaxElementsStatementSupport INSTANCE = new MaxElementsStatementSupport();
private MaxElementsStatementSupport() {
- super(YangStmtMapping.MAX_ELEMENTS, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.MAX_ELEMENTS, StatementPolicy.contextIndependent());
}
public static MaxElementsStatementSupport getInstance() {
private static final MinElementsStatementSupport INSTANCE = new MinElementsStatementSupport();
private MinElementsStatementSupport() {
- super(YangStmtMapping.MIN_ELEMENTS, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.MIN_ELEMENTS, StatementPolicy.contextIndependent());
}
public static MinElementsStatementSupport getInstance() {
private static final ModifierStatementSupport INSTANCE = new ModifierStatementSupport();
private ModifierStatementSupport() {
- super(YangStmtMapping.MODIFIER, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.MODIFIER, StatementPolicy.contextIndependent());
}
public static ModifierStatementSupport getInstance() {
private final SubstatementValidator validator;
private ModuleStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.MODULE, CopyPolicy.REJECT);
+ super(YangStmtMapping.MODULE, StatementPolicy.reject());
this.validator = requireNonNull(validator);
}
private final @NonNull XPathSupport xpathSupport;
private MustStatementSupport(final XPathSupport xpathSupport) {
- // Note: declared copy to future-proof when we bind expressions
- super(YangStmtMapping.MUST, CopyPolicy.DECLARED_COPY);
+ // Note: if we end up binding expressions, this needs to become declaredCopy()
+ super(YangStmtMapping.MUST, StatementPolicy.contextIndependent());
this.xpathSupport = requireNonNull(xpathSupport);
}
private static final NamespaceStatementSupport INSTANCE = new NamespaceStatementSupport();
private NamespaceStatementSupport() {
- super(YangStmtMapping.NAMESPACE, CopyPolicy.REJECT);
+ super(YangStmtMapping.NAMESPACE, StatementPolicy.reject());
}
public static NamespaceStatementSupport getInstance() {
new EmptyOrderedByEffectiveStatement(EMPTY_USER_DECL);
private OrderedByStatementSupport() {
- super(YangStmtMapping.ORDERED_BY, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.ORDERED_BY, StatementPolicy.contextIndependent());
}
public static OrderedByStatementSupport getInstance() {
private static final OrganizationStatementSupport INSTANCE = new OrganizationStatementSupport();
private OrganizationStatementSupport() {
- super(YangStmtMapping.ORGANIZATION, CopyPolicy.REJECT);
+ super(YangStmtMapping.ORGANIZATION, StatementPolicy.reject());
}
public static OrganizationStatementSupport getInstance() {
private PathStatementSupport(final PathExpressionParser parser) {
// TODO: can 'path' really be copied?
- super(YangStmtMapping.PATH, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.PATH, StatementPolicy.contextIndependent());
this.parser = requireNonNull(parser);
}
private final SubstatementValidator validator;
private PatternStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.PATTERN, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.PATTERN, StatementPolicy.contextIndependent());
this.validator = requireNonNull(validator);
}
private static final PositionStatementSupport INSTANCE = new PositionStatementSupport();
private PositionStatementSupport() {
- super(YangStmtMapping.POSITION, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.POSITION, StatementPolicy.contextIndependent());
}
public static PositionStatementSupport getInstance() {
private static final PrefixStatementSupport INSTANCE = new PrefixStatementSupport();
private PrefixStatementSupport() {
- super(YangStmtMapping.PREFIX, CopyPolicy.REJECT);
+ super(YangStmtMapping.PREFIX, StatementPolicy.reject());
}
public static PrefixStatementSupport getInstance() {
private static final PresenceStatementSupport INSTANCE = new PresenceStatementSupport();
private PresenceStatementSupport() {
- super(YangStmtMapping.PRESENCE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.PRESENCE, StatementPolicy.contextIndependent());
}
public static PresenceStatementSupport getInstance() {
public final class RangeStatementSupport
extends BaseStatementSupport<List<ValueRange>, RangeStatement, RangeEffectiveStatement> {
- private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(YangStmtMapping
- .RANGE)
- .addOptional(YangStmtMapping.DESCRIPTION)
- .addOptional(YangStmtMapping.ERROR_APP_TAG)
- .addOptional(YangStmtMapping.ERROR_MESSAGE)
- .addOptional(YangStmtMapping.REFERENCE)
- .build();
+ private static final SubstatementValidator SUBSTATEMENT_VALIDATOR =
+ SubstatementValidator.builder(YangStmtMapping.RANGE)
+ .addOptional(YangStmtMapping.DESCRIPTION)
+ .addOptional(YangStmtMapping.ERROR_APP_TAG)
+ .addOptional(YangStmtMapping.ERROR_MESSAGE)
+ .addOptional(YangStmtMapping.REFERENCE)
+ .build();
private static final RangeStatementSupport INSTANCE = new RangeStatementSupport();
private RangeStatementSupport() {
- super(YangStmtMapping.RANGE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.RANGE, StatementPolicy.contextIndependent());
}
public static RangeStatementSupport getInstance() {
private static final ReferenceStatementSupport INSTANCE = new ReferenceStatementSupport();
private ReferenceStatementSupport() {
- super(YangStmtMapping.REFERENCE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.REFERENCE, StatementPolicy.contextIndependent());
}
public static ReferenceStatementSupport getInstance() {
YangStmtMapping.REQUIRE_INSTANCE).build();
private static final RequireInstanceStatementSupport INSTANCE = new RequireInstanceStatementSupport();
-
private RequireInstanceStatementSupport() {
super(YangStmtMapping.REQUIRE_INSTANCE,
new EmptyRequireInstanceEffectiveStatement(new EmptyRequireInstanceStatement(Boolean.FALSE)),
new EmptyRequireInstanceEffectiveStatement(new EmptyRequireInstanceStatement(Boolean.TRUE)),
- CopyPolicy.CONTEXT_INDEPENDENT);
+ StatementPolicy.contextIndependent());
}
public static RequireInstanceStatementSupport getInstance() {
protected EmptyRequireInstanceEffectiveStatement createEmptyEffective(final RequireInstanceStatement declared) {
return new EmptyRequireInstanceEffectiveStatement(declared);
}
-}
\ No newline at end of file
+}
private static final RevisionStatementSupport INSTANCE = new RevisionStatementSupport();
private RevisionStatementSupport() {
- super(YangStmtMapping.REVISION, CopyPolicy.REJECT);
+ super(YangStmtMapping.REVISION, StatementPolicy.reject());
}
public static RevisionStatementSupport getInstance() {
private static final RevisionDateStatementSupport INSTANCE = new RevisionDateStatementSupport();
private RevisionDateStatementSupport() {
- super(YangStmtMapping.REVISION_DATE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.REVISION_DATE, StatementPolicy.contextIndependent());
}
public static RevisionDateStatementSupport getInstance() {
new EmptyStatusEffectiveStatement(EMPTY_OBSOLETE_DECL);
private StatusStatementSupport() {
- super(YangStmtMapping.STATUS, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.STATUS, StatementPolicy.contextIndependent());
}
public static StatusStatementSupport getInstance() {
private final SubstatementValidator validator;
private SubmoduleStatementSupport(final SubstatementValidator validator) {
- super(YangStmtMapping.SUBMODULE, CopyPolicy.REJECT);
+ super(YangStmtMapping.SUBMODULE, StatementPolicy.reject());
this.validator = requireNonNull(validator);
}
private static final TypedefStatementSupport INSTANCE = new TypedefStatementSupport();
private TypedefStatementSupport() {
- super(YangStmtMapping.TYPEDEF, CopyPolicy.REJECT);
+ super(YangStmtMapping.TYPEDEF, StatementPolicy.reject());
}
public static TypedefStatementSupport getInstance() {
private static final UnitsStatementSupport INSTANCE = new UnitsStatementSupport();
private UnitsStatementSupport() {
- super(YangStmtMapping.UNITS, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.UNITS, StatementPolicy.contextIndependent());
}
public static UnitsStatementSupport getInstance() {
private static final ValueStatementSupport INSTANCE = new ValueStatementSupport();
private ValueStatementSupport() {
- super(YangStmtMapping.VALUE, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(YangStmtMapping.VALUE, StatementPolicy.contextIndependent());
}
public static ValueStatementSupport getInstance() {
private final @NonNull XPathSupport xpathSupport;
private WhenStatementSupport(final XPathSupport xpathSupport) {
- // Note: declared copy to future-proof when we bind expressions
- super(YangStmtMapping.WHEN, CopyPolicy.DECLARED_COPY);
+ // Note: if we end up binding expressions, this needs to become declaredCopy()
+ super(YangStmtMapping.WHEN, StatementPolicy.contextIndependent());
this.xpathSupport = requireNonNull(xpathSupport);
}
new EmptyYangVersionEffectiveStatement(EMPTY_VER1_1_DECL);
private YangVersionStatementSupport() {
- super(YangStmtMapping.YANG_VERSION, CopyPolicy.REJECT);
+ super(YangStmtMapping.YANG_VERSION, StatementPolicy.reject());
}
public static YangVersionStatementSupport getInstance() {
super(YangStmtMapping.YIN_ELEMENT,
new EmptyYinElementEffectiveStatement(new EmptyYinElementStatement(Boolean.FALSE)),
new EmptyYinElementEffectiveStatement(new EmptyYinElementStatement(Boolean.TRUE)),
- CopyPolicy.REJECT);
+ StatementPolicy.reject());
}
public static YinElementStatementSupport getInstance() {
private static final ThirdPartyExtensionSupport INSTANCE = new ThirdPartyExtensionSupport();
private ThirdPartyExtensionSupport() {
- super(ThirdPartyExtensionsMapping.THIRD_PARTY_EXTENSION, CopyPolicy.CONTEXT_INDEPENDENT);
+ super(ThirdPartyExtensionsMapping.THIRD_PARTY_EXTENSION, StatementPolicy.contextIndependent());
}
public static ThirdPartyExtensionSupport getInstance() {