Class FileYangTextSource
java.lang.Object
com.google.common.io.CharSource
org.opendaylight.yangtools.yang.model.api.source.YangTextSource
org.opendaylight.yangtools.yang.model.spi.source.FileYangTextSource
- All Implemented Interfaces:
Delegator<Path>,Immutable,SourceRepresentation,YangSourceRepresentation
A
YangTextSource backed by a file.-
Constructor Summary
ConstructorsConstructorDescriptionFileYangTextSource(Path path) Utility constructor.FileYangTextSource(SourceIdentifier sourceId, Path path, Charset charset) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.common.base.MoreObjects.ToStringHelperaddToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper) final Pathfinal Readerfinal SourceIdentifiersourceId()final @NonNull StringMethods inherited from class org.opendaylight.yangtools.yang.model.api.source.YangTextSource
getType, toStringMethods inherited from class com.google.common.io.CharSource
asByteSource, concat, concat, concat, copyTo, copyTo, empty, forEachLine, isEmpty, length, lengthIfKnown, lines, openBufferedStream, read, readFirstLine, readLines, readLines, wrap
-
Constructor Details
-
FileYangTextSource
Default constructor.- Parameters:
path- Backing pathsourceId- source identifiercharset- expected stream character set- Throws:
NullPointerException- if any argument isnullIllegalArgumentException- if the supplied path is not a regular file
-
FileYangTextSource
Utility constructor. Derives theSourceIdentifierfromPathand assumes UTF-8 encoding.- Parameters:
path- backing path- Throws:
NullPointerException- ifpathisnull
-
-
Method Details
-
openStream
- Specified by:
openStreamin classcom.google.common.io.CharSource- Throws:
IOException
-
symbolicName
-
addToStringAttributes
protected com.google.common.base.MoreObjects.ToStringHelper addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper) - Overrides:
addToStringAttributesin classYangTextSource
-
sourceId
- Specified by:
sourceIdin interfaceSourceRepresentation
-
getDelegate
- Specified by:
getDelegatein interfaceDelegator<T>
-