1 package org.simantics.xml.data;
4 import java.io.FileNotFoundException;
5 import java.io.IOException;
8 import javax.xml.bind.JAXBException;
10 import org.simantics.xml.sax.SchemaConverter;
11 import org.w3._2001.xmlschema.Schema;
13 public class DataSchemaConverter extends SchemaConverter {
16 private Map<String,Schema> schemaMap;
17 private Map<Schema,File> fileMap;
19 public DataSchemaConverter(Schema schema, File schemaFile, File conversionFile, File outputPlugin) throws IOException {
20 super(schemaFile, conversionFile, outputPlugin);
25 protected Schema createSchema() throws JAXBException, FileNotFoundException {
29 public void setSchemaMap(Map<String, Schema> schemaMap) {
30 this.schemaMap = schemaMap;
33 public void setFileMap(Map<Schema, File> fileMap) {
34 this.fileMap = fileMap;
39 protected SchemaConverter constructSubConverter(SchemaConverter parent, File schemaFile, File conversionFile,
40 File outputPlugin, String ns) throws IOException {
42 Schema schema = ((DataSchemaConverter)getRoot()).schemaMap.get(ns);
43 File file = ((DataSchemaConverter)getRoot()).fileMap.get(schema);
44 return new DataSchemaConverter(schema, this, file, conversionFile, outputPlugin);
47 public DataSchemaConverter(Schema schema, SchemaConverter parent, File schemaFile, File conversionFile, File outputPlugin)
49 super(parent, schemaFile, conversionFile, outputPlugin);