Returns the Java elements corresponding to the given selected text in this compilation unit. The
offset
is the 0-based index of the first selected character. The
length
is the number of selected characters.
Note that if the length
is 0 and the offset
is inside an identifier or the index just after an identifier then this identifier is considered as the selection.
@param offset the given offset position
@param length the number of selected characters
@return the Java elements corresponding to the given selected text
@exception JavaModelException if code resolve could not be performed. Reasons include:
- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The range specified is not within this element's source range (INDEX_OUT_OF_BOUNDS)