import org.opendaylight.yangtools.yang.data.util.codec.AbstractCodecFactory;
import org.opendaylight.yangtools.yang.data.util.codec.CodecCache;
import org.opendaylight.yangtools.yang.data.util.codec.LazyCodecCache;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition;
/**
* Factory for creating JSON equivalents of codecs. Each instance of this object is bound to
- * a particular {@link SchemaContext}, but can be reused by multiple {@link JSONNormalizedNodeStreamWriter}s.
+ * a particular {@link EffectiveModelContext}, but can be reused by multiple {@link JSONNormalizedNodeStreamWriter}s.
*/
@Beta
public abstract class JSONCodecFactory extends AbstractCodecFactory<JSONCodec<?>> {
- JSONCodecFactory(final @NonNull SchemaContext context, final @NonNull CodecCache<JSONCodec<?>> cache) {
+ JSONCodecFactory(final @NonNull EffectiveModelContext context, final @NonNull CodecCache<JSONCodec<?>> cache) {
super(context, cache);
}
@Override
protected final JSONCodec<?> identityRefCodec(final IdentityrefTypeDefinition type, final QNameModule module) {
- return new IdentityrefJSONCodec(getSchemaContext(), module);
+ return new IdentityrefJSONCodec(getEffectiveModelContext(), module);
}
@Override
// Returns a one-off factory for the purposes of normalizing an anydata tree.
//
- // FIXME: 5.0.0: this is really ugly, as we should be able to tell if the new context is the same as ours and
+ // FIXME: 6.0.0: this is really ugly, as we should be able to tell if the new context is the same as ours and
// whether our cache is thread-safe -- in which case we should just return this.
// The supplier/cache/factory layout needs to be reworked so that this call ends up being equivalent
// to JSONCodecFactorySupplier.getShared() in case this factory is not thread safe.
//
// The above is not currently possible, as we cannot reference JSONCodecFactorySupplier from the
// factory due to that potentially creating a circular reference.
- final JSONCodecFactory rebaseTo(final SchemaContext newSchemaContext) {
+ final JSONCodecFactory rebaseTo(final EffectiveModelContext newSchemaContext) {
return rebaseTo(newSchemaContext, new LazyCodecCache<>());
}
- abstract JSONCodecFactory rebaseTo(SchemaContext newSchemaContext, CodecCache<JSONCodec<?>> newCache);
+ abstract JSONCodecFactory rebaseTo(EffectiveModelContext newSchemaContext, CodecCache<JSONCodec<?>> newCache);
abstract JSONCodec<?> wrapDecimalCodec(DecimalStringCodec decimalCodec);