public abstract class AbstractHtmlBlock extends Block
Modifier and Type | Field and Description |
---|---|
protected int |
blockLineCount |
builder, markupLanguage, parser, state
Constructor and Description |
---|
AbstractHtmlBlock(java.lang.String tagName) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
beginBlock() |
boolean |
canStart(java.lang.String line,
int lineOffset)
Indicate if the block can start with the given markup line at the provided offset.
|
protected abstract void |
endBlock() |
protected void |
handleAttribute(java.lang.String attrName,
java.lang.String attrValue)
Handle a named attribute.
|
protected abstract void |
handleBlockContent(java.lang.String content) |
int |
processLineContent(java.lang.String line,
int offset)
Process the given line of markup starting at the provided offset.
|
protected void |
resetState() |
protected void |
setAttributes(java.lang.String attributes)
handle attributes of the opening tag.
|
void |
setClosed(boolean closed)
Cause the block to be closed.
|
beginNesting, canResume, clone, findCloseOffset, isClosed, processLine
getBuilder, getMarkupLanguage, getParser, getState, setParser, setState
public int processLineContent(java.lang.String line, int offset)
Block
processLineContent
in class Block
line
- the markup line to processoffset
- the offset at which to start processingprotected void setAttributes(java.lang.String attributes)
attributes
- the attributes, or null if there are nonehandleAttribute(String, String)
protected void handleAttribute(java.lang.String attrName, java.lang.String attrValue)
attrName
- the attribute nameattrValue
- the attribute valuesetAttributes(String)
protected abstract void handleBlockContent(java.lang.String content)
protected abstract void beginBlock()
protected abstract void endBlock()
public void setClosed(boolean closed)
Block
builder
if necessary.public boolean canStart(java.lang.String line, int lineOffset)
Block
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.protected void resetState()
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