1 | |
package org.kuali.db.impex; |
2 | |
|
3 | |
import java.io.IOException; |
4 | |
|
5 | |
import org.apache.torque.engine.database.model.Database; |
6 | |
import org.kuali.core.db.torque.KualiXmlToAppData; |
7 | |
|
8 | 0 | public class SchemaParser { |
9 | |
ImpexMetadata impexMetadata; |
10 | |
Database database; |
11 | |
|
12 | |
public void parse() throws IOException { |
13 | 0 | KualiXmlToAppData xmlParser = new KualiXmlToAppData(impexMetadata.getPlatform(), ""); |
14 | |
|
15 | |
|
16 | |
try { |
17 | 0 | database = xmlParser.parseResource(impexMetadata.getSchemaLocation()); |
18 | 0 | } catch (Exception e) { |
19 | 0 | throw new IOException("Error parsing: " + impexMetadata.getSchemaLocation(), e); |
20 | 0 | } |
21 | 0 | } |
22 | |
|
23 | |
public ImpexMetadata getImpexMetadata() { |
24 | 0 | return impexMetadata; |
25 | |
} |
26 | |
|
27 | |
public void setImpexMetadata(ImpexMetadata impexMetadata) { |
28 | 0 | this.impexMetadata = impexMetadata; |
29 | 0 | } |
30 | |
|
31 | |
public Database getDatabase() { |
32 | 0 | return database; |
33 | |
} |
34 | |
|
35 | |
public void setDatabase(Database database) { |
36 | 0 | this.database = database; |
37 | 0 | } |
38 | |
|
39 | |
} |