blob: f615b9451340e6ae7f2592c356e0656e7574b208 [file] [log] [blame]
package org.eclipse.wst.xml.search.editor.java;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.wst.xml.search.editor.internal.references.XMLReferencePathFactory;
import org.eclipse.wst.xml.search.editor.references.IXMLReferenceTo;
public class JavaReferencePathFactory {
private static final String MATCHER_ID = "matcherId";
public static final JavaReferencePathFactory INSTANCE = new JavaReferencePathFactory();
public IJavaReference createReference(IConfigurationElement element) {
IJavaElementMatcher matcher = getMatcher(element);
return new JavaReference(matcher);
}
private IJavaElementMatcher getMatcher(IConfigurationElement element) {
String matcherId = element.getAttribute(MATCHER_ID);
return JavaReferencesMatchersManager.getInstance().getMatcher(matcherId);
}
public IXMLReferenceTo createTo(IConfigurationElement element,
IJavaReference reference) {
return XMLReferencePathFactory.INSTANCE.createTo(element, reference);
}
}