Skip to content

Package io.github.qishr.cascara.lang.yaml.processor

Class YamlSerializer

java.lang.Object
        io.github.qishr.cascara.common.lang.processor.AbstractSerializer<io.github.qishr.cascara.lang.yaml.processor.YamlSerializer, io.github.qishr.cascara.lang.yaml.ast.YamlNode, io.github.qishr.cascara.lang.yaml.ast.YamlScalar, io.github.qishr.cascara.lang.yaml.ast.YamlSequence, io.github.qishr.cascara.lang.yaml.ast.YamlMap, io.github.qishr.cascara.lang.yaml.ast.YamlMapEntry, io.github.qishr.cascara.lang.yaml.ast.YamlNode>
                io.github.qishr.cascara.lang.yaml.processor.YamlSerializer


public class YamlSerializer
extends AbstractSerializer<YamlSerializer, YamlNode, YamlScalar, YamlSequence, YamlMap, YamlMapEntry, YamlNode>

Standard implementation for YAML serialization.

Constructor Summary

Constructor Description
YamlSerializer()

Method Summary

Modifier and Type Method Description
public YamlSerializer self()
public ContentType getContentType()
public YamlSerializer setReporter(Reporter reporter)
public YamlSerializer setOptions(LanguageOptions<?> options)
public YamlSerializer setParser(AstParser<YamlNode, ?, ?> parser)
public String toString(Object jvmInstance)
public void toWriter(Object jvmInstance, Writer writer)
public YamlNode toAst(Object jvmInstance)
public C fromString(String text, Class jvmType)
public C fromString(String text, TypeReference typeRef)
public C fromReader(Reader reader, Class jvmType)
public C fromReader(Reader reader, TypeReference typeRef)
public C fromStream(InputStream is, Class jvmType)
public C fromStream(InputStream is, TypeReference typeRef)
public C fromAst(YamlNode astNode, Class jvmType)
public C fromAst(YamlNode astNode, TypeReference typeRef)
protected YamlNode serializeKey(Object key)
protected void setupSerializer()
protected void error(YamlNode node, DiagnosticCode code, Object[] details)
protected void warn(YamlToken token, DiagnosticCode code, Object[] details)
protected String debugNode(YamlNode node)
protected void debugStringBuilder()
protected void report(Level level, String message, Object[] details)

Methods inherited from AbstractSerializer

serializeObject, warn, trace, getAllMethods, error, serialize, serializeMap, getTypeDescriptor, debug, serializeList, warnInaccessible, deserialize, getAllFields, getServiceProperties, deserialize, registerTypeDescriptor, warnInaccessible

Method Details

self

public YamlSerializer self()

Overrides:

AbstractSerializer


getContentType

public ContentType getContentType()


setReporter

public YamlSerializer setReporter(Reporter reporter)


setOptions

public YamlSerializer setOptions(LanguageOptions<?> options)

Overrides:

AbstractSerializer


setParser

public YamlSerializer setParser(AstParser<YamlNode, ?, ?> parser)


toString

public String toString(Object jvmInstance)


toWriter

public void toWriter(Object jvmInstance, Writer writer)

Throws:

IOException


toAst

public YamlNode toAst(Object jvmInstance)


fromString

public C fromString(String text, Class jvmType)


fromString

public C fromString(String text, TypeReference typeRef)


fromReader

public C fromReader(Reader reader, Class jvmType)


fromReader

public C fromReader(Reader reader, TypeReference typeRef)


fromStream

public C fromStream(InputStream is, Class jvmType)


fromStream

public C fromStream(InputStream is, TypeReference typeRef)


fromAst

public C fromAst(YamlNode astNode, Class jvmType)


fromAst

public C fromAst(YamlNode astNode, TypeReference typeRef)


serializeKey

protected YamlNode serializeKey(Object key)

Overrides:

AbstractSerializer


setupSerializer

protected void setupSerializer()


error

protected void error(YamlNode node, DiagnosticCode code, Object[] details)


warn

protected void warn(YamlToken token, DiagnosticCode code, Object[] details)


debugNode

protected String debugNode(YamlNode node)


debugStringBuilder

protected void debugStringBuilder()


report

protected void report(Level level, String message, Object[] details)