Class AbstractNodeDataWithSchema<T extends DataSchemaNode>
- java.lang.Object
-
- org.opendaylight.yangtools.yang.data.util.AbstractNodeDataWithSchema<T>
-
- Direct Known Subclasses:
CompositeNodeDataWithSchema
,SimpleNodeDataWithSchema
@Beta public abstract class AbstractNodeDataWithSchema<T extends DataSchemaNode> extends Object
Utility abstract class for tracking parser state, as needed by StAX-like parser. This class is to be used only by respective XML and JSON parsers in yang-data-codec-xml and yang-data-codec-gson.
-
-
Constructor Summary
Constructors Constructor Description AbstractNodeDataWithSchema(T schema)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
ImmutableMap<QName,Object>
getAttributes()
Return the associated attributes.@NonNull T
getSchema()
Return the associated schema node.int
hashCode()
protected YangInstanceIdentifier.NodeIdentifier
provideNodeIdentifier()
void
setAttributes(ImmutableMap<QName,Object> attributes)
Set the associated attributes.void
write(NormalizedNodeStreamWriter writer)
Emit this node's events into the specified writer.protected abstract void
write(NormalizedNodeStreamWriter writer, @Nullable StreamWriterMetadataExtension metaWriter)
protected void
writeMetadata(StreamWriterMetadataExtension metaWriter)
-
-
-
Constructor Detail
-
AbstractNodeDataWithSchema
public AbstractNodeDataWithSchema(T schema)
-
-
Method Detail
-
getSchema
public final @NonNull T getSchema()
Return the associated schema node.- Returns:
- Associated schema node.
-
setAttributes
public final void setAttributes(ImmutableMap<QName,Object> attributes)
Set the associated attributes.- Parameters:
attributes
- parsed attributes
-
getAttributes
public final ImmutableMap<QName,Object> getAttributes()
Return the associated attributes.- Returns:
- associated attributes
-
write
public final void write(NormalizedNodeStreamWriter writer) throws IOException
Emit this node's events into the specified writer.- Parameters:
writer
- Target writer- Throws:
IOException
- reported when thrown by the writer.
-
write
protected abstract void write(NormalizedNodeStreamWriter writer, @Nullable StreamWriterMetadataExtension metaWriter) throws IOException
- Throws:
IOException
-
provideNodeIdentifier
protected final YangInstanceIdentifier.NodeIdentifier provideNodeIdentifier()
-
writeMetadata
protected final void writeMetadata(StreamWriterMetadataExtension metaWriter) throws IOException
- Throws:
IOException
-
-