KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > validate > auto > SchemaReaderSchemaReceiver


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 JavaDoc;
10 import org.xml.sax.SAXException JavaDoc;
11 import org.xml.sax.XMLReader JavaDoc;
12
13 import java.io.IOException JavaDoc;
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 JavaDoc xr) throws SAXException JavaDoc {
25     throw new ReparseException() {
26       public Schema reparse(InputSource JavaDoc in) throws IncorrectSchemaException, SAXException JavaDoc, IOException JavaDoc {
27         return schemaLanguage.createSchema(in, properties);
28       }
29     };
30   }
31 }
32
Popular Tags