The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RapidApp::Web1RenderContext::RenderByType

SYNOPSIS

  my $renderer= RapidApp::Web1RenderContext::RenderByType->new;
  $renderer->apply_rendererByRef(
    HASH => $myHashRenderer,
    'Some::Class' => $myCustomRenderer,
  );
  my $cx= RapidApp::Web1RenderContext->new( renderer => $renderer );
  $cx->render($treeOfObjects);

DESCRIPTION

This module is a Web 1.0 Renderer which simply refers to a lookup table by ref type to find the correct renderer for a given perl object. It can also associate renderers with ref types of 'HASH', 'ARRAY', 'REF', and so on.

findRendererForRef

Attempt to find the most appropriate renderer for a given data item.

We give first precedence to explicitly configured ref types.

If nothing was configured for that exact type, we walk up the ISA tree checking to see if each parent class was explicitly configured, or if we have a render_TYPE method for it, or if it has a "renderAsHtml" method.

makeRendererForMethod( $methodName )

If the named method exists, this returns a Renderer object which calls that method on $self. If it doesn't exist, this returns undef.