1 /*
2 * Copyright (c) 2008, 2014, 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
876 return fCurrentScanner.scanDocument(complete);
877 } catch (XNIException ex) {
878 if (PRINT_EXCEPTION_STACK_TRACE)
879 ex.printStackTrace();
880 throw ex;
881 } catch (IOException ex) {
882 if (PRINT_EXCEPTION_STACK_TRACE)
883 ex.printStackTrace();
884 throw ex;
885 } catch (RuntimeException ex) {
886 if (PRINT_EXCEPTION_STACK_TRACE)
887 ex.printStackTrace();
888 throw ex;
889 } catch (Exception ex) {
890 if (PRINT_EXCEPTION_STACK_TRACE)
891 ex.printStackTrace();
892 throw new XNIException(ex);
893 }
894
895 } // parse(boolean):boolean
896
897 /**
898 * Returns the state of a feature.
899 *
900 * @param featureId The feature identifier.
901 * @return true if the feature is supported
902 *
903 * @throws XMLConfigurationException Thrown for configuration error.
904 * In general, components should
905 * only throw this exception if
906 * it is <strong>really</strong>
907 * a critical error.
908 */
909 public FeatureState getFeatureState(String featureId)
910 throws XMLConfigurationException {
911 // make this feature special
912 if (featureId.equals(PARSER_SETTINGS)){
913 return FeatureState.is(fConfigUpdated);
914 }
915 return super.getFeatureState(featureId);
|
1 /*
2 * Copyright (c) 2008, 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
876 return fCurrentScanner.scanDocument(complete);
877 } catch (XNIException ex) {
878 if (PRINT_EXCEPTION_STACK_TRACE)
879 ex.printStackTrace();
880 throw ex;
881 } catch (IOException ex) {
882 if (PRINT_EXCEPTION_STACK_TRACE)
883 ex.printStackTrace();
884 throw ex;
885 } catch (RuntimeException ex) {
886 if (PRINT_EXCEPTION_STACK_TRACE)
887 ex.printStackTrace();
888 throw ex;
889 } catch (Exception ex) {
890 if (PRINT_EXCEPTION_STACK_TRACE)
891 ex.printStackTrace();
892 throw new XNIException(ex);
893 }
894
895 } // parse(boolean):boolean
896
897 /**
898 * Stops the parsing process.
899 */
900 public boolean stop() {
901 return fCurrentScanner.stop();
902 }
903
904 /**
905 * Resumes parsing after it was stopped by calling the stop method.
906 */
907 public boolean resume() {
908 return fCurrentScanner.resume();
909 }
910
911 /**
912 * Returns the state of a feature.
913 *
914 * @param featureId The feature identifier.
915 * @return true if the feature is supported
916 *
917 * @throws XMLConfigurationException Thrown for configuration error.
918 * In general, components should
919 * only throw this exception if
920 * it is <strong>really</strong>
921 * a critical error.
922 */
923 public FeatureState getFeatureState(String featureId)
924 throws XMLConfigurationException {
925 // make this feature special
926 if (featureId.equals(PARSER_SETTINGS)){
927 return FeatureState.is(fConfigUpdated);
928 }
929 return super.getFeatureState(featureId);
|