Class AbstractRenderer

    • Field Detail

      • name

        protected final java.lang.String name
        The name of this renderer.
      • builder

        protected final java.lang.StringBuilder builder
      • indent

        protected final java.lang.String indent
        The indent to be used.
      • currPath

        protected java.util.Deque<java.lang.Object> currPath
      • enclosingValue

        protected @Nullable VmValue enclosingValue
        The value directly enclosing the currently visited value, if any.
      • currSourceSection

        protected @Nullable com.oracle.truffle.api.source.SourceSection currSourceSection
        The (closest) SourceSection of the value being visited, for better error messages.
    • Constructor Detail

      • AbstractRenderer

        public AbstractRenderer​(java.lang.String name,
                                java.lang.StringBuilder builder,
                                java.lang.String indent,
                                PklConverter converter,
                                boolean skipNullProperties,
                                boolean skipNullEntries)
    • Method Detail

      • renderDocument

        public final void renderDocument​(java.lang.Object value)
      • renderValue

        public final void renderValue​(java.lang.Object value)
      • visit

        public void visit​(java.lang.Object value)
        Specified by:
        visit in interface VmValueVisitor
      • visitDocument

        protected abstract void visitDocument​(java.lang.Object value)
      • visitTopLevelValue

        protected abstract void visitTopLevelValue​(java.lang.Object value)
      • visitRenderDirective

        protected abstract void visitRenderDirective​(VmTyped value)
        Perform logic for rendering a render directive. Render directives should be rendered verbatim.
      • startDynamic

        protected abstract void startDynamic​(VmDynamic value)
      • startTyped

        protected abstract void startTyped​(VmTyped value)
      • startListing

        protected abstract void startListing​(VmListing value)
      • startMapping

        protected abstract void startMapping​(VmMapping value)
      • startList

        protected abstract void startList​(VmList value)
      • startSet

        protected abstract void startSet​(VmSet value)
      • startMap

        protected abstract void startMap​(VmMap value)
      • visitElement

        protected abstract void visitElement​(long index,
                                             java.lang.Object value,
                                             boolean isFirst)
        Visits an element of a VmDynamic, VmListing, VmList, or VmSet.
      • visitEntryKey

        protected abstract void visitEntryKey​(java.lang.Object key,
                                              boolean isFirst)
        Visits an entry key of a VmDynamic, VmMapping, or VmMap.
      • visitEntryValue

        protected abstract void visitEntryValue​(java.lang.Object value)
        Visits an entry value of a VmDynamic, VmMapping, or VmMap.
      • visitProperty

        protected abstract void visitProperty​(Identifier name,
                                              java.lang.Object value,
                                              boolean isFirst)
        Visits a property of a VmDynamic or VmTyped.
      • endDynamic

        protected abstract void endDynamic​(VmDynamic value,
                                           boolean isEmpty)
      • endTyped

        protected abstract void endTyped​(VmTyped value,
                                         boolean isEmpty)
      • endListing

        protected abstract void endListing​(VmListing value,
                                           boolean isEmpty)
      • endMapping

        protected abstract void endMapping​(VmMapping value,
                                           boolean isEmpty)
      • endList

        protected abstract void endList​(VmList value)
      • endSet

        protected abstract void endSet​(VmSet value)
      • endMap

        protected abstract void endMap​(VmMap value)
      • canRenderPropertyOrEntryOf

        protected boolean canRenderPropertyOrEntryOf​(VmDynamic object)
      • cannotRenderTypeAddConverter

        protected void cannotRenderTypeAddConverter​(VmValue value)
      • cannotRenderNonStringKey

        protected void cannotRenderNonStringKey​(java.lang.Object key)
      • increaseIndent

        protected void increaseIndent()
      • decreaseIndent

        protected void decreaseIndent()