1 package com.thaiopensource.validate.auto; 2 3 import com.thaiopensource.util.PropertyMap; 4 import com.thaiopensource.validate.IncorrectSchemaException; 5 import com.thaiopensource.validate.Schema; 6 import com.thaiopensource.validate.SchemaReader; 7 import com.thaiopensource.validate.auto.ReparseException; 8 import com.thaiopensource.validate.auto.SchemaFuture; 9 import org.xml.sax.InputSource ; 10 import org.xml.sax.SAXException ; 11 import org.xml.sax.XMLReader ; 12 13 import java.io.IOException ; 14 15 public class SchemaReaderSchemaReceiver implements SchemaReceiver { 16 private final SchemaReader schemaLanguage; 17 private final PropertyMap properties; 18 19 public SchemaReaderSchemaReceiver(SchemaReader schemaLanguage, PropertyMap properties) { 20 this.schemaLanguage = schemaLanguage; 21 this.properties = properties; 22 } 23 24 public SchemaFuture installHandlers(XMLReader xr) throws SAXException { 25 throw new ReparseException() { 26 public Schema reparse(InputSource in) throws IncorrectSchemaException, SAXException , IOException { 27 return schemaLanguage.createSchema(in, properties); 28 } 29 }; 30 } 31 } 32 | Popular Tags |