Class ModuleStringIdentityrefCodec
- java.lang.Object
-
- org.opendaylight.yangtools.concepts.AbstractCodec<P,I,X>
-
- org.opendaylight.yangtools.concepts.AbstractUncheckedCodec<P,I,IllegalArgumentException>
-
- org.opendaylight.yangtools.concepts.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:
Codec<String,QName,IllegalArgumentException>
,Deserializer<QName,String,IllegalArgumentException>
,IllegalArgumentCodec<String,QName>
,Serializer<String,QName,IllegalArgumentException>
,UncheckedCodec<String,QName,IllegalArgumentException>
,UncheckedDeserializer<String,QName,IllegalArgumentException>
,UncheckedSerializer<QName,String,IllegalArgumentException>
,IdentityrefCodec<String>
,SchemaContextProvider
@Beta public abstract class ModuleStringIdentityrefCodec extends AbstractModuleStringIdentityrefCodec implements SchemaContextProvider
Base class for implementing identityref codecs on based on module names.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModuleStringIdentityrefCodec(@NonNull SchemaContext context, @NonNull QNameModule parentModule)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @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.protected QNameModule
getParentModule()
SchemaContext
getSchemaContext()
Return theSchemaContext
attached to this object.protected QName
parseQName(String str)
protected String
prefixForNamespace(URI 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.concepts.AbstractCodec
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.concepts.Codec
deserialize, serialize
-
Methods inherited from interface org.opendaylight.yangtools.concepts.UncheckedDeserializer
serialize
-
Methods inherited from interface org.opendaylight.yangtools.concepts.UncheckedSerializer
deserialize
-
-
-
-
Constructor Detail
-
ModuleStringIdentityrefCodec
protected ModuleStringIdentityrefCodec(@NonNull SchemaContext context, @NonNull QNameModule parentModule)
-
-
Method Detail
-
getSchemaContext
public final SchemaContext getSchemaContext()
Description copied from interface:SchemaContextProvider
Return theSchemaContext
attached to this object.- Specified by:
getSchemaContext
in interfaceSchemaContextProvider
- Returns:
- An SchemaContext instance.
-
getParentModule
protected final QNameModule getParentModule()
-
prefixForNamespace
protected String prefixForNamespace(URI namespace)
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
protected final @NonNull StringBuilder appendQName(StringBuilder sb, QName qname)
-
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
-
-