1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Copyright 1999-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 25 import com.sun.org.apache.xerces.internal.impl.Constants; 26 import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; 27 import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; 28 import com.sun.org.apache.xerces.internal.xni.XNIException; 29 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; 30 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; 134 if (securityPropertyManager == null) { 135 securityPropertyManager = new XMLSecurityPropertyManager(); 136 fConfiguration.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); 137 } 138 139 reset(); 140 fConfiguration.parse(inputSource); 141 142 } // parse(XMLInputSource) 143 144 // 145 // Protected methods 146 // 147 148 /** 149 * reset all components before parsing 150 */ 151 protected void reset() throws XNIException { 152 } // reset() 153 154 } // class XMLParser | 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 25 import com.sun.org.apache.xerces.internal.impl.Constants; 26 import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; 27 import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; 28 import com.sun.org.apache.xerces.internal.xni.XNIException; 29 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; 30 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; 134 if (securityPropertyManager == null) { 135 securityPropertyManager = new XMLSecurityPropertyManager(); 136 fConfiguration.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); 137 } 138 139 reset(); 140 fConfiguration.parse(inputSource); 141 142 } // parse(XMLInputSource) 143 144 // 145 // Protected methods 146 // 147 148 /** 149 * reset all components before parsing 150 */ 151 protected void reset() throws XNIException { 152 } // reset() 153 154 /** 155 * Stops the parsing process. 156 * @return true if the parsing process can be stopped, false otherwise 157 */ 158 public boolean stop() { 159 return fConfiguration.stop(); 160 } 161 162 /** 163 * Resumes the parsing process that has been stopped by the {@link #stop()} 164 * method. The method will simply return if parsing is not stopped. 165 * @return true if the parsing process is resumed successfully, false 166 * otherwise 167 */ 168 public boolean resume() { 169 return fConfiguration.resume(); 170 } 171 } // class XMLParser |