summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/kitfox/salamander/parser/SVGParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/kitfox/salamander/parser/SVGParser.java')
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/parser/SVGParser.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/main/java/com/kitfox/salamander/parser/SVGParser.java b/src/main/java/com/kitfox/salamander/parser/SVGParser.java
new file mode 100755
index 0000000..efdf6b9
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/parser/SVGParser.java
@@ -0,0 +1,58 @@
+/*
+ * SVGParser.java
+ *
+ * Created on April 11, 2007, 5:07 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.parser;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SVGParser
+{
+ public static interface SVGParserListener
+ {
+
+ }
+
+ /** Creates a new instance of SVGParser */
+ public SVGParser()
+ {
+ }
+
+ public static void parse(File source, SVGParserListener listener, boolean skipUpToDateFiles)
+ {
+ try
+ {
+ XMLReader parser;
+ parser = XMLReaderFactory.createXMLReader();
+ SVGParserHandler handler = new SVGParserHandler(listener);
+ parser.setContentHandler(handler);
+
+ InputSource is = new InputSource(new FileInputStream(source));
+ parser.parse(is);
+
+ }
+ catch (SAXException ex)
+ {
+ ex.printStackTrace();
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+}