Class AbstractGeneratedTextFile
- java.lang.Object
-
- org.opendaylight.yangtools.plugin.generator.api.AbstractGeneratedFile
-
- org.opendaylight.yangtools.plugin.generator.api.AbstractGeneratedTextFile
-
- All Implemented Interfaces:
Immutable
,MutationBehaviour<Immutable>
,GeneratedFile
@Beta @NonNullByDefault public abstract class AbstractGeneratedTextFile extends AbstractGeneratedFile
The contents of a generated file and itsGeneratedFileLifecycle
. This class is suitable for text files, for binary files seeAbstractGeneratedFile
. Text files are encoded inStandardCharsets.UTF_8
.- Author:
- Robert Varga
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractGeneratedTextFile(GeneratedFileLifecycle lifecycle)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
writeBody(OutputStream output)
Write the body of this file into specifiedOutputStream
.protected abstract void
writeBody(Writer output)
Write the body of this file into specifiedWriter
.-
Methods inherited from class org.opendaylight.yangtools.plugin.generator.api.AbstractGeneratedFile
addToStringAttributes, getLifecycle, toString
-
-
-
-
Constructor Detail
-
AbstractGeneratedTextFile
protected AbstractGeneratedTextFile(GeneratedFileLifecycle lifecycle)
-
-
Method Detail
-
writeBody
public final void writeBody(OutputStream output) throws IOException
Description copied from interface:GeneratedFile
Write the body of this file into specifiedOutputStream
.- Parameters:
output
- stream where to write the output- Throws:
IOException
- when the stream reports an IOException
-
writeBody
protected abstract void writeBody(Writer output) throws IOException
Write the body of this file into specifiedWriter
.- Parameters:
output
- writer where to write the output- Throws:
IOException
- when the stream reports an IOException
-
-