Package org.pkl.core.stdlib
Class AbstractRenderer
java.lang.Object
org.pkl.core.stdlib.AbstractRenderer
- All Implemented Interfaces:
VmValueVisitor
- Direct Known Subclasses:
AbstractStringRenderer,VmPklBinaryEncoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PklConverterprotected @Nullable com.oracle.truffle.api.source.SourceSectionThe (closest)SourceSectionof the value being visited, for better error messages.The value directly enclosing the currently visited value, if any.protected final StringThe name of this renderer. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRenderer(String name, PklConverter converter, boolean skipNullProperties, boolean skipNullEntries) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprotected booleancanRenderPropertyOrEntryOf(VmDynamic object) protected abstract voidendDynamic(VmDynamic value, boolean isEmpty) protected abstract voidprotected abstract voidendListing(VmListing value, boolean isEmpty) protected abstract voidprotected abstract voidendMapping(VmMapping value, boolean isEmpty) protected abstract voidprotected abstract voidprotected booleanisRenderDirective(Object value) protected booleanisRenderDirective(VmValue value) final voidrenderDocument(Object value) final voidrenderValue(Object value) protected abstract voidstartDynamic(VmDynamic value) protected abstract voidprotected abstract voidstartListing(VmListing value) protected abstract voidprotected abstract voidstartMapping(VmMapping value) protected abstract voidprotected abstract voidstartTyped(VmTyped value) voidvoidvisitClass(VmClass value) protected abstract voidvisitDocument(Object value) final voidvisitDynamic(VmDynamic value) protected abstract voidvisitElement(long index, Object value, boolean isFirst) protected abstract voidvisitEntryKey(Object key, boolean isFirst) protected voidvisitEntryKeyValue(Object key, boolean isFirst, Deque<Object> valuePath, Object value) protected abstract voidvisitEntryValue(Object value) voidvisitFunction(VmFunction value) final voidfinal voidvisitListing(VmListing value) final voidfinal voidvisitMapping(VmMapping value) protected abstract voidvisitProperty(Identifier name, Object value, boolean isFirst) protected abstract voidvisitRenderDirective(VmTyped value) Perform logic for rendering a render directive.final voidprotected abstract voidvisitTopLevelValue(Object value) voidvisitTypeAlias(VmTypeAlias value) voidvisitTyped(VmTyped value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pkl.core.runtime.VmValueVisitor
visitBoolean, visitBytes, visitDataSize, visitDuration, visitFloat, visitInt, visitIntSeq, visitNull, visitPair, visitRegex, visitString
-
Field Details
-
name
The name of this renderer. -
converter
-
currPath
-
enclosingValue
The value directly enclosing the currently visited value, if any. -
currSourceSection
The (closest)SourceSectionof the value being visited, for better error messages.
-
-
Constructor Details
-
AbstractRenderer
protected AbstractRenderer(String name, PklConverter converter, boolean skipNullProperties, boolean skipNullEntries)
-
-
Method Details
-
isRenderDirective
-
isRenderDirective
-
renderDocument
-
renderValue
-
visit
- Specified by:
visitin interfaceVmValueVisitor
-
visitDocument
-
visitTopLevelValue
-
visitRenderDirective
Perform logic for rendering a render directive. Render directives should be rendered verbatim. -
startDynamic
-
startTyped
-
startListing
-
startMapping
-
startList
-
startSet
-
startMap
-
visitElement
-
visitEntryKey
-
visitEntryValue
-
visitProperty
-
endDynamic
-
endTyped
-
endListing
-
endMapping
-
endList
-
endSet
-
endMap
-
visitTyped
- Specified by:
visitTypedin interfaceVmValueVisitor
-
visitDynamic
- Specified by:
visitDynamicin interfaceVmValueVisitor
-
canRenderPropertyOrEntryOf
-
visitListing
- Specified by:
visitListingin interfaceVmValueVisitor
-
visitMapping
- Specified by:
visitMappingin interfaceVmValueVisitor
-
visitList
- Specified by:
visitListin interfaceVmValueVisitor
-
visitSet
- Specified by:
visitSetin interfaceVmValueVisitor
-
visitMap
- Specified by:
visitMapin interfaceVmValueVisitor
-
visitEntryKeyValue
-
cannotRenderTypeAddConverter
-
visitTypeAlias
- Specified by:
visitTypeAliasin interfaceVmValueVisitor
-
visitClass
- Specified by:
visitClassin interfaceVmValueVisitor
-
visitFunction
- Specified by:
visitFunctionin interfaceVmValueVisitor
-
cannotRenderNonStringKey
-
cannotRenderNonScalarKey
-