Package atessera.markup
Interface TextStateParser.NewStateLine<M>
- Type Parameters:
M- the type of the model object
- Enclosing class:
TextStateParser<M>
public static interface TextStateParser.NewStateLine<M>
Detects a state boundary and creates the corresponding
TextStateParser.State.
During the states phase, each trimmed line is passed to all registered
NewStateLine matchers. If a matcher returns a non-null
TextStateParser.State, the parser commits the current state and switches to the
returned one. If all matchers return null, the line is dispatched
to the current state via onLine.
-
Method Summary
Modifier and TypeMethodDescriptionparse(String line, TextStateParser.State<M> currentState, M model) Inspects the given line and optionally creates a new state for it.
-
Method Details
-
parse
Inspects the given line and optionally creates a new state for it.- Parameters:
line- the trimmed line to inspectcurrentState- the currently active state, may benullmodel- the model to associate with any newly created state- Returns:
- a new
TextStateParser.Stateinstance if this line starts a new section, ornullif no transition should occur
-