类 AbstractArchiveChartWriter
- java.lang.Object
-
- org.microbean.helm.chart.AbstractChartWriter
-
- org.microbean.helm.chart.AbstractArchiveChartWriter
-
- 所有已实现的接口:
Closeable,AutoCloseable
- 直接已知子类:
TapeArchiveChartWriter
public abstract class AbstractArchiveChartWriter extends AbstractChartWriter
A partialAbstractChartWriterwhose implementations saveChartOuterClass.ChartOrBuilderobjects to a destination that can be considered an archive of some sort.- 作者:
- Laird Nelson
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.microbean.helm.chart.AbstractChartWriter
AbstractChartWriter.Context
-
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractArchiveChartWriter()Creates a newAbstractArchiveChartWriter.
-
方法概要
-
从类继承的方法 org.microbean.helm.chart.AbstractChartWriter
createYaml, toYAML, write, write, writeSubchart
-
-
-
-
构造器详细资料
-
AbstractArchiveChartWriter
protected AbstractArchiveChartWriter()
Creates a newAbstractArchiveChartWriter.
-
-
方法详细资料
-
beginWrite
protected void beginWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
A callback method invoked when theAbstractChartWriter.write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked.The default implementation of this method does nothing.
The
AbstractArchiveChartWriterimplementation stores aStringrepresenting the required path layout under a "path" key in the suppliedAbstractChartWriter.Context.- 覆盖:
beginWrite在类中AbstractChartWriter- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullparent- theChartOuterClass.ChartOrBuilderfunctioning as the parent chart; may be, and often is,null; must not be identical to thechartBuilderparameter valuechartBuilder- theChartOuterClass.ChartOrBuilderto actually write; must not benull; must not be identical to theparentparameter value- 抛出:
IOException- if a write error occurs
-
writeMetadata
protected void writeMetadata(AbstractChartWriter.Context context, MetadataOuterClass.MetadataOrBuilder metadata) throws IOException
A callback method invoked when theAbstractChartWriter.write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantMetadataOuterClass.MetadataOrBuilderobject.The
AbstractArchiveChartWriterimplementation writes the YAML representation of the suppliedMetadataOuterClass.MetadataOrBuilderto an appropriate archive entry namedChart.yamlwithin the current chart path.- 指定者:
writeMetadata在类中AbstractChartWriter- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullmetadata- theMetadataOuterClass.MetadataOrBuilderto write; must not benull- 抛出:
NullPointerException- if eithercontextormetadataisnullIOException- if a write error occurs
-
writeConfig
protected void writeConfig(AbstractChartWriter.Context context, ConfigOuterClass.ConfigOrBuilder config) throws IOException
A callback method invoked when theAbstractChartWriter.write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantConfigOuterClass.ConfigOrBuilderobject.This implementation writes the YAML representation of the supplied
ConfigOuterClass.ConfigOrBuilderto an appropriate archive entry namedvalues.yamlwithin the current chart path.- 指定者:
writeConfig在类中AbstractChartWriter- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullconfig- theConfigOuterClass.ConfigOrBuilderto write; must not benull- 抛出:
NullPointerException- ifcontextisnullIOException- if a write error occurs
-
writeTemplate
protected void writeTemplate(AbstractChartWriter.Context context, TemplateOuterClass.TemplateOrBuilder template) throws IOException
A callback method invoked when theAbstractChartWriter.write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantTemplateOuterClass.TemplateOrBuilderobject.This implementation writes the data of the supplied
TemplateOuterClass.TemplateOrBuilderto an appropriate archive entry named in part by the return value of theTemplateOuterClass.TemplateOrBuilder.getName()method within the current chart path.- 指定者:
writeTemplate在类中AbstractChartWriter- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benulltemplate- theTemplateOuterClass.TemplateOrBuilderto write; must not benull- 抛出:
NullPointerException- ifcontextisnullIOException- if a write error occurs
-
writeFile
protected void writeFile(AbstractChartWriter.Context context, com.google.protobuf.AnyOrBuilder file) throws IOException
A callback method invoked when theAbstractChartWriter.write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantAnyOrBuilderobject (representing an otherwise undifferentiated Helm chart file).This implementation writes the contents of the supplied
AnyOrBuilderto an appropriate archive entry named in part by the return value of theAnyOrBuilder.getTypeUrl()method within the current chart path.- 指定者:
writeFile在类中AbstractChartWriter- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullfile- theAnyOrBuilderto write; must not benull- 抛出:
NullPointerException- ifcontextisnullIOException- if a write error occurs
-
endWrite
protected void endWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
A callback method invoked when theAbstractChartWriter.write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to end the write operation.The default implementation of this method does nothing.
This implementation ensures that the current chart path, residing under the "
path" key in the suppliedAbstractChartWriter.Context, is reset properly.- 覆盖:
endWrite在类中AbstractChartWriter- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullparent- theChartOuterClass.ChartOrBuilderrepresenting the Helm chart that parents thechartBuilderparameter value; may be, and often is,nullchartBuilder- theChartOuterClass.ChartOrBuilderrepresenting the chart currently involved in the write operation; must not benull- 抛出:
NullPointerException- if eithercontextorchartBuilderisnullIOException- if a write error occurs
-
writeEntry
protected abstract void writeEntry(AbstractChartWriter.Context context, String path, String contents) throws IOException
Writes the suppliedcontentsto an appropriate archive entry that is expected to be suffixed with the suppliedpathin the context of the write operation described by the suppliedAbstractChartWriter.Context.- 参数:
context- theAbstractChartWriter.Contextdescribing the write operation in effect; must not benullpath- the path within an abstract archive to write; interpreted as being relative to the current notional chart path, whatever that might be; must not benullor emptycontents- the contents to write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- ifcontext,pathorcontentsisnullIllegalArgumentException- ifpathis empty
-
-