Example usage for org.eclipse.jdt.internal.core.util MementoTokenizer MementoTokenizer

List of usage examples for org.eclipse.jdt.internal.core.util MementoTokenizer MementoTokenizer

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util MementoTokenizer MementoTokenizer.

Prototype

public MementoTokenizer(String memento) 

Source Link

Usage

From source file:org.eclipse.che.jdt.core.JavaCore.java

License:Open Source License

/**
 * Returns the Java model element corresponding to the given handle identifier
 * generated by <code>IJavaElement.getHandleIdentifier()</code>, or
 * <code>null</code> if unable to create the associated element.
 * If the returned Java element is an <code>ICompilationUnit</code> or an element
 * inside a compilation unit, the compilation unit's owner is the given owner if such a
 * working copy exists, otherwise the compilation unit is a primary compilation unit.
 *
 * @param handleIdentifier the given handle identifier
 * @param owner the owner of the returned compilation unit, ignored if the returned
 *   element is not a compilation unit, or an element inside a compilation unit
 * @return the Java element corresponding to the handle identifier
 * @since 3.0//from w w w  .  ja va 2 s  . c  om
 */
public static IJavaElement create(String handleIdentifier, WorkingCopyOwner owner, JavaProject project) {
    if (handleIdentifier == null) {
        return null;
    }
    if (owner == null)
        owner = DefaultWorkingCopyOwner.PRIMARY;
    MementoTokenizer memento = new MementoTokenizer(handleIdentifier);

    return project.getHandleFromMemento(memento, owner);
}