6 package de.uni_hamburg.corpora.conversion;
13 import java.io.IOException;
14 import java.net.URISyntaxException;
15 import java.security.NoSuchAlgorithmException;
16 import java.util.ArrayList;
17 import java.util.Collection;
18 import java.util.logging.Level;
19 import java.util.logging.Logger;
20 import javax.xml.parsers.ParserConfigurationException;
21 import javax.xml.transform.TransformerException;
22 import javax.xml.xpath.XPathExpressionException;
23 import org.exmaralda.partitureditor.fsm.FSMException;
24 import org.exmaralda.partitureditor.jexmaralda.JexmaraldaException;
25 import org.jdom.JDOMException;
26 import org.xml.sax.SAXException;
49 Collection<Class<? extends CorpusData>> IsUsableFor =
new ArrayList<Class<? extends CorpusData>>();
50 final String
function;
51 Boolean canfix =
false;
54 function = this.getClass().getSimpleName();
60 report =
function(cd);
62 }
catch (JexmaraldaException je) {
63 report.
addException(je,
function, cd,
"Unknown parsing error");
64 }
catch (JDOMException jdome) {
65 report.
addException(jdome,
function, cd,
"Unknown parsing error");
66 }
catch (SAXException saxe) {
67 report.
addException(saxe,
function, cd,
"Unknown parsing error");
68 }
catch (IOException ioe) {
69 report.
addException(ioe,
function, cd,
"File reading error");
70 }
catch (FSMException ex) {
71 report.
addException(ex,
function, cd,
"File reading error");
72 }
catch (URISyntaxException ex) {
73 report.
addException(ex,
function, cd,
"File reading erro");
74 }
catch (ParserConfigurationException ex) {
75 report.
addException(ex,
function, cd,
"File reading error");
76 }
catch (TransformerException ex) {
77 report.
addException(ex,
function, cd,
"File reading error");
78 }
catch (XPathExpressionException ex) {
79 report.
addException(ex,
function, cd,
"File reading error");
80 }
catch (ClassNotFoundException ex) {
81 report.
addException(ex,
function, cd,
"File reading error");
82 }
catch (NoSuchAlgorithmException ex) {
83 report.
addException(ex,
function, cd,
"File reading error");
84 }
catch (Exception ex) {
85 Logger.getLogger(
Converter.class.getName()).log(Level.SEVERE, null, ex);
95 }
catch (JexmaraldaException je) {
96 report.
addException(je,
function, cd,
"Unknown parsing error");
97 }
catch (JDOMException jdome) {
98 report.
addException(jdome,
function, cd,
"Unknown parsing error");
99 }
catch (SAXException saxe) {
100 report.
addException(saxe,
function, cd,
"Unknown parsing error");
101 }
catch (IOException ioe) {
102 report.
addException(ioe,
function, cd,
"File reading error");
103 }
catch (FSMException ex) {
104 report.
addException(ex,
function, cd,
"File reading error");
105 }
catch (URISyntaxException ex) {
106 report.
addException(ex,
function, cd,
"File reading erro");
107 }
catch (ParserConfigurationException ex) {
108 report.
addException(ex,
function, cd,
"File reading error");
109 }
catch (TransformerException ex) {
110 report.
addException(ex,
function, cd,
"File reading error");
111 }
catch (XPathExpressionException ex) {
112 report.
addException(ex,
function, cd,
"File reading error");
113 }
catch (ClassNotFoundException ex) {
114 report.
addException(ex,
function, cd,
"File reading error");
115 }
catch (NoSuchAlgorithmException ex) {
116 report.
addException(ex,
function, cd,
"File reading error");
117 }
catch (Exception ex) {
118 Logger.getLogger(
Converter.class.getName()).log(Level.SEVERE, null, ex);
131 public abstract Report function(
Corpus c)
throws Exception, NoSuchAlgorithmException, ClassNotFoundException, FSMException, URISyntaxException, SAXException, IOException, ParserConfigurationException, JexmaraldaException, TransformerException, XPathExpressionException, JDOMException;
135 public abstract Report function(
CorpusData cd)
throws Exception, NoSuchAlgorithmException, ClassNotFoundException, FSMException, URISyntaxException, SAXException, IOException, ParserConfigurationException, JexmaraldaException, TransformerException, XPathExpressionException, JDOMException;
141 public abstract Collection<Class<? extends CorpusData>>
getIsUsableFor();
144 for (Class cl : cdc) {
Report execute(Corpus c, boolean fix)
Report execute(CorpusData cd)
Report execute(CorpusData cd, boolean fix)
void addException(Throwable e, String description)
abstract Collection< Class<?extends CorpusData > > getIsUsableFor()
void setIsUsableFor(Collection< Class<?extends CorpusData >> cdc)