< prev index next >

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

Print this page


   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.impl;
  22 import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;


 425      *                      SAXNotRecognizedException or a
 426      *                      SAXNotSupportedException.
 427      */
 428     public void reset(XMLComponentManager componentManager)
 429         throws XNIException {
 430 
 431         // features
 432         fContinueAfterFatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false);
 433 
 434         // properties
 435         fErrorHandler = (XMLErrorHandler)componentManager.getProperty(ERROR_HANDLER);
 436 
 437     } // reset(XMLComponentManager)
 438 
 439     /**
 440      * Returns a list of feature identifiers that are recognized by
 441      * this component. This method may return null if no features
 442      * are recognized by this component.
 443      */
 444     public String[] getRecognizedFeatures() {
 445         return (String[])(RECOGNIZED_FEATURES.clone());
 446     } // getRecognizedFeatures():String[]
 447 
 448     /**
 449      * Sets the state of a feature. This method is called by the component
 450      * manager any time after reset when a feature changes state.
 451      * <p>
 452      * <strong>Note:</strong> Components should silently ignore features
 453      * that do not affect the operation of the component.
 454      *
 455      * @param featureId The feature identifier.
 456      * @param state     The state of the feature.
 457      *
 458      * @throws SAXNotRecognizedException The component should not throw
 459      *                                   this exception.
 460      * @throws SAXNotSupportedException The component should not throw
 461      *                                  this exception.
 462      */
 463     public void setFeature(String featureId, boolean state)
 464         throws XMLConfigurationException {
 465 


 497             //
 498             // http://apache.org/xml/features/continue-after-fatal-error
 499             //   Allows the parser to continue after a fatal error.
 500             //   Normally, a fatal error would stop the parse.
 501             //
 502             if (suffixLength == Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE.length() &&
 503                 featureId.endsWith(Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE)) {
 504                 return fContinueAfterFatalError ;
 505             }
 506         }
 507         return false;
 508 
 509     } // setFeature(String,boolean)
 510 
 511     /**
 512      * Returns a list of property identifiers that are recognized by
 513      * this component. This method may return null if no properties
 514      * are recognized by this component.
 515      */
 516     public String[] getRecognizedProperties() {
 517         return (String[])(RECOGNIZED_PROPERTIES.clone());
 518     } // getRecognizedProperties():String[]
 519 
 520     /**
 521      * Sets the value of a property. This method is called by the component
 522      * manager any time after reset when a property changes value.
 523      * <p>
 524      * <strong>Note:</strong> Components should silently ignore properties
 525      * that do not affect the operation of the component.
 526      *
 527      * @param propertyId The property identifier.
 528      * @param value      The value of the property.
 529      *
 530      * @throws SAXNotRecognizedException The component should not throw
 531      *                                   this exception.
 532      * @throws SAXNotSupportedException The component should not throw
 533      *                                  this exception.
 534      */
 535     public void setProperty(String propertyId, Object value)
 536         throws XMLConfigurationException {
 537 


   1 /*
   2  * Copyright (c) 2015, 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 import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;


 426      *                      SAXNotRecognizedException or a
 427      *                      SAXNotSupportedException.
 428      */
 429     public void reset(XMLComponentManager componentManager)
 430         throws XNIException {
 431 
 432         // features
 433         fContinueAfterFatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false);
 434 
 435         // properties
 436         fErrorHandler = (XMLErrorHandler)componentManager.getProperty(ERROR_HANDLER);
 437 
 438     } // reset(XMLComponentManager)
 439 
 440     /**
 441      * Returns a list of feature identifiers that are recognized by
 442      * this component. This method may return null if no features
 443      * are recognized by this component.
 444      */
 445     public String[] getRecognizedFeatures() {
 446         return RECOGNIZED_FEATURES.clone();
 447     } // getRecognizedFeatures():String[]
 448 
 449     /**
 450      * Sets the state of a feature. This method is called by the component
 451      * manager any time after reset when a feature changes state.
 452      * <p>
 453      * <strong>Note:</strong> Components should silently ignore features
 454      * that do not affect the operation of the component.
 455      *
 456      * @param featureId The feature identifier.
 457      * @param state     The state of the feature.
 458      *
 459      * @throws SAXNotRecognizedException The component should not throw
 460      *                                   this exception.
 461      * @throws SAXNotSupportedException The component should not throw
 462      *                                  this exception.
 463      */
 464     public void setFeature(String featureId, boolean state)
 465         throws XMLConfigurationException {
 466 


 498             //
 499             // http://apache.org/xml/features/continue-after-fatal-error
 500             //   Allows the parser to continue after a fatal error.
 501             //   Normally, a fatal error would stop the parse.
 502             //
 503             if (suffixLength == Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE.length() &&
 504                 featureId.endsWith(Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE)) {
 505                 return fContinueAfterFatalError ;
 506             }
 507         }
 508         return false;
 509 
 510     } // setFeature(String,boolean)
 511 
 512     /**
 513      * Returns a list of property identifiers that are recognized by
 514      * this component. This method may return null if no properties
 515      * are recognized by this component.
 516      */
 517     public String[] getRecognizedProperties() {
 518         return RECOGNIZED_PROPERTIES.clone();
 519     } // getRecognizedProperties():String[]
 520 
 521     /**
 522      * Sets the value of a property. This method is called by the component
 523      * manager any time after reset when a property changes value.
 524      * <p>
 525      * <strong>Note:</strong> Components should silently ignore properties
 526      * that do not affect the operation of the component.
 527      *
 528      * @param propertyId The property identifier.
 529      * @param value      The value of the property.
 530      *
 531      * @throws SAXNotRecognizedException The component should not throw
 532      *                                   this exception.
 533      * @throws SAXNotSupportedException The component should not throw
 534      *                                  this exception.
 535      */
 536     public void setProperty(String propertyId, Object value)
 537         throws XMLConfigurationException {
 538 


< prev index next >