Some things to decide first:
- Should this also include column number (which may not be used in all cases)?
- What should the interface be called (
Positionable?)?
And some changes that could be made in the course of this:
- Rename
getLineNo() to getLineNumber() as follows:
- Add both methods to the interface, with
getLineNo marked as deprecated from 9.0, to be removed in 10.0;
- The trait can handle forwarding
getLineNo to getLineNumber (or simply access the property), so that no changes to implementing classes are required, provided they can use the trait;
- Use
null to indicate 'no line number' instead of 0:
- Again, the trait should be able to take care of the details, avoiding changes to implementing classes.
Some things to decide first:
Positionable?)?And some changes that could be made in the course of this:
getLineNo()togetLineNumber()as follows:getLineNomarked as deprecated from 9.0, to be removed in 10.0;getLineNotogetLineNumber(or simply access the property), so that no changes to implementing classes are required, provided they can use the trait;nullto indicate 'no line number' instead of0: