public class MarkGroup extends MarkRule implements StructGroup
The rules belonging to this must fall within the start and end tag of this rule
LEFTQUOTE, m_endPos, m_startPosBOL, EMPTY_LINE, EOB, EOL, m_attribute, m_out, m_terminate, SPACEMAP, XML| Constructor and Description |
|---|
MarkGroup(Position start,
Position end,
java.lang.Object out) |
MarkGroup(Position start,
Position end,
java.lang.Object out,
int outputType) |
MarkGroup(Position start,
java.lang.String end,
java.lang.Object out)
Constructor for MarkGroup.
|
MarkGroup(Position start,
java.lang.String end,
java.lang.Object out,
int outputType) |
MarkGroup(java.lang.String start,
Position endPos,
java.lang.Object out)
Constructor
|
MarkGroup(java.lang.String start,
Position endPos,
java.lang.Object out,
int outputType)
Constructor
|
MarkGroup(java.lang.String start,
java.lang.String end,
java.lang.Object out)
Constructor for MarkGroup.
|
MarkGroup(java.lang.String start,
java.lang.String end,
java.lang.Object out,
int outputType) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(StructRule rule)
add a rule to this Group.
|
void |
addAttribute(Position endPos,
java.lang.Object o) |
void |
addAttribute(Position end,
java.lang.Object o,
Transformat format) |
void |
addAttribute(java.lang.String end,
java.lang.Object o) |
void |
addAttribute(java.lang.String end,
java.lang.Object o,
Transformat format) |
void |
addStatic(java.lang.String name,
java.lang.Object o) |
void |
addStaticAttribute(java.lang.String name,
java.lang.Object o) |
void |
addTransformat(Transformat format)
add a
Transformat to this rule |
protected void |
applyRules(int lineno) |
protected void |
createObject(java.lang.Object out) |
java.lang.Object |
getObject()
get the Object created as a result of the input matching
this group.
|
int |
getOutputType()
the type of output
StructGroup.getObject() will deliver if the
rules are matched to the output |
protected java.util.List |
getRules() |
void |
insertTransformat(int pos,
Transformat format) |
void |
readline(java.lang.String line,
int lineno)
read a line from the parser for processing, with
tracking the line number
|
clearBuffer, findQuote, getBuffer, isAttribute, isWord, readline, setAttribute, setBuffer, terminategetParent, getTransformats, isFinished, isFound, isTerminate, removeWhitespace, reset, set, setFinished, setFound, setParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTransformats, isFinished, isFound, readline, reset, setParentpublic MarkGroup(java.lang.String start,
java.lang.String end,
java.lang.Object out)
start - end - out - public MarkGroup(java.lang.String start,
Position endPos,
java.lang.Object out)
The output type is set to default: XML
start - String, the Mark at which to startendPos - Position, The mark(s) at which this group endsout - Object to which this group should be attachedpublic MarkGroup(Position start, java.lang.String end, java.lang.Object out)
start - end - out - public MarkGroup(java.lang.String start,
Position endPos,
java.lang.Object out,
int outputType)
start - String, the Mark at which to startendPos - Position, The mark(s) at which this group endsout - Object to which this group should be attachedoutputType - int, one of the defined output typespublic MarkGroup(java.lang.String start,
java.lang.String end,
java.lang.Object out,
int outputType)
public MarkGroup(Position start, java.lang.String end, java.lang.Object out, int outputType)
public void addStaticAttribute(java.lang.String name,
java.lang.Object o)
public void addAttribute(java.lang.String end,
java.lang.Object o)
public void addAttribute(Position endPos, java.lang.Object o)
public void addAttribute(java.lang.String end,
java.lang.Object o,
Transformat format)
public void addAttribute(Position end, java.lang.Object o, Transformat format)
public void readline(java.lang.String line,
int lineno)
StructRule
The StructParser supplies the input line for line. This
does not limit the rules to one line. This is only dependant
on StructRule.isFound() and StructRule.isFinished()
readline in interface StructGroupreadline in class MarkRuleline - String, the line to be readlineno - int, the linenumber of this lineStructParserprotected void applyRules(int lineno)
public void add(StructRule rule)
StructGroupStructGroup.isFound() is true and until StructGroup.isFinished()
is true.add in interface StructGrouprule - StructRule, the rule to add to this groupStructGroup.add(StructRule)public void addTransformat(Transformat format)
StructRuleTransformat to this rule
A transformater is a class which will be called to
format the values from an input to a value for the output.
With an implementation one can do simple transformations
SimpleTransformat like trimming whitespaces or
setting the value to uppercase or do complex transformations
ComplexTransformat changing multiple values
in a resulting Object
addTransformat in class StructRuleformat - Transformatpublic void insertTransformat(int pos,
Transformat format)
insertTransformat in class StructRulepublic void addStatic(java.lang.String name,
java.lang.Object o)
public int getOutputType()
StructGroup.getObject() will deliver if the
rules are matched to the outputgetOutputType in interface StructGroupprotected void createObject(java.lang.Object out)
public java.lang.Object getObject()
StructGroupgetObject in interface StructGroupStructGroup.isFound() is never true
for this group and might not be correctly set if StructGroup.isFinished() never is trueStructGroup.getObject()protected java.util.List getRules()