Skip to content
l0rdn1kk0n edited this page Jul 16, 2012 · 5 revisions

Components

assertTag

The Components.assertTag helper method verifies that the given component tag matches the given tag name, if not a MarkupException will be thrown.

@Override
protected void onComponentTag(ComponentTag currentComponentTag) {
    super.onComponentTag(tag);

    Components.assertTag(this, currentComponentTag, "h1")   
}

or you can use the overloaded methods of assertTag:

Components.assertTag(component, currentComponentTag, "h1", "h2")
Components.assertTag(component, currentComponentTag, Sets.newHashSet("h1","h2"))
Clone this wiki locally