< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java

Print this page


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

   3  */
   4 
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *     http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.impl;
  23 
  24 import com.sun.org.apache.xerces.internal.util.Status;


 372 
 373     // anybody calling this had better have set Symtoltable!
 374     protected void reset() {
 375         init();
 376 
 377         // DTD preparsing defaults:
 378         fValidation = true;
 379         fNotifyCharRefs = false;
 380 
 381     }
 382 
 383     public void reset(PropertyManager propertyManager) {
 384         init();
 385         // Xerces properties
 386         fSymbolTable = (SymbolTable)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
 387 
 388         fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);
 389 
 390         fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER);
 391         fEntityStore = fEntityManager.getEntityStore() ;
 392         fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ;
 393         fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
 394 
 395         //fEntityManager.reset();
 396         // DTD preparsing defaults:
 397         fValidation = false;
 398         fNotifyCharRefs = false;
 399 
 400     }
 401     // common scanning methods
 402 
 403     /**
 404      * Scans an XML or text declaration.
 405      * <p>
 406      * <pre>
 407      * [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
 408      * [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
 409      * [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' |  "'" EncName "'" )
 410      * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
 411      * [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
 412      *                 | ('"' ('yes' | 'no') '"'))


   1 /*
   2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Nov 2017
   4  */

   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *     http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.impl;
  23 
  24 import com.sun.org.apache.xerces.internal.util.Status;


 372 
 373     // anybody calling this had better have set Symtoltable!
 374     protected void reset() {
 375         init();
 376 
 377         // DTD preparsing defaults:
 378         fValidation = true;
 379         fNotifyCharRefs = false;
 380 
 381     }
 382 
 383     public void reset(PropertyManager propertyManager) {
 384         init();
 385         // Xerces properties
 386         fSymbolTable = (SymbolTable)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);
 387 
 388         fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);
 389 
 390         fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER);
 391         fEntityStore = fEntityManager.getEntityStore() ;
 392         fEntityScanner = fEntityManager.getEntityScanner() ;
 393         fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER);
 394 
 395         //fEntityManager.reset();
 396         // DTD preparsing defaults:
 397         fValidation = false;
 398         fNotifyCharRefs = false;
 399 
 400     }
 401     // common scanning methods
 402 
 403     /**
 404      * Scans an XML or text declaration.
 405      * <p>
 406      * <pre>
 407      * [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
 408      * [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
 409      * [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' |  "'" EncName "'" )
 410      * [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
 411      * [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
 412      *                 | ('"' ('yes' | 'no') '"'))


< prev index next >