class OrdinalRenderer implements EnumeratedOrdinalRenderer {
        final EnumeratedReferenceNodeRenderer renderer;
        final NodeRendererContext context;
        final HtmlWriter html;

        public OrdinalRenderer(EnumeratedReferenceNodeRenderer renderer, NodeRendererContext context, HtmlWriter html) {
            this.renderer = renderer;
            this.context = context;
            this.html = html;
        }

        @Override
        public void startRendering(EnumeratedReferenceRendering[] renderings) {

        }

        @Override
        public void setEnumOrdinalRunnable(Runnable runnable) {
            renderer.ordinalRunnable = runnable;
        }

        @Override
        public Runnable getEnumOrdinalRunnable() {
            return renderer.ordinalRunnable;
        }

        @Override
        public void render(int referenceOrdinal, EnumeratedReferenceBlock referenceFormat, String defaultText, boolean needSeparator) {<FILL_FUNCTION_BODY>}

        @Override
        public void endRendering() {

        }
    }

            Runnable compoundRunnable = renderer.ordinalRunnable;

            if (referenceFormat != null) {
                renderer.ordinalRunnable = () -> {
                    if (compoundRunnable != null) compoundRunnable.run();
                    html.text(String.valueOf(referenceOrdinal));
                    if (needSeparator) html.text(".");
                };

                context.renderChildren(referenceFormat);
            } else {
                html.text(defaultText + " ");
                if (compoundRunnable != null) compoundRunnable.run();
                html.text(String.valueOf(referenceOrdinal));
                if (needSeparator) html.text(".");
            }
        
<no_super_class>