API Reference 0.3.24dart_web_toolkit_textPassthroughRenderer

PassthroughRenderer class

A no-op String renderer. This is rarely or never the right thing to use in production, but it's handy for tests.

class PassthroughRenderer extends AbstractRenderer<String> {

 static PassthroughRenderer _instance;

 /**
  * Returns the instance of the no-op renderer.
  */
 factory PassthroughRenderer.instance() {
   if (_instance == null) {
     _instance = new PassthroughRenderer();
   }
   return _instance;
 }

 PassthroughRenderer();

 String render(String object) {
   return object;
 }
}

Extends

AbstractRenderer<String> > PassthroughRenderer

Constructors

new PassthroughRenderer() #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
PassthroughRenderer();

factory PassthroughRenderer.instance() #

Returns the instance of the no-op renderer.

factory PassthroughRenderer.instance() {
 if (_instance == null) {
   _instance = new PassthroughRenderer();
 }
 return _instance;
}

Methods

String render(String object) #

Renders {@code object} as plain text. Should never throw any exceptions!

docs inherited from Renderer<T>
String render(String object) {
 return object;
}

void renderTo(T object, Appendable appendable) #

inherited from AbstractRenderer

Renders {@code object} as plain text, appended directly to {@code appendable}. Should never throw any exceptions except if {@code appendable} throws an {@code IOException}.

void renderTo(T object, Appendable appendable) {
 appendable.append(render(object));
}