public class

HtmlInterpreter

extends Object
implements XMLElement.Interpreter<T>
java.lang.Object
   ↳ com.google.gwt.uibinder.elementparsers.HtmlInterpreter

Class Overview

This is the most generally useful interpreter, and the most likely to be used by a custom parser when calling consumeInnerHtml(XMLElement.Interpreter).

  • Assigns computed values to element attributes (e.g. class="{style.pretty}")
  • Generates fields to hold named dom elements (e.g. <div gwt:field="importantDiv">)
  • Turns <ui:msg> and <ui:attr> elements into methods on a generated Messages interface
  • Fails if any element encountered is a widget

Summary

Public Constructors
HtmlInterpreter(UiBinderWriter writer, String ancestorExpression, Interpreter<String> messageInterpreter)
Rather than using this constructor, you probably want to use the newInterpreterForUiObject(UiBinderWriter, String) factory method.
Public Methods
String interpretElement(XMLElement elem)
Given an XMLElement, return its filtered value.
static HtmlInterpreter newInterpreterForUiObject(UiBinderWriter writer, String uiExpression)
A convenience factory method for the most common use of this class, to work with HTML that will eventually be rendered under a UIObject (or really, any object that responds to getElement()).
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gwt.uibinder.rebind.XMLElement.Interpreter

Public Constructors

public HtmlInterpreter (UiBinderWriter writer, String ancestorExpression, Interpreter<String> messageInterpreter)

Rather than using this constructor, you probably want to use the newInterpreterForUiObject(UiBinderWriter, String) factory method.

Parameters
ancestorExpression An expression that can be evaluated at runtime to find an Element that will be an ancestor of all Elements generated from the interpreted HTML.
messageInterpreter an interpreter to handle msg and ph elements, typically an instance of HtmlMessageInterpreter. This interpreter gets last crack

Public Methods

public String interpretElement (XMLElement elem)

Given an XMLElement, return its filtered value.

Throws
UnableToCompleteException

public static HtmlInterpreter newInterpreterForUiObject (UiBinderWriter writer, String uiExpression)

A convenience factory method for the most common use of this class, to work with HTML that will eventually be rendered under a UIObject (or really, any object that responds to getElement()). Uses an instance of HtmlMessageInterpreter to process message elements.

Parameters
uiExpression An expression that can be evaluated at runtime to find an object whose getElement() method can be called to get an ancestor of all Elements generated from the interpreted HTML.