Skip to content

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

Class YamlPrimitive

java.lang.Object
        io.github.qishr.cascara.common.lang.AbstractPrimitive
                io.github.qishr.cascara.lang.yaml.YamlPrimitive


public class YamlPrimitive
extends AbstractPrimitive

Constructor Summary

Constructor Description
YamlPrimitive(Object primitiveValue, QuoteStyle quoteStyle)
YamlPrimitive(Object primitiveValue)

Method Summary

Modifier and Type Method Description
public static YamlPrimitive fromString(String unescapedContent, QuoteStyle quoteStyle) Parses unescaped text and infers its type.
protected Object coerceLiteralValue(String text)
protected QuoteStyle inferQuoteStyle(Object value)
protected String unescapeQuotedString(String text, QuoteStyle style) Overrides the hook from AbstractPrimitive to handle YAML-specific string formatting

Methods inherited from AbstractPrimitive

setQuoteStyle, coerce, asInteger, toString, asBoolean, getQuoteStyle, equals, asString, asDouble, unwrap, hashCode

Method Details

fromString

public static YamlPrimitive fromString(String unescapedContent, QuoteStyle quoteStyle)

Parses unescaped text and infers its type.


coerceLiteralValue

protected Object coerceLiteralValue(String text)


inferQuoteStyle

protected QuoteStyle inferQuoteStyle(Object value)


unescapeQuotedString

protected String unescapeQuotedString(String text, QuoteStyle style)

Overrides the hook from AbstractPrimitive to handle YAML-specific string formatting