org.eclipse.mylyn.wikitext.core.parser.markup.block
Class AbstractHtmlBlock
java.lang.Object
org.eclipse.mylyn.wikitext.core.parser.markup.Processor
org.eclipse.mylyn.wikitext.core.parser.markup.Block
org.eclipse.mylyn.wikitext.core.parser.markup.block.AbstractHtmlBlock
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- HtmlPreformattedBlock
public abstract class AbstractHtmlBlock
- extends Block
An abstract block that is delimited by HTML-style open and close tags.
- Since:
- 1.2
- Author:
- dgreen
blockLineCount
protected int blockLineCount
AbstractHtmlBlock
public AbstractHtmlBlock(String tagName)
processLineContent
public int processLineContent(String line,
int offset)
- Description copied from class:
Block
- Process the given line of markup starting at the provided offset.
- Specified by:
processLineContent
in class Block
- Parameters:
line
- the markup line to processoffset
- the offset at which to start processing
- Returns:
- a non-negative integer to indicate that processing of the block completed before the end of the line, or
-1 if the entire line was processed.
setAttributes
protected void setAttributes(String attributes)
- handle attributes of the opening tag. The default implementation does nothing, however subclasses may override
this method to process attributes.
- Parameters:
attributes
- the attributes, or null if there are none
handleBlockContent
protected abstract void handleBlockContent(String content)
beginBlock
protected abstract void beginBlock()
endBlock
protected abstract void endBlock()
setClosed
public void setClosed(boolean closed)
- Description copied from class:
Block
- Cause the block to be closed. If the block is going from the open to the closed state, then the block must cause
the closed state to be propagated to the
builder
if necessary.
- Overrides:
setClosed
in class Block
canStart
public boolean canStart(String line,
int lineOffset)
- Description copied from class:
Block
- Indicate if the block can start with the given markup line at the provided offset. Calling this method may cause
the block to have state which is propagated when
cloning
and consumed in
#processLine(String, int, int)
. Calling this method must cause any previous state to be reset. Note that
it is valid for block implementations to refuse to start at non-zero offsets.
Implementations must be able to handle this method without having the processor state
initialized.
- Specified by:
canStart
in class Block
- Parameters:
line
- the line of markup to testlineOffset
- the offset at which the block should start processing
- Returns:
- true if the provided markup consists of a valid starting point for the block
resetState
protected void resetState()
Copyright © 2011 FuseSource, Corp.. All Rights Reserved.