src/java.xml/share/classes/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java

Print this page


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2004 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");
   9  * you may not use this file except in compliance with the License.
  10  * You may obtain a copy of the License at

  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.parsers;
  22 
  23 import java.io.IOException;
  24 import java.util.ArrayList;
  25 import java.util.HashMap;
  26 import java.util.Locale;
  27 
  28 import com.sun.org.apache.xerces.internal.impl.Constants;
  29 import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
  30 import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
  31 import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
  32 import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
  33 import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
  34 import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
  35 import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
  36 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
  37 import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
  38 import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
  39 import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDProcessor;
  40 import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDValidator;
  41 import com.sun.org.apache.xerces.internal.impl.dtd.XML11NSDTDValidator;
  42 import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor;
  43 import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
  44 import com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator;
  45 import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
  46 import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
  47 import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
  48 import com.sun.org.apache.xerces.internal.util.FeatureState;
  49 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
  50 import com.sun.org.apache.xerces.internal.util.PropertyState;
  51 import com.sun.org.apache.xerces.internal.util.Status;
  52 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  53 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
  54 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
  55 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
  56 import com.sun.org.apache.xerces.internal.xni.XMLLocator;
  57 import com.sun.org.apache.xerces.internal.xni.XNIException;
  58 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
  59 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
  60 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
  61 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
  62 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
  63 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
  64 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
  65 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
  66 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  67 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
  68 import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
  69 
  70 /**
  71  * This class is the DTD-only parser configuration


 743             if (PRINT_EXCEPTION_STACK_TRACE)
 744                 ex.printStackTrace();
 745             throw ex;
 746         } catch (IOException ex) {
 747             if (PRINT_EXCEPTION_STACK_TRACE)
 748                 ex.printStackTrace();
 749             throw ex;
 750         } catch (RuntimeException ex) {
 751             if (PRINT_EXCEPTION_STACK_TRACE)
 752                 ex.printStackTrace();
 753             throw ex;
 754         } catch (Exception ex) {
 755             if (PRINT_EXCEPTION_STACK_TRACE)
 756                 ex.printStackTrace();
 757             throw new XNIException(ex);
 758         }
 759 
 760     } // parse(boolean):boolean
 761 
 762         /**


















 763          * Returns the state of a feature.
 764          *
 765          * @param featureId The feature identifier.
 766                  * @return true if the feature is supported
 767          *
 768          * @throws XMLConfigurationException Thrown for configuration error.
 769          *                                   In general, components should
 770          *                                   only throw this exception if
 771          *                                   it is <strong>really</strong>
 772          *                                   a critical error.
 773          */
 774         public FeatureState getFeatureState(String featureId)
 775                 throws XMLConfigurationException {
 776                         // make this feature special
 777         if (featureId.equals(PARSER_SETTINGS)){
 778                 return FeatureState.is(fConfigUpdated);
 779         }
 780         return super.getFeatureState(featureId);
 781 
 782         } // getFeature(String):boolean


   1 /*
   2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.

   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.parsers;
  22 
  23 import java.io.IOException;
  24 import java.util.ArrayList;
  25 import java.util.HashMap;
  26 import java.util.Locale;
  27 
  28 import com.sun.org.apache.xerces.internal.impl.Constants;
  29 import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
  30 import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
  31 import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
  32 import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
  33 import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
  34 import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
  35 import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
  36 import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
  37 import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
  38 import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
  39 import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDProcessor;
  40 import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDValidator;
  41 import com.sun.org.apache.xerces.internal.impl.dtd.XML11NSDTDValidator;
  42 import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor;
  43 import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
  44 import com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator;
  45 import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
  46 import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
  47 import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
  48 import com.sun.org.apache.xerces.internal.util.FeatureState;
  49 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
  50 import com.sun.org.apache.xerces.internal.util.PropertyState;

  51 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  52 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
  53 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
  54 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
  55 import com.sun.org.apache.xerces.internal.xni.XMLLocator;
  56 import com.sun.org.apache.xerces.internal.xni.XNIException;
  57 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
  58 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
  59 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
  60 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
  61 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
  62 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
  63 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
  64 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
  65 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  66 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
  67 import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
  68 
  69 /**
  70  * This class is the DTD-only parser configuration


 742             if (PRINT_EXCEPTION_STACK_TRACE)
 743                 ex.printStackTrace();
 744             throw ex;
 745         } catch (IOException ex) {
 746             if (PRINT_EXCEPTION_STACK_TRACE)
 747                 ex.printStackTrace();
 748             throw ex;
 749         } catch (RuntimeException ex) {
 750             if (PRINT_EXCEPTION_STACK_TRACE)
 751                 ex.printStackTrace();
 752             throw ex;
 753         } catch (Exception ex) {
 754             if (PRINT_EXCEPTION_STACK_TRACE)
 755                 ex.printStackTrace();
 756             throw new XNIException(ex);
 757         }
 758 
 759     } // parse(boolean):boolean
 760 
 761     /**
 762      * Stops the parsing process.
 763      */
 764     @Override
 765     public boolean stop() {
 766         //no-op. this feature is implemented in the specific SAX parser.
 767         return false;
 768     }
 769 
 770     /**
 771      * Resumes parsing after it was stopped by calling the stop method.
 772      */
 773     @Override
 774     public boolean resume() {
 775         //no-op. this feature is implemented in the specific SAX parser.
 776         return false;
 777     }
 778 
 779     /**
 780      * Returns the state of a feature.
 781      *
 782      * @param featureId The feature identifier.
 783              * @return true if the feature is supported
 784      *
 785      * @throws XMLConfigurationException Thrown for configuration error.
 786      *                                   In general, components should
 787      *                                   only throw this exception if
 788      *                                   it is <strong>really</strong>
 789      *                                   a critical error.
 790      */
 791     public FeatureState getFeatureState(String featureId)
 792             throws XMLConfigurationException {
 793                     // make this feature special
 794     if (featureId.equals(PARSER_SETTINGS)){
 795             return FeatureState.is(fConfigUpdated);
 796     }
 797     return super.getFeatureState(featureId);
 798 
 799     } // getFeature(String):boolean