类 AbstractChartWriter
- java.lang.Object
-
- org.microbean.helm.chart.AbstractChartWriter
-
- 所有已实现的接口:
Closeable,AutoCloseable
- 直接已知子类:
AbstractArchiveChartWriter
public abstract class AbstractChartWriter extends Object implements Closeable
An object capable of writing or serializing or otherwise representing aChartOuterClass.ChartOrBuilder.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static classAbstractChartWriter.ContextA class representing the state of a write operation.
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractChartWriter()Creates a newAbstractChartWriter.
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected voidbeginWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked.protected org.yaml.snakeyaml.YamlcreateYaml()Creates and returns a newYamlinstance for (optional) use in writingConfigOuterClass.ConfigOrBuilderandMetadataOuterClass.MetadataOrBuilderobjects.protected voidendWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to end the write operation.protected StringtoYAML(AbstractChartWriter.Context context, Object data)Marshals the suppliedObjectto YAML in the context of the suppliedAbstractChartWriter.Contextand returns the result.voidwrite(ChartOuterClass.ChartOrBuilder chartBuilder)Writes or serializes or otherwise represents the suppliedChartOuterClass.ChartOrBuilder.protected voidwrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder)Writes or serializes or otherwise represents the suppliedchartBuilderas a subchart of the suppliedparent(which may be, and often is,null).protected abstract voidwriteConfig(AbstractChartWriter.Context context, ConfigOuterClass.ConfigOrBuilder config)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantConfigOuterClass.ConfigOrBuilderobject.protected abstract voidwriteFile(AbstractChartWriter.Context context, com.google.protobuf.AnyOrBuilder file)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantAnyOrBuilderobject (representing an otherwise undifferentiated Helm chart file).protected abstract voidwriteMetadata(AbstractChartWriter.Context context, MetadataOuterClass.MetadataOrBuilder metadata)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantMetadataOuterClass.MetadataOrBuilderobject.protected voidwriteSubchart(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder subchart)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantChartOuterClass.ChartOrBuilderobject (representing a subchart within an encompassing parent Helm chart).protected abstract voidwriteTemplate(AbstractChartWriter.Context context, TemplateOuterClass.TemplateOrBuilder template)A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantTemplateOuterClass.TemplateOrBuilderobject.
-
-
-
构造器详细资料
-
AbstractChartWriter
protected AbstractChartWriter()
Creates a newAbstractChartWriter.
-
-
方法详细资料
-
write
public final void write(ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
Writes or serializes or otherwise represents the suppliedChartOuterClass.ChartOrBuilder.- 参数:
chartBuilder- theChartOuterClass.ChartOrBuilderto write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- ifchartBuilderisnullIllegalArgumentException- if theChartOuterClass.ChartOrBuilder.getMetadata()method returnsnull, or if theMetadataOuterClass.MetadataOrBuilder.getName()method returnsnull, or if theMetadataOuterClass.MetadataOrBuilder.getVersion()method returnsnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it- 另请参阅:
write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
-
write
protected void write(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
Writes or serializes or otherwise represents the suppliedchartBuilderas a subchart of the suppliedparent(which may be, and often is,null).- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; may 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 occursNullPointerException- ifchartBuilderisnullIllegalArgumentException- ifparentis identical tochartBuilder, or if theChartOuterClass.ChartOrBuilder.getMetadata()method returnsnull, or if theMetadataOuterClass.MetadataOrBuilder.getName()method returnsnull, or if theMetadataOuterClass.MetadataOrBuilder.getVersion()method returnsnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it- 另请参阅:
beginWrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder),writeMetadata(Context, MetadataOuterClass.MetadataOrBuilder),writeConfig(Context, ConfigOuterClass.ConfigOrBuilder),writeTemplate(Context, TemplateOuterClass.TemplateOrBuilder),writeFile(Context, AnyOrBuilder),writeSubchart(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder),endWrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
-
createYaml
protected org.yaml.snakeyaml.Yaml createYaml()
Creates and returns a newYamlinstance for (optional) use in writingConfigOuterClass.ConfigOrBuilderandMetadataOuterClass.MetadataOrBuilderobjects.This method never returns
null.Overrides of this method must not return
null.Behavior is undefined if overrides of this method interact with other methods defined by this class.
- 返回:
- a non-
nullYamlinstance
-
toYAML
protected final String toYAML(AbstractChartWriter.Context context, Object data) throws IOException
Marshals the suppliedObjectto YAML in the context of the suppliedAbstractChartWriter.Contextand returns the result.This method never returns
null.This method may call the
createYaml()method.- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benulldata- theObjectto convert to its YAML representation; may benull- 返回:
- a non-
nullStringconsisting of the appropriate YAML represesentation of the supplieddata - 抛出:
IOException- if a YAML serialization error occursNullPointerException- ifcontextisnull- 另请参阅:
createYaml(),Yaml.dumpAsMap(Object)
-
beginWrite
protected void beginWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked.The default implementation of this method does nothing.
- 参数:
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 occursNullPointerException- if eithercontextorchartBuilderisnullIllegalArgumentException- ifparentis identical tochartBuilderIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method for some reason
-
writeMetadata
protected abstract void writeMetadata(AbstractChartWriter.Context context, MetadataOuterClass.MetadataOrBuilder metadata) throws IOException
A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantMetadataOuterClass.MetadataOrBuilderobject.- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullmetadata- theMetadataOuterClass.MetadataOrBuilderto write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- if eithercontextormetadataisnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method
-
writeConfig
protected abstract void writeConfig(AbstractChartWriter.Context context, ConfigOuterClass.ConfigOrBuilder config) throws IOException
A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantConfigOuterClass.ConfigOrBuilderobject.- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullconfig- theConfigOuterClass.ConfigOrBuilderto write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- if eithercontextorconfigisnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method
-
writeTemplate
protected abstract void writeTemplate(AbstractChartWriter.Context context, TemplateOuterClass.TemplateOrBuilder template) throws IOException
A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantTemplateOuterClass.TemplateOrBuilderobject.- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benulltemplate- theTemplateOuterClass.TemplateOrBuilderto write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- if eithercontextortemplateisnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method for some reason
-
writeFile
protected abstract void writeFile(AbstractChartWriter.Context context, com.google.protobuf.AnyOrBuilder file) throws IOException
A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantAnyOrBuilderobject (representing an otherwise undifferentiated Helm chart file).- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullfile- theAnyOrBuilderto write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- if eithercontextorfileisnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method for some reason
-
writeSubchart
protected void writeSubchart(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder subchart) throws IOException
A callback method invoked when thewrite(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method has been invoked and it is time to write a relevantChartOuterClass.ChartOrBuilderobject (representing a subchart within an encompassing parent Helm chart).The default implementation of this method calls the
write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)method.- 参数:
context- theAbstractChartWriter.Contextrepresenting the write operation; must not benullparent- theChartOuterClass.ChartOrBuilderrepresenting the Helm chart that parents thesubchartparameter value; must not benullsubchart- theChartOuterClass.ChartOrBuilderrepresenting the subchart to write; must not benull- 抛出:
IOException- if a write error occursNullPointerException- if eithercontextorparentorsubchartisnullIllegalArgumentException- ifparentis identical tosubchart, or if theChartOuterClass.ChartOrBuilder.getMetadata()method returnsnullwhen invoked on either non-nullChartOuterClass.ChartOrBuilder, or if theMetadataOuterClass.MetadataOrBuilder.getName()method returnsnull, or if theMetadataOuterClass.MetadataOrBuilder.getVersion()method returnsnullIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method for some reason- 另请参阅:
write(Context, ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
-
endWrite
protected void endWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
A callback method invoked when thewrite(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.
- 参数:
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- 抛出:
IOException- if a write error occursNullPointerException- if eithercontextorchartBuilderisnullIllegalArgumentException- ifparentis identical tochartBuilderIllegalStateException- if a subclass has overridden thecreateYaml()method to returnnulland calls it from this method for some reason
-
-