1 11 package org.eclipse.update.core.model; 12 13 14 import java.io.IOException ; 15 import java.io.InputStream ; 16 17 import org.eclipse.core.runtime.MultiStatus; 18 import org.eclipse.update.internal.core.InternalFeatureParser; 19 import org.xml.sax.Attributes ; 20 import org.xml.sax.SAXException ; 21 import org.xml.sax.SAXParseException ; 22 import org.xml.sax.helpers.DefaultHandler ; 23 24 42 public class DefaultFeatureParser extends DefaultHandler { 43 44 private InternalFeatureParser featureParser; 45 46 47 50 54 59 public DefaultFeatureParser() { 60 super(); 61 featureParser = new InternalFeatureParser(); 62 } 63 64 public void init(FeatureModelFactory factory) { 65 init(factory, null); 66 } 67 68 73 public void init(FeatureModelFactory factory, String location) { 74 75 this.featureParser.init(factory, location); 76 } 77 78 88 public FeatureModel parse(InputStream in) throws SAXException , IOException { 89 return featureParser.parse(in); 90 } 91 92 98 public MultiStatus getStatus() { 99 return featureParser.getStatus(); 100 } 101 102 107 public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { 108 featureParser.startElement(uri, localName, qName, attributes); 109 110 111 } 112 113 118 public void endElement(String uri, String localName, String qName) { 119 featureParser.endElement(uri, localName, qName); 120 } 121 122 123 128 public void characters(char[] ch, int start, int length) { 129 featureParser.characters(ch, start, length); 130 } 131 132 137 public void error(SAXParseException ex) { 138 featureParser.error(ex); 139 } 140 141 147 public void fatalError(SAXParseException ex) throws SAXException { 148 featureParser.fatalError(ex); 149 } 150 151 154 public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { 155 featureParser.ignorableWhitespace(arg0, arg1, arg2); 156 } 157 } 158 | Popular Tags |