1 /*
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3 * @LastModified: Oct 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.parsers;
23
33 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
34 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
35 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
36 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
37 import java.io.IOException;
38 import java.util.Collections;
39 import java.util.HashMap;
40 import java.util.Locale;
41 import java.util.Map;
42
43 /**
44 * <p> This class provides an easy way for a user to preparse grammars
45 * of various types. By default, it knows how to preparse external
46 * DTD's and schemas; it provides an easy way for user applications to
47 * register classes that know how to parse additional grammar types.
48 * By default, it does no grammar caching; but it provides ways for
49 * user applications to do so.
50 *
51 * @author Neil Graham, IBM
52 *
53 */
54 public class XMLGrammarPreparser {
55
56 //
57 // Constants
58 //
59
60 // feature: continue-after-fatal-error
61 private final static String CONTINUE_AFTER_FATAL_ERROR =
62 Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
63
64 /** Property identifier: symbol table. */
65 protected static final String SYMBOL_TABLE =
66 Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
67
68 /** Property identifier: error reporter. */
69 protected static final String ERROR_REPORTER =
70 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
71
72 /** Property identifier: error handler. */
|
1 /*
2 * Copyright (c) 2015, 2017, 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
32 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
33 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
34 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
35 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
36 import java.io.IOException;
37 import java.util.Collections;
38 import java.util.HashMap;
39 import java.util.Locale;
40 import java.util.Map;
41
42 /**
43 * <p> This class provides an easy way for a user to preparse grammars
44 * of various types. By default, it knows how to preparse external
45 * DTD's and schemas; it provides an easy way for user applications to
46 * register classes that know how to parse additional grammar types.
47 * By default, it does no grammar caching; but it provides ways for
48 * user applications to do so.
49 *
50 * @author Neil Graham, IBM
51 *
52 * @LastModified: Oct 2017
53 */
54 public class XMLGrammarPreparser {
55
56 //
57 // Constants
58 //
59
60 // feature: continue-after-fatal-error
61 private final static String CONTINUE_AFTER_FATAL_ERROR =
62 Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
63
64 /** Property identifier: symbol table. */
65 protected static final String SYMBOL_TABLE =
66 Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
67
68 /** Property identifier: error reporter. */
69 protected static final String ERROR_REPORTER =
70 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
71
72 /** Property identifier: error handler. */
|