Class ModuleStringIdentityrefCodec
java.lang.Object
org.opendaylight.yangtools.yang.data.api.codec.AbstractIllegalArgumentCodec<String,T>
org.opendaylight.yangtools.yang.data.util.AbstractStringIdentityrefCodec
org.opendaylight.yangtools.yang.data.util.AbstractModuleStringIdentityrefCodec
org.opendaylight.yangtools.yang.data.util.ModuleStringIdentityrefCodec
- All Implemented Interfaces:
IdentityrefCodec<String>
,IllegalArgumentCodec<String,
,QName> EffectiveModelContextProvider
@Beta
public abstract class ModuleStringIdentityrefCodec
extends AbstractModuleStringIdentityrefCodec
implements EffectiveModelContextProvider
Base class for implementing identityref codecs on based on module names.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ModuleStringIdentityrefCodec
(@NonNull EffectiveModelContext context, @NonNull QNameModule parentModule) -
Method Summary
Modifier and TypeMethodDescriptionprotected final @NonNull StringBuilder
appendQName
(StringBuilder sb, QName qname) protected StringBuilder
appendQName
(StringBuilder sb, QName qname, @Nullable QNameModule lastModule) Append a QName, potentially taking into account last QNameModule encountered in the serialized path.final EffectiveModelContext
Return theEffectiveModelContext
attached to this object.protected final QNameModule
protected final QName
parseQName
(String str) protected String
prefixForNamespace
(XMLNamespace namespace) Return string prefix for a particular namespace, allocating a new one if necessary.Methods inherited from class org.opendaylight.yangtools.yang.data.util.AbstractModuleStringIdentityrefCodec
createQName, moduleForPrefix
Methods inherited from class org.opendaylight.yangtools.yang.data.util.AbstractStringIdentityrefCodec
deserializeImpl, serializeImpl
Methods inherited from class org.opendaylight.yangtools.yang.data.api.codec.AbstractIllegalArgumentCodec
deserialize, serialize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.data.api.codec.IllegalArgumentCodec
deserialize, serialize
-
Constructor Details
-
ModuleStringIdentityrefCodec
protected ModuleStringIdentityrefCodec(@NonNull EffectiveModelContext context, @NonNull QNameModule parentModule)
-
-
Method Details
-
getEffectiveModelContext
Description copied from interface:EffectiveModelContextProvider
Return theEffectiveModelContext
attached to this object.- Specified by:
getEffectiveModelContext
in interfaceEffectiveModelContextProvider
- Returns:
- An EffectiveModelContext instance.
-
getParentModule
-
prefixForNamespace
Return string prefix for a particular namespace, allocating a new one if necessary.- Parameters:
namespace
- Namespace to map- Returns:
- Allocated unique prefix, or null if the prefix cannot be mapped.
-
appendQName
-
appendQName
protected StringBuilder appendQName(StringBuilder sb, QName qname, @Nullable QNameModule lastModule) Append a QName, potentially taking into account last QNameModule encountered in the serialized path.- Parameters:
sb
- target StringBuilderqname
- QName to appendlastModule
- last QNameModule encountered, may be null- Returns:
- target StringBuilder
-
parseQName
-