Lines 2335-2347
Link Here
|
2335 |
* Returns the Java model element corresponding to the given handle identifier |
2335 |
* Returns the Java model element corresponding to the given handle identifier |
2336 |
* generated by <code>IJavaElement.getHandleIdentifier()</code>, or |
2336 |
* generated by <code>IJavaElement.getHandleIdentifier()</code>, or |
2337 |
* <code>null</code> if unable to create the associated element. |
2337 |
* <code>null</code> if unable to create the associated element. |
2338 |
* If the returned Java element is an <code>ICompilationUnit</code>, its owner |
2338 |
* If the returned Java element is an <code>ICompilationUnit</code> or an element |
2339 |
* is the given owner if such a working copy exists, otherwise the compilation unit |
2339 |
* inside a compilation unit, the compilation unit's owner is the given owner if such a |
2340 |
* is a primary compilation unit. |
2340 |
* working copy exists, otherwise the compilation unit is a primary compilation unit. |
2341 |
* |
2341 |
* |
2342 |
* @param handleIdentifier the given handle identifier |
2342 |
* @param handleIdentifier the given handle identifier |
2343 |
* @param owner the owner of the returned compilation unit, ignored if the returned |
2343 |
* @param owner the owner of the returned compilation unit, ignored if the returned |
2344 |
* element is not a compilation unit |
2344 |
* element is not a compilation unit, or an element inside a compilation unit |
2345 |
* @return the Java element corresponding to the handle identifier |
2345 |
* @return the Java element corresponding to the handle identifier |
2346 |
* @since 3.0 |
2346 |
* @since 3.0 |
2347 |
*/ |
2347 |
*/ |
Lines 2349-2354
Link Here
|
2349 |
if (handleIdentifier == null) { |
2349 |
if (handleIdentifier == null) { |
2350 |
return null; |
2350 |
return null; |
2351 |
} |
2351 |
} |
|
|
2352 |
if (owner == null) |
2353 |
owner = DefaultWorkingCopyOwner.PRIMARY; |
2352 |
MementoTokenizer memento = new MementoTokenizer(handleIdentifier); |
2354 |
MementoTokenizer memento = new MementoTokenizer(handleIdentifier); |
2353 |
JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel(); |
2355 |
JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel(); |
2354 |
return model.getHandleFromMemento(memento, owner); |
2356 |
return model.getHandleFromMemento(memento, owner); |