public class HtmlLanguageBuilder
extends java.lang.Object
HtmlLanguage.builder()
Modifier and Type | Method and Description |
---|---|
HtmlLanguageBuilder |
add(DocumentBuilder.BlockType blockType)
Adds the given
DocumentBuilder.BlockType to the supported syntax of the language created by this builder. |
HtmlLanguageBuilder |
add(DocumentBuilder.SpanType spanType)
Adds the given
DocumentBuilder.SpanType to the supported syntax of the language created by this builder. |
HtmlLanguageBuilder |
addHeadings(int level)
Adds support for headings up to and including the specified level.
|
HtmlLanguageBuilder |
addSpanFont()
Adds support for the
<font> HTML tag as a DocumentBuilder.SpanType.SPAN . |
HtmlLanguage |
create() |
HtmlLanguageBuilder |
document(java.lang.String prefix,
java.lang.String suffix)
Provides a prefix and suffix which are emitted as literals at the start and end of content created using the
document builder . |
HtmlLanguageBuilder |
name(java.lang.String name)
Sets the
name of the markup language. |
HtmlLanguageBuilder |
setXhtmlStrict(boolean xhtmlStrict)
Indicate if the resulting document builder should attempt to conform to strict XHTML rules.
|
public HtmlLanguageBuilder name(java.lang.String name)
name
of the markup language.name
- the namepublic HtmlLanguageBuilder add(DocumentBuilder.BlockType blockType)
DocumentBuilder.BlockType
to the supported syntax of the language created by this builder.
Adding DocumentBuilder.BlockType.TABLE
, DocumentBuilder.BlockType.BULLETED_LIST
, DocumentBuilder.BlockType.NUMERIC_LIST
or
DocumentBuilder.BlockType.DEFINITION_LIST
will cause the corresponding related blocks to be added. For example, adding
DocumentBuilder.BlockType.BULLETED_LIST
also adds DocumentBuilder.BlockType.LIST_ITEM
.
blockType
- the block typepublic HtmlLanguageBuilder add(DocumentBuilder.SpanType spanType)
DocumentBuilder.SpanType
to the supported syntax of the language created by this builder.spanType
- the span typepublic HtmlLanguageBuilder addHeadings(int level)
level
- the level which must be a number between 1 and 6 inclusivepublic HtmlLanguageBuilder addSpanFont()
<font>
HTML tag as a DocumentBuilder.SpanType.SPAN
. The resulting document builder will
convert DocumentBuilder.SpanType.SPAN
with size
or colour
CSS rules to <font>
when generating
HTML.public HtmlLanguageBuilder setXhtmlStrict(boolean xhtmlStrict)
xhtmlStrict
- true if the language should attempt to conform to XHTML strict rules, otherwise falsepublic HtmlLanguageBuilder document(java.lang.String prefix, java.lang.String suffix)
document builder
.prefix
- the prefix which is an HTML literal value that precedes the content, for example "<div>"
or
"<html><body>"
. May be empty.suffix
- the prefix which is an HTML literal value that precedes the content, for example "</div>"
or
"</body></html>"
. May be empty.HtmlDocumentHandler
public HtmlLanguage create()
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html