@Beta public abstract class YangTextSchemaSource extends com.google.common.io.ByteSource implements YangSchemaSourceRepresentation
InputStream
.Modifier | Constructor and Description |
---|---|
protected |
YangTextSchemaSource(SourceIdentifier identifier) |
Modifier and Type | Method and Description |
---|---|
protected abstract com.google.common.base.MoreObjects.ToStringHelper |
addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper)
Add subclass-specific attributes to the output
toString() output. |
static YangTextSchemaSource |
delegateForByteSource(SourceIdentifier identifier,
com.google.common.io.ByteSource delegate)
Create a new YangTextSchemaSource with a specific source identifier and backed
by ByteSource, which provides the actual InputStreams.
|
static YangTextSchemaSource |
delegateForByteSource(String fileName,
com.google.common.io.ByteSource delegate)
Create a new YangTextSchemaSource with
SourceIdentifier derived from a supplied filename and backed
by ByteSource, which provides the actual InputStreams. |
static YangTextSchemaSource |
forFile(File file)
Create a new YangTextSchemaSource backed by a
File with SourceIdentifier derived from the file
name. |
static ResourceYangTextSchemaSource |
forResource(Class<?> clazz,
String resourceName)
Create a new
YangTextSchemaSource backed by a resource by a resource available on the ClassLoader
which loaded the specified class. |
static ResourceYangTextSchemaSource |
forResource(String resourceName)
Create a new
YangTextSchemaSource backed by a resource available in the ClassLoader where this
class resides. |
SourceIdentifier |
getIdentifier()
Return this objects Identifier.
|
Class<? extends YangTextSchemaSource> |
getType()
Return the concrete representation type.
|
static SourceIdentifier |
identifierFromFilename(String name) |
String |
toString() |
asCharSource, concat, concat, concat, contentEquals, copyTo, copyTo, empty, hash, isEmpty, openBufferedStream, openStream, read, read, size, sizeIfKnown, slice, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSymbolicName
protected YangTextSchemaSource(SourceIdentifier identifier)
public static SourceIdentifier identifierFromFilename(String name)
public static YangTextSchemaSource delegateForByteSource(SourceIdentifier identifier, com.google.common.io.ByteSource delegate)
identifier
- SourceIdentifier of the resulting schema sourcedelegate
- Backing ByteSource instancepublic static YangTextSchemaSource delegateForByteSource(String fileName, com.google.common.io.ByteSource delegate)
SourceIdentifier
derived from a supplied filename and backed
by ByteSource, which provides the actual InputStreams.fileName
- File namedelegate
- Backing ByteSource instanceIllegalArgumentException
- if the file name has invalid formatpublic static YangTextSchemaSource forFile(File file)
File
with SourceIdentifier
derived from the file
name.file
- Backing FileIllegalArgumentException
- if the file name has invalid format or if the supplied File is not a fileNullPointerException
- if file is nullpublic static ResourceYangTextSchemaSource forResource(String resourceName)
YangTextSchemaSource
backed by a resource available in the ClassLoader where this
class resides.resourceName
- Resource nameIllegalArgumentException
- if the resource does not exist or if the name has invalid formatpublic static ResourceYangTextSchemaSource forResource(Class<?> clazz, String resourceName)
YangTextSchemaSource
backed by a resource by a resource available on the ClassLoader
which loaded the specified class.clazz
- Class referenceresourceName
- Resource nameIllegalArgumentException
- if the resource does not exist or if the name has invalid formatpublic final SourceIdentifier getIdentifier()
Identifiable
getIdentifier
in interface Identifiable<SourceIdentifier>
getIdentifier
in interface SchemaSourceRepresentation
@Nonnull public Class<? extends YangTextSchemaSource> getType()
YangSchemaSourceRepresentation
getType
in interface SchemaSourceRepresentation
getType
in interface YangSchemaSourceRepresentation
protected abstract com.google.common.base.MoreObjects.ToStringHelper addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper)
toString()
output. Since
subclasses are prevented from overriding toString()
for consistency
reasons, they can add their specific attributes to the resulting string by attaching
attributes to the supplied MoreObjects.ToStringHelper
.toStringHelper
- ToStringHelper onto the attributes can be addedCopyright © 2019 OpenDaylight. All rights reserved.