@InterfaceAudience.Private public class HamletImpl extends HamletSpec
Modifier and Type | Class and Description |
---|---|
class |
HamletImpl.EImp<T extends HamletSpec.__>
The base class for elements
|
static class |
HamletImpl.EOpt
Element options.
|
class |
HamletImpl.Generic<T extends HamletSpec.__> |
HamletSpec.__, HamletSpec._Anchor, HamletSpec._Block, HamletSpec._Body, HamletSpec._Cell, HamletSpec._Child, HamletSpec._Content, HamletSpec._Dl, HamletSpec._FieldSet, HamletSpec._FontSize, HamletSpec._FontStyle, HamletSpec._Form, HamletSpec._FormCtrl, HamletSpec._Head, HamletSpec._Html, HamletSpec._ImgObject, HamletSpec._InsDel, HamletSpec._Label, HamletSpec._Legend, HamletSpec._Li, HamletSpec._Object, HamletSpec._Option, HamletSpec._Param, HamletSpec._RawContent, HamletSpec._Script, HamletSpec._Special, HamletSpec._SubSup, HamletSpec._Table, HamletSpec._TableCol, HamletSpec._TableRow, HamletSpec._Tr, HamletSpec.A, HamletSpec.ABBR, HamletSpec.ACRONYM, HamletSpec.ADDRESS, HamletSpec.AREA, HamletSpec.Attrs, HamletSpec.B, HamletSpec.BASE, HamletSpec.BDO, HamletSpec.Block, HamletSpec.BLOCKQUOTE, HamletSpec.BODY, HamletSpec.BR, HamletSpec.BUTTON, HamletSpec.ButtonType, HamletSpec.CAPTION, HamletSpec.CITE, HamletSpec.CODE, HamletSpec.COL, HamletSpec.COLGROUP, HamletSpec.CoreAttrs, HamletSpec.DD, HamletSpec.DEL, HamletSpec.DFN, HamletSpec.Dir, HamletSpec.DIV, HamletSpec.DL, HamletSpec.DT, HamletSpec.Element, HamletSpec.EM, HamletSpec.EventsAttrs, HamletSpec.FIELDSET, HamletSpec.Flow, HamletSpec.FontStyle, HamletSpec.FORM, HamletSpec.FormCtrl, HamletSpec.H1, HamletSpec.H2, HamletSpec.H3, HamletSpec.H4, HamletSpec.H5, HamletSpec.H6, HamletSpec.HEAD, HamletSpec.Heading, HamletSpec.HeadMisc, HamletSpec.HR, HamletSpec.HTML, HamletSpec.I, HamletSpec.I18nAttrs, HamletSpec.IMG, HamletSpec.Inline, HamletSpec.INPUT, HamletSpec.InputType, HamletSpec.INS, HamletSpec.KBD, HamletSpec.LABEL, HamletSpec.LEGEND, HamletSpec.LI, HamletSpec.LINK, HamletSpec.LinkType, HamletSpec.Listing, HamletSpec.MAP, HamletSpec.Media, HamletSpec.META, HamletSpec.Method, HamletSpec.OBJECT, HamletSpec.OL, HamletSpec.OPTGROUP, HamletSpec.OPTION, HamletSpec.P, HamletSpec.PARAM, HamletSpec.PCData, HamletSpec.Phrase, HamletSpec.PRE, HamletSpec.Preformatted, HamletSpec.Q, HamletSpec.SAMP, HamletSpec.Scope, HamletSpec.SCRIPT, HamletSpec.SELECT, HamletSpec.Shape, HamletSpec.SMALL, HamletSpec.SPAN, HamletSpec.Special, HamletSpec.STRONG, HamletSpec.STYLE, HamletSpec.SUB, HamletSpec.SUP, HamletSpec.TABLE, HamletSpec.TBODY, HamletSpec.TD, HamletSpec.TEXTAREA, HamletSpec.TFOOT, HamletSpec.TH, HamletSpec.THEAD, HamletSpec.TITLE, HamletSpec.TR, HamletSpec.UL, HamletSpec.VAR
Constructor and Description |
---|
HamletImpl(PrintWriter out,
int nestLevel,
boolean wasInline) |
Modifier and Type | Method and Description |
---|---|
PrintWriter |
getWriter() |
protected void |
indent(EnumSet<HamletImpl.EOpt> opts) |
int |
nestLevel() |
static String[] |
parseSelector(String selector)
Parse selector into id and classes
|
protected void |
printAttr(String name,
String value) |
protected void |
printEndTag(String name,
EnumSet<HamletImpl.EOpt> opts) |
protected void |
printStartTag(String name,
EnumSet<HamletImpl.EOpt> opts) |
<T extends HamletSpec.__> |
root(String name) |
<T extends HamletSpec.__> |
root(String name,
EnumSet<HamletImpl.EOpt> opts)
Create a root-level generic element.
|
static <E extends HamletSpec.LINK> |
setLinkHref(E e,
String href) |
static <E extends HamletSpec.SCRIPT> |
setScriptSrc(E e,
String src) |
static <E extends HamletSpec.CoreAttrs> |
setSelector(E e,
String selector)
Set id and/or class attributes for an element.
|
void |
setWasInline(boolean state) |
protected void |
subView(Class<? extends SubView> cls)
Sub-classes should override this to do something interesting.
|
boolean |
wasInline() |
public HamletImpl(PrintWriter out, int nestLevel, boolean wasInline)
public int nestLevel()
public boolean wasInline()
public void setWasInline(boolean state)
public PrintWriter getWriter()
public <T extends HamletSpec.__> HamletImpl.Generic<T> root(String name, EnumSet<HamletImpl.EOpt> opts)
T
- type of the parent elementname
- of the elementopts
- element options
public <T extends HamletSpec.__> HamletImpl.Generic<T> root(String name)
protected void printStartTag(String name, EnumSet<HamletImpl.EOpt> opts)
protected void indent(EnumSet<HamletImpl.EOpt> opts)
protected void printEndTag(String name, EnumSet<HamletImpl.EOpt> opts)
protected void subView(Class<? extends SubView> cls)
cls
- the sub-view classpublic static String[] parseSelector(String selector)
selector
- in the form of (#id)?(.class)*WebAppException
- when both are null or syntax error.public static <E extends HamletSpec.CoreAttrs> E setSelector(E e, String selector)
E
- type of the elemente
- the elementselector
- Haml form of "(#id)?(.class)*"public static <E extends HamletSpec.LINK> E setLinkHref(E e, String href)
public static <E extends HamletSpec.SCRIPT> E setScriptSrc(E e, String src)
Copyright © 2008–2019 Apache Software Foundation. All rights reserved.