|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mylyn.wikitext.core.parser.DocumentBuilder
public abstract class DocumentBuilder
The 'Builder' design pattern, for documents. Implementations can build a specific kind of document (such as HTML, or DocBook).
Note that many methods take Attributes
to specify attributes of the element, however most of these methods
may take a more specific subclass of Attributes
.
Nested Class Summary | |
---|---|
static class |
DocumentBuilder.BlockType
|
static class |
DocumentBuilder.SpanType
|
Field Summary | |
---|---|
protected Locator |
locator
|
Constructor Summary | |
---|---|
DocumentBuilder()
|
Method Summary | |
---|---|
abstract void |
acronym(String text,
String definition)
Emit an acronym |
void |
annotation(String name,
String data)
Emit an annotation in the target document format. |
abstract void |
beginBlock(DocumentBuilder.BlockType type,
Attributes attributes)
Begin a block of the specified type. |
abstract void |
beginDocument()
Begin a document. |
abstract void |
beginHeading(int level,
Attributes attributes)
Begin a heading of the specified level (usually 1-6). |
void |
beginLink(Attributes attributes,
String hrefOrHashName)
|
abstract void |
beginSpan(DocumentBuilder.SpanType type,
Attributes attributes)
Begin a span of the specified type. |
abstract void |
characters(String text)
Emit the given text as characters where special characters are encoded according to the output format rules. |
abstract void |
charactersUnescaped(String literal)
Create unescaped characters, usually with some embedded HTML markup. |
abstract void |
endBlock()
End a block that was started . |
abstract void |
endDocument()
End a document. |
abstract void |
endHeading()
End a span that was started . |
void |
endLink()
|
abstract void |
endSpan()
End a span that was started . |
abstract void |
entityReference(String entity)
An XML entity reference. |
Locator |
getLocator()
The locator for the current session |
abstract void |
image(Attributes attributes,
String url)
Build the image with the given attributes |
abstract void |
imageLink(Attributes linkAttributes,
Attributes imageAttributes,
String href,
String imageUrl)
Create a hyperlink whose visual representation is an image. |
void |
imageLink(Attributes attributes,
String href,
String imageUrl)
Create a hyperlink whose visual representation is an image. |
void |
imageLink(String href,
String imageUrl)
|
abstract void |
lineBreak()
Create a line break (eg: br in html). |
abstract void |
link(Attributes attributes,
String hrefOrHashName,
String text)
Create a hyperlink to the given url. |
void |
link(String hrefOrHashName,
String text)
|
void |
setLocator(Locator locator)
Set the locator for the current session |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Locator locator
Constructor Detail |
---|
public DocumentBuilder()
Method Detail |
---|
public abstract void beginDocument()
endDocument()
.
endDocument()
public abstract void endDocument()
endDocument()
public abstract void beginBlock(DocumentBuilder.BlockType type, Attributes attributes)
Attributes
class, in which case
the builder may attempt to apply the attributes specified. Builders may choose to ignore attributes, and should
fail silently if the given attributes are not as expected. Each call to this method must be matched by a
corresponding call to endBlock()
.
type
- attributes
- the attributes to apply to the block. Callers may choose to specify a more specialized set of
attributes by providing a subclass instance.endBlock()
public abstract void endBlock()
started
.
public abstract void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
endSpan()
.
type
- attributes
- the attributes to apply to the spanendSpan()
public abstract void endSpan()
started
.
#beginSpan(org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType, Attributes)
public abstract void beginHeading(int level, Attributes attributes)
endHeading()
.
level
- the level of the heading, usually 1-6attributes
- the attributes to apply to the headingendHeading()
public abstract void endHeading()
started
.
beginHeading(int, Attributes)
public abstract void characters(String text)
text
- the text to emit.public abstract void entityReference(String entity)
entity
- the entitypublic abstract void image(Attributes attributes, String url)
attributes
- the attributes, which may be an ImageAttributes
.url
- the URL to the image, possibly relativepublic abstract void link(Attributes attributes, String hrefOrHashName, String text)
LinkAttributes
are used, the attributes must not have the
href
attribute set.
attributes
- the attributes of the linkhrefOrHashName
- the url (which may be internal to the page if prefixed with a hash '#')text
- the text of the hyperlinkpublic void beginLink(Attributes attributes, String hrefOrHashName)
public void endLink()
public abstract void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl)
<a href="..."><img src="..."/></a>
. In this case if the attributes define a css class then
the resulting HTML should look like this: <a href="..."><img src="..." class="..."/></a>
linkAttributes
- the attributes of the link, which may be LinkAttributes
imageAttributes
- the attributes of the image , which may be ImageAttributes
href
- the url (which may be internal to the page if prefixed with a hash '#')imageUrl
- the url of the image, which may be relativepublic final void imageLink(Attributes attributes, String href, String imageUrl)
<a href="..."><img src="..."/></a>
. In this case if the attributes define a css class then
the resulting HTML should look like this: <a href="..."><img src="..." class="..."/></a>
attributes
- the attributes of the image, which may be ImageAttributes
href
- the url (which may be internal to the page if prefixed with a hash '#')imageUrl
- the url of the image, which may be relativeimageLink(Attributes, Attributes, String, String)
public final void link(String hrefOrHashName, String text)
link(Attributes, String, String)
public final void imageLink(String href, String imageUrl)
imageLink(Attributes, String, String)
public abstract void acronym(String text, String definition)
text
- the acronym to emitdefinition
- the definition of the acronym, which is typically displayed on mouse hoverpublic abstract void lineBreak()
public abstract void charactersUnescaped(String literal)
literal
- the literal characters to emitpublic void annotation(String name, String data)
name
- identifies the annotation. For example, the name of an unparsable macro
from the original markup.data
- the data associated with the annotation. For example, the attributes associated
with an unparsable Wiki macro.public void setLocator(Locator locator)
locator
- the locator that provides information about the current location in the markuppublic Locator getLocator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |