java.lang.Object
org.tentackle.model.parse.Document
The input document describing the model of an entity.
- Author:
- harald
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
If the model source is stored in a jar, the source info lead doesn't make sense.
Instead, the model defaults used to parse the model in the project become necessary, since we have no access to the original project's poms.static final String
The model source may start with this lead followed by the source info.
Same as inorg.wurbelizer.misc.Constants
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getLineNumber
(int offsetInDocument) Gets the line number for a given offset within the document.getLines()
Gets the parsed lines.Gets the optional model defaults.Gets the source info.getText()
Gets the document text.protected Line
Gets the next line.parse()
Parses the document and returns a list of lines.
-
Field Details
-
ORIGIN_INFO_LEAD
The model source may start with this lead followed by the source info.
Same as inorg.wurbelizer.misc.Constants
.- See Also:
-
DEFAULTS_INFO_LEAD
If the model source is stored in a jar, the source info lead doesn't make sense.
Instead, the model defaults used to parse the model in the project become necessary, since we have no access to the original project's poms.- See Also:
-
-
Constructor Details
-
Document
Creates a document.- Parameters:
text
- the model specification source- Throws:
ModelException
- if parsing the model defaults failed
-
-
Method Details
-
getText
Gets the document text.- Returns:
- the document text
-
getSourceInfo
Gets the source info.- Returns:
- the info, null if not defined within the document
- See Also:
-
getModelDefaults
Gets the optional model defaults.- Returns:
- the defaults, null if not defined within the document
- See Also:
-
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
-