01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.parsers;
19:
20: import org.apache.xerces.util.SoftReferenceSymbolTable;
21: import org.apache.xerces.util.SymbolTable;
22: import org.apache.xerces.xni.grammars.XMLGrammarPool;
23: import org.apache.xerces.xni.parser.XMLComponentManager;
24:
25: /**
26: * This parser configuration extends the default configuration allowing Xerces to
27: * handle usage scenarios where the names in the XML documents being parsed are mostly
28: * unique by installing a memory sensitive <code>SymbolTable</code>. The internalized
29: * strings stored in this <code>SymbolTable</code> are softly reachable and may be
30: * cleared by the garbage collector in response to memory demand.
31: *
32: * @see org.apache.xerces.util.SoftReferenceSymbolTable
33: *
34: * @author Peter McCracken, IBM
35: *
36: * @version $Id: SoftReferenceSymbolTableConfiguration.java 478344 2006-11-22 22:19:56Z mrglavas $
37: */
38: public class SoftReferenceSymbolTableConfiguration extends
39: XIncludeAwareParserConfiguration {
40:
41: /** Default constructor. */
42: public SoftReferenceSymbolTableConfiguration() {
43: this (new SoftReferenceSymbolTable(), null, null);
44: } // <init>()
45:
46: /**
47: * Constructs a parser configuration using the specified symbol table.
48: *
49: * @param symbolTable The symbol table to use.
50: */
51: public SoftReferenceSymbolTableConfiguration(SymbolTable symbolTable) {
52: this (symbolTable, null, null);
53: } // <init>(SymbolTable)
54:
55: /**
56: * Constructs a parser configuration using the specified symbol table and
57: * grammar pool.
58: * <p>
59: *
60: * @param symbolTable The symbol table to use.
61: * @param grammarPool The grammar pool to use.
62: */
63: public SoftReferenceSymbolTableConfiguration(
64: SymbolTable symbolTable, XMLGrammarPool grammarPool) {
65: this (symbolTable, grammarPool, null);
66: } // <init>(SymbolTable,XMLGrammarPool)
67:
68: /**
69: * Constructs a parser configuration using the specified symbol table,
70: * grammar pool, and parent settings.
71: * <p>
72: *
73: * @param symbolTable The symbol table to use.
74: * @param grammarPool The grammar pool to use.
75: * @param parentSettings The parent settings.
76: */
77: public SoftReferenceSymbolTableConfiguration(
78: SymbolTable symbolTable, XMLGrammarPool grammarPool,
79: XMLComponentManager parentSettings) {
80: super(symbolTable, grammarPool, parentSettings);
81: }
82: }
|