public abstract class BlockHandler extends Object implements IBlockHandler
IBlockHandler
interface that serves
as a base class for parsing any article constituent.Constructor and Description |
---|
BlockHandler(String... labels)
Initializes the block handler for parsing all sections starting with
one of the specified labels.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(String blockHeader)
Return
true if the handler requests to process the article
constituent starting at the given line of text. |
void |
fillContent(ParsingContext context)
This hotspot is invoked if the parser releases this handler.
|
protected String[] |
getLabels() |
boolean |
processBody(String textLine,
ParsingContext context)
If the handler requested to process the body of this constituent, this
hotspot will be called for processing each line of the constituent's
body.
|
boolean |
processHead(String text,
ParsingContext context)
If the handler requested to process this constituent, this hotspot
will be called for processing the section header of this
article constituent.
|
protected String[] labels
public BlockHandler(String... labels)
public boolean canHandle(String blockHeader)
IBlockHandler
true
if the handler requests to process the article
constituent starting at the given line of text.canHandle
in interface IBlockHandler
public boolean processHead(String text, ParsingContext context)
IBlockHandler
true
if the handler
requests to handle also the body of this constituent.processHead
in interface IBlockHandler
public boolean processBody(String textLine, ParsingContext context)
IBlockHandler
true
if the handler requests to handle also
the next line using this handler.processBody
in interface IBlockHandler
public void fillContent(ParsingContext context)
IBlockHandler
fillContent
in interface IBlockHandler
protected String[] getLabels()
Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.