public abstract class Line extends Object
| Constructor and Description |
|---|
Line(Document document,
int offset,
LineType lineType)
Creates a line.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertParsed()
Asserts that this line is parsed.
|
ModelException |
createModelException(String message)
Creates a model exception.
|
ModelException |
createModelException(String message,
Throwable cause)
Creates a model exception.
|
Document |
getDocument()
Gets the document this line belongs to.
|
int |
getLength()
Gets the length of the parsed line.
|
int |
getLineNumber()
Gets the first linenumber of this line within the document.
|
LineType |
getLineType()
Gets the line type.
|
int |
getOffset()
Gets the offset within the document.
|
SourceInfo |
getSourceInfo()
Gets the source info for this line.
|
String |
getText()
Gets the line's text.
|
abstract void |
parse()
Parses a line.
|
protected void |
setLength(int length)
Sets the line's length.
Invoked from within parse(). |
String |
toString() |
public Document getDocument()
public int getOffset()
public int getLineNumber()
public LineType getLineType()
protected void assertParsed()
throws ModelException
ModelException - if not parsedpublic int getLength()
throws ModelException
ModelException - if line has not been parsed yetprotected void setLength(int length)
parse().length - the lines length, -1 means to end of filepublic String getText() throws ModelException
ModelException - if line has not been parsed yetpublic SourceInfo getSourceInfo()
public abstract void parse()
throws ModelException
ModelException - if parsing failedpublic ModelException createModelException(String message, Throwable cause)
message - the messagecause - the optional chained causepublic ModelException createModelException(String message)
message - the messageTentackle - a domain driven enterprise framework