db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/java/org/apache/torque/engine/database/transform XmlToAppData.java XmlToData.java
Date Mon, 28 Jul 2003 16:33:36 GMT
mpoeschl    2003/07/28 09:33:35

  Modified:    src/generator/src/java/org/apache/torque/engine/database/transform
                        XmlToAppData.java XmlToData.java
  Log:
  resolveEntity must not throw an IOException as the DefaultHandler method only throws SAXEception
  (while the sun compiler accepts this in eclipse i get an error)
  so we catch the IOException and throw a SAXException
  
  Revision  Changes    Path
  1.5       +14 -15    db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/XmlToAppData.java
  
  Index: XmlToAppData.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/XmlToAppData.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XmlToAppData.java	25 Jul 2003 16:39:07 -0000	1.4
  +++ XmlToAppData.java	28 Jul 2003 16:33:34 -0000	1.5
  @@ -55,16 +55,17 @@
    */
   
   import java.io.BufferedReader;
  -import java.io.FileReader;
  -import java.io.FileNotFoundException;
  -import java.io.IOException;
   import java.io.File;
  -import java.util.Vector;
  +import java.io.FileNotFoundException;
  +import java.io.FileReader;
   import java.util.Stack;
  +import java.util.Vector;
  +
  +import javax.xml.parsers.SAXParser;
  +import javax.xml.parsers.SAXParserFactory;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.apache.torque.engine.EngineException;
   import org.apache.torque.engine.database.model.AppData;
   import org.apache.torque.engine.database.model.Column;
  @@ -73,15 +74,10 @@
   import org.apache.torque.engine.database.model.Index;
   import org.apache.torque.engine.database.model.Table;
   import org.apache.torque.engine.database.model.Unique;
  -
  -import javax.xml.parsers.SAXParser;
  -import javax.xml.parsers.SAXParserFactory;
  -
   import org.xml.sax.Attributes;
   import org.xml.sax.InputSource;
  -import org.xml.sax.SAXParseException;
  -import org.xml.sax.helpers.DefaultHandler;
   import org.xml.sax.SAXException;
  +import org.xml.sax.helpers.DefaultHandler;
   
   /**
    * A Class that is used to parse an input xml schema file and creates an AppData
  @@ -219,10 +215,13 @@
        * @return an InputSource for the database.dtd file
        */
       public InputSource resolveEntity(String publicId, String systemId)
  -            throws SAXException,
  -                   IOException
  +            throws SAXException
       {
  -        return new DTDResolver().resolveEntity(publicId, systemId);
  +		try {
  +			return new DTDResolver().resolveEntity(publicId, systemId);
  +		} catch (Exception e) {
  +			throw new SAXException(e);
  +		}
       }
   
   
  
  
  
  1.8       +17 -17    db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/XmlToData.java
  
  Index: XmlToData.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/transform/XmlToData.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XmlToData.java	28 Jul 2003 11:48:13 -0000	1.7
  +++ XmlToData.java	28 Jul 2003 16:33:34 -0000	1.8
  @@ -60,26 +60,22 @@
   import java.io.IOException;
   import java.net.MalformedURLException;
   import java.net.URL;
  -import java.util.List;
   import java.util.ArrayList;
  +import java.util.List;
   
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   
   import org.apache.commons.lang.StringUtils;
  -
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.apache.torque.engine.database.model.Column;
   import org.apache.torque.engine.database.model.Database;
   import org.apache.torque.engine.database.model.Table;
  -
   import org.xml.sax.Attributes;
   import org.xml.sax.EntityResolver;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  -import org.xml.sax.SAXParseException;
   import org.xml.sax.helpers.DefaultHandler;
   
   /**
  @@ -199,18 +195,22 @@
        * @return an InputSource for the database.dtd file
        */
       public InputSource resolveEntity(String publicId, String systemId)
  -            throws IOException
  +            throws SAXException
       {
  -        if (dataDTD != null && dtdFileName.equals(systemId))
  -        {
  -            log.info("Resolver: used " + dtdFile.getPath());
  -            return dataDTD;
  -        }
  -        else
  -        {
  -            log.info("Resolver: used " + systemId);
  -            return getInputSource(systemId);
  -        }
  +		try {
  +			if (dataDTD != null && dtdFileName.equals(systemId))
  +			{
  +			    log.info("Resolver: used " + dtdFile.getPath());
  +			    return dataDTD;
  +			}
  +			else
  +			{
  +			    log.info("Resolver: used " + systemId);
  +			    return getInputSource(systemId);
  +			}
  +		} catch (IOException e) {
  +			throw new SAXException(e);
  +		}
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message