Package org.pkl.core
Class ValueRenderers
java.lang.Object
org.pkl.core.ValueRenderers
Predefined
ValueRenderers for Pcf, JSON, YAML, and XML property lists.-
Method Summary
Modifier and TypeMethodDescriptionstatic ValueRendererCreates a renderer for JSON.static ValueRendererCreates a renderer for Pcf, a static subset of Pkl.static ValueRendererCreates a renderer for XML property lists.static ValueRendererproperties(Writer writer, boolean omitNullProperties, boolean restrictCharset) Creates a renderer forPropertiesfile format.static ValueRendererCreates a renderer for YAML.
-
Method Details
-
pcf
public static ValueRenderer pcf(Writer writer, String indent, boolean omitNullProperties, boolean useCustomStringDelimiters) Creates a renderer for Pcf, a static subset of Pkl. IfomitNullPropertiesistrue, object properties whose value isnullwill not be rendered. IfuseCustomDelimitersistrue, custom string delimiters (such as#"..."#) are preferred over escaping quotes and backslashes. -
json
Creates a renderer for JSON. IfomitNullPropertiesistrue, object properties whose value isnullwill not be rendered. -
yaml
public static ValueRenderer yaml(Writer writer, int indent, boolean omitNullProperties, boolean isStream) Creates a renderer for YAML. IfomitNullPropertiesistrue, object properties whose value isnullwill not be rendered. IfisStreamistrue,ValueRenderer.renderDocument(java.lang.Object)expects an argument of typeIterableand renders it as YAML stream. -
plist
Creates a renderer for XML property lists. -
properties
public static ValueRenderer properties(Writer writer, boolean omitNullProperties, boolean restrictCharset) Creates a renderer forPropertiesfile format. IfomitNullPropertiesistrue, object properties and map entries whose value isnullwill not be rendered. IfrestrictCharsetistruecharacters outside the printable US-ASCII charset range will be rendered as Unicode escapes.
-