Class YinDomSource
java.lang.Object
org.opendaylight.yangtools.yang.model.spi.source.YinDomSource
- All Implemented Interfaces:
Immutable
,SourceRepresentation
,YinSourceRepresentation
,YinXmlSource
Utility
YinXmlSource
exposing a W3C DOMSource
representation of YIN model.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract MoreObjects.ToStringHelper
addToStringAttributes
(MoreObjects.ToStringHelper toStringHelper) Add subclass-specific attributes to the outputtoString()
output.static @NonNull YinDomSource
create
(@NonNull SourceIdentifier identifier, @NonNull DOMSource source, @Nullable String symbolicName) Create a newYinDomSource
using an identifier and a source.abstract DOMSource
Return an XMLSource
of the YIN document.final Class
<YinDomSource> getType()
Return the concrete representation type.static @NonNull YinDomSource
lazyTransform
(YinXmlSource xmlSchemaSource) Create aYinDomSource
from aYinXmlSource
.final String
toString()
static @NonNull YinDomSource
transform
(YinXmlSource xmlSchemaSource) Create aYinDomSource
from aYinXmlSource
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.yang.model.api.source.SourceRepresentation
sourceId, symbolicName
-
Constructor Details
-
YinDomSource
public YinDomSource()
-
-
Method Details
-
create
public static @NonNull YinDomSource create(@NonNull SourceIdentifier identifier, @NonNull DOMSource source, @Nullable String symbolicName) Create a newYinDomSource
using an identifier and a source.- Parameters:
identifier
- Schema source identifiersource
- W3C DOM sourcesymbolicName
- Source symbolic name- Returns:
- A new
YinDomSource
instance.
-
lazyTransform
Create aYinDomSource
from aYinXmlSource
. If the argument is already a YinDomSchemaSource, this method returns the same instance. The source will be translated on first access, at which point anIllegalStateException
may be raised.- Parameters:
xmlSchemaSource
- Backing schema source- Returns:
- A
YinDomSource
instance
-
transform
public static @NonNull YinDomSource transform(YinXmlSource xmlSchemaSource) throws TransformerException Create aYinDomSource
from aYinXmlSource
. If the argument is already a YinDomSchemaSource, this method returns the same instance. The source will be translated immediately.- Parameters:
xmlSchemaSource
- Backing schema source- Returns:
- A
YinDomSource
instance - Throws:
TransformerException
- when the provided source fails to transform
-
getType
Description copied from interface:SourceRepresentation
Return the concrete representation type.- Specified by:
getType
in interfaceSourceRepresentation
- Specified by:
getType
in interfaceYinSourceRepresentation
- Specified by:
getType
in interfaceYinXmlSource
- Returns:
- The type of representation.
-
getSource
Description copied from interface:YinXmlSource
Return an XMLSource
of the YIN document.- Specified by:
getSource
in interfaceYinXmlSource
- Returns:
- An XML
Source
instance.
-
toString
-
addToStringAttributes
protected abstract MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper) Add subclass-specific attributes to the outputtoString()
output. Since subclasses are prevented from overridingtoString()
for consistency reasons, they can add their specific attributes to the resulting string by attaching attributes to the suppliedMoreObjects.ToStringHelper
.- Parameters:
toStringHelper
- ToStringHelper onto the attributes can be added- Returns:
- ToStringHelper supplied as input argument.
-