1 11 package org.eclipse.core.expressions; 12 13 import org.w3c.dom.Element ; 14 15 import org.eclipse.core.runtime.CoreException; 16 import org.eclipse.core.runtime.IConfigurationElement; 17 import org.eclipse.core.runtime.IStatus; 18 import org.eclipse.core.runtime.Status; 19 20 import org.eclipse.core.internal.expressions.CompositeExpression; 21 import org.eclipse.core.internal.expressions.ExpressionMessages; 22 import org.eclipse.core.internal.expressions.ExpressionPlugin; 23 import org.eclipse.core.internal.expressions.StandardElementHandler; 24 25 26 35 public abstract class ElementHandler { 36 37 private static final ElementHandler INSTANCE= new StandardElementHandler(); 38 39 45 public static ElementHandler getDefault() { 46 return INSTANCE; 47 } 48 49 61 public abstract Expression create(ExpressionConverter converter, IConfigurationElement config) throws CoreException; 62 63 79 public Expression create(ExpressionConverter converter, Element element) throws CoreException { 80 throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), 81 IStatus.ERROR, 82 ExpressionMessages.ElementHandler_unsupported_element, 83 null)); 84 } 85 86 100 protected void processChildren(ExpressionConverter converter, IConfigurationElement element, CompositeExpression expression) throws CoreException { 101 converter.processChildren(element, expression); 102 } 103 104 119 protected void processChildren(ExpressionConverter converter, Element element, CompositeExpression expression) throws CoreException { 120 converter.processChildren(element, expression); 121 } 122 } 123 | Popular Tags |