Class YinDomSchemaSource
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.repo.api.YinDomSchemaSource
-
- All Implemented Interfaces:
Identifiable<SourceIdentifier>
,Immutable
,MutationBehaviour<Immutable>
,SchemaSourceRepresentation
,YinSchemaSourceRepresentation
,YinXmlSchemaSource
public abstract class YinDomSchemaSource extends Object implements YinXmlSchemaSource
UtilityYinXmlSchemaSource
exposing a W3CDOMSource
representation of YIN model.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract MoreObjects.ToStringHelper
addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
Add subclass-specific attributes to the outputtoString()
output.static @NonNull YinDomSchemaSource
create(@NonNull SourceIdentifier identifier, @NonNull DOMSource source, @Nullable String symbolicName)
Create a newYinDomSchemaSource
using an identifier and a source.abstract DOMSource
getSource()
Return an XMLSource
of the YIN document.Class<? extends YinXmlSchemaSource>
getType()
Return the concrete representation type.static @NonNull YinDomSchemaSource
lazyTransform(YinXmlSchemaSource xmlSchemaSource)
Create aYinDomSchemaSource
from aYinXmlSchemaSource
.String
toString()
static @NonNull YinDomSchemaSource
transform(YinXmlSchemaSource xmlSchemaSource)
Create aYinDomSchemaSource
from aYinXmlSchemaSource
.-
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.repo.api.SchemaSourceRepresentation
getIdentifier, getSymbolicName
-
-
-
-
Method Detail
-
create
public static @NonNull YinDomSchemaSource create(@NonNull SourceIdentifier identifier, @NonNull DOMSource source, @Nullable String symbolicName)
Create a newYinDomSchemaSource
using an identifier and a source.- Parameters:
identifier
- Schema source identifiersource
- W3C DOM sourcesymbolicName
- Source symbolic name- Returns:
- A new
YinDomSchemaSource
instance.
-
lazyTransform
public static @NonNull YinDomSchemaSource lazyTransform(YinXmlSchemaSource xmlSchemaSource)
Create aYinDomSchemaSource
from aYinXmlSchemaSource
. 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
YinDomSchemaSource
instance
-
transform
public static @NonNull YinDomSchemaSource transform(YinXmlSchemaSource xmlSchemaSource) throws TransformerException
Create aYinDomSchemaSource
from aYinXmlSchemaSource
. 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
YinDomSchemaSource
instance - Throws:
TransformerException
- when the provided source fails to transform
-
getSource
public abstract DOMSource getSource()
Description copied from interface:YinXmlSchemaSource
Return an XMLSource
of the YIN document.- Specified by:
getSource
in interfaceYinXmlSchemaSource
- Returns:
- An XML
Source
instance.
-
getType
public final Class<? extends YinXmlSchemaSource> getType()
Description copied from interface:SchemaSourceRepresentation
Return the concrete representation type.- Specified by:
getType
in interfaceSchemaSourceRepresentation
- Specified by:
getType
in interfaceYinSchemaSourceRepresentation
- Specified by:
getType
in interfaceYinXmlSchemaSource
- Returns:
- The type of representation.
-
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.
-
-