You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ed...@apache.org on 2002/02/03 18:58:13 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/jaxp JAXPConstants.java SAXParserImpl.java DocumentBuilderImpl.java

edwingo     02/02/03 09:58:13

  Modified:    java/src/org/apache/xerces/jaxp SAXParserImpl.java
                        DocumentBuilderImpl.java
  Added:       java/src/org/apache/xerces/jaxp JAXPConstants.java
  Log:
  Minor cleanup to JAXP code for constants
  
  Revision  Changes    Path
  1.16      +7 -6      xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserImpl.java
  
  Index: SAXParserImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SAXParserImpl.java	29 Jan 2002 01:15:17 -0000	1.15
  +++ SAXParserImpl.java	3 Feb 2002 17:58:13 -0000	1.16
  @@ -1,5 +1,5 @@
   /*
  - * $Id: SAXParserImpl.java,v 1.15 2002/01/29 01:15:17 lehors Exp $
  + * $Id: SAXParserImpl.java,v 1.16 2002/02/03 17:58:13 edwingo Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -85,7 +85,8 @@
    * This is the implementation specific class for the
    * <code>javax.xml.parsers.SAXParser</code>. 
    */
  -public class SAXParserImpl extends javax.xml.parsers.SAXParser {
  +public class SAXParserImpl extends javax.xml.parsers.SAXParser
  +        implements JAXPConstants {
       private XMLReader xmlReader;
       private String schemaLanguage = null;     // null means DTD
       
  @@ -185,10 +186,10 @@
       public void setProperty(String name, Object value)
           throws SAXNotRecognizedException, SAXNotSupportedException
       {
  -        if (DocumentBuilderImpl.JAXP_SCHEMA_LANGUAGE.equals(name)) {
  +        if (JAXP_SCHEMA_LANGUAGE.equals(name)) {
               // JAXP 1.2 support
  -            if (DocumentBuilderImpl.W3C_XML_SCHEMA.equals(value)) {
  -                schemaLanguage = DocumentBuilderImpl.W3C_XML_SCHEMA;
  +            if (W3C_XML_SCHEMA.equals(value)) {
  +                schemaLanguage = W3C_XML_SCHEMA;
                   xmlReader.setFeature(Constants.XERCES_FEATURE_PREFIX +
                                        Constants.SCHEMA_VALIDATION_FEATURE,
                                        true);
  @@ -213,7 +214,7 @@
       public Object getProperty(String name)
           throws SAXNotRecognizedException, SAXNotSupportedException
       {
  -        if (DocumentBuilderImpl.JAXP_SCHEMA_LANGUAGE.equals(name)) {
  +        if (JAXP_SCHEMA_LANGUAGE.equals(name)) {
               // JAXP 1.2 support
               return schemaLanguage;
           } else {
  
  
  
  1.16      +5 -9      xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java
  
  Index: DocumentBuilderImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DocumentBuilderImpl.java	29 Jan 2002 01:15:17 -0000	1.15
  +++ DocumentBuilderImpl.java	3 Feb 2002 17:58:13 -0000	1.16
  @@ -1,5 +1,5 @@
   /*
  - * $Id: DocumentBuilderImpl.java,v 1.15 2002/01/29 01:15:17 lehors Exp $
  + * $Id: DocumentBuilderImpl.java,v 1.16 2002/02/03 17:58:13 edwingo Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -89,13 +89,9 @@
    * @author Rajiv Mordani
    * @author Edwin Goei
    */
  -public class DocumentBuilderImpl extends DocumentBuilder {
  -    /** JAXP 1.2 features and values */
  -    static final String JAXP_SCHEMA_LANGUAGE =
  -        "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  -    static final String W3C_XML_SCHEMA =
  -        "http://www.w3.org/2001/XMLSchema";
  -
  +public class DocumentBuilderImpl extends DocumentBuilder
  +        implements JAXPConstants
  +{
       private EntityResolver er = null;
       private ErrorHandler eh = null;
       private DOMParser domParser = null;
  @@ -173,7 +169,7 @@
                               Constants.SCHEMA_VALIDATION_FEATURE, true);
                       }
                   } else {
  -                    // Assume Xerces property
  +                    // Let Xerces code handle the property
                       domParser.setProperty(name, val);
                   }
               }
  
  
  
  1.1                  xml-xerces/java/src/org/apache/xerces/jaxp/JAXPConstants.java
  
  Index: JAXPConstants.java
  ===================================================================
  /*
   * $Id: JAXPConstants.java,v 1.1 2002/02/03 17:58:13 edwingo Exp $
   *
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xerces" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, Sun Microsystems, Inc., 
   * http://www.sun.com.  For more information on the Apache Software 
   * Foundation, please see <http://www.apache.org/>.
   */
  
  
  package org.apache.xerces.jaxp;
  
  /**
   * This interface holds JAXP constant property/attribute names and values.
   * Since JAXP 1.2 is a maintenance release of JAXP 1.1, no public
   * signatures are allowed so these values cannot be exposed in the
   * javax.xml.parsers package.  Once equivalent constants have been defined
   * in future JAXP spec versions, this interface can be removed.
   *
   * @author Edwin Goei
   */
  public interface JAXPConstants {
      static final String JAXP_SCHEMA_LANGUAGE =
          "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
      static final String W3C_XML_SCHEMA =
          "http://www.w3.org/2001/XMLSchema";
  
      static final String JAXP_SCHEMA_SOURCE =
          "http://java.sun.com/xml/jaxp/properties/schemaSource";
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org