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 com.google.common.base.MoreObjects.ToStringHelperaddToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper) Add subclass-specific attributes to the outputtoString()output.static @NonNull YinDomSourcecreate(@NonNull SourceIdentifier identifier, @NonNull DOMSource source, @Nullable String symbolicName) Create a newYinDomSourceusing an identifier and a source.abstract DOMSourceReturn an XMLSourceof the YIN document.final Class<YinDomSource>getType()static @NonNull YinDomSourcelazyTransform(YinXmlSource xmlSchemaSource) Create aYinDomSourcefrom aYinXmlSource.final StringtoString()static @NonNull YinDomSourcetransform(YinXmlSource xmlSchemaSource) Create aYinDomSourcefrom aYinXmlSource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 newYinDomSourceusing an identifier and a source.- Parameters:
identifier- Schema source identifiersource- W3C DOM sourcesymbolicName- Source symbolic name- Returns:
- A new
YinDomSourceinstance.
-
lazyTransform
Create aYinDomSourcefrom 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 anIllegalStateExceptionmay be raised.- Parameters:
xmlSchemaSource- Backing schema source- Returns:
- A
YinDomSourceinstance
-
transform
public static @NonNull YinDomSource transform(YinXmlSource xmlSchemaSource) throws TransformerException Create aYinDomSourcefrom 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
YinDomSourceinstance - Throws:
TransformerException- when the provided source fails to transform
-
getType
- Specified by:
getTypein interfaceSourceRepresentation- Specified by:
getTypein interfaceYinSourceRepresentation- Specified by:
getTypein interfaceYinXmlSource
-
getSource
Description copied from interface:YinXmlSourceReturn an XMLSourceof the YIN document.- Specified by:
getSourcein interfaceYinXmlSource- Returns:
- An XML
Sourceinstance.
-
toString
-
addToStringAttributes
protected abstract com.google.common.base.MoreObjects.ToStringHelper addToStringAttributes(com.google.common.base.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.
-