java.lang.Object
org.tentackle.model.parse.Document
The input document.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetLineNumber(int offsetInDocument) Gets the line number for a given offset within the document.getLines()Gets the parsed lines.Gets the source info.getText()Gets the document text.protected LineGets the next line.parse()Parses the document and returns a list of lines.
-
Constructor Details
-
Document
Creates a document.- Parameters:
text- the model specification source
-
-
Method Details
-
getText
Gets the document text.- Returns:
- the document text
-
getSourceInfo
Gets the source info.- Returns:
- the info, null if unknown
-
getLines
Gets the parsed lines.- Returns:
- the lines, never null
- Throws:
ModelException- if parsing failed
-
getLineNumber
public int getLineNumber(int offsetInDocument) Gets the line number for a given offset within the document.- Parameters:
offsetInDocument- the offset- Returns:
- the linenumber starting at 1
-
parse
Parses the document and returns a list of lines.- Returns:
- the list of lines, never null
- Throws:
ModelException- if parsing failed
-
nextLine
Gets the next line.- Parameters:
currentLine- the current line, null if start of document- Returns:
- the line, null if reached end of document
- Throws:
ModelException- if parsing failed
-