jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
40 import javax.xml.bind.JAXBContext; |
40 import javax.xml.bind.JAXBContext; |
41 import com.sun.xml.internal.org.jvnet.fastinfoset.VocabularyApplicationData; |
41 import com.sun.xml.internal.org.jvnet.fastinfoset.VocabularyApplicationData; |
42 import org.xml.sax.SAXException; |
42 import org.xml.sax.SAXException; |
43 |
43 |
44 /** |
44 /** |
45 * {@link XmlOutput} for {@link LowLevelStAXDocumentSerializer}. |
45 * {@link XmlOutput} for {@link StAXDocumentSerializer}. |
46 * <p> |
46 * <p> |
47 * This class is responsible for managing the indexing of elements, attributes |
47 * This class is responsible for managing the indexing of elements, attributes |
48 * and local names that are known to JAXB by way of the JAXBContext (generated |
48 * and local names that are known to JAXB by way of the JAXBContext (generated |
49 * from JAXB beans or schema). The pre-encoded UTF-8 representations of known |
49 * from JAXB beans or schema). The pre-encoded UTF-8 representations of known |
50 * local names are also utilized. |
50 * local names are also utilized. |
97 boolean requiresClear; |
97 boolean requiresClear; |
98 |
98 |
99 /** |
99 /** |
100 * Create a new set of tables for a JAXB context. |
100 * Create a new set of tables for a JAXB context. |
101 * <p> |
101 * <p> |
102 * @param content the JAXB context. |
102 * @param context the JAXB context. |
103 * @param initialIndexOffset the initial index offset to calculate |
103 * @param initialIndexOffset the initial index offset to calculate |
104 * the maximum possible index |
104 * the maximum possible index |
105 * |
105 * |
106 */ |
106 */ |
107 TablesPerJAXBContext(JAXBContextImpl context, int initialIndexOffset) { |
107 TablesPerJAXBContext(JAXBContextImpl context, int initialIndexOffset) { |
122 } |
122 } |
123 |
123 |
124 /** |
124 /** |
125 * Clear or reset the tables. |
125 * Clear or reset the tables. |
126 * <p> |
126 * <p> |
127 * @param initialIndexOffset the initial index offset to calculate |
127 * @param intialIndexOffset the initial index offset to calculate |
128 * the maximum possible index |
128 * the maximum possible index |
129 */ |
129 */ |
130 public void clearOrResetTables(int intialIndexOffset) { |
130 public void clearOrResetTables(int intialIndexOffset) { |
131 if (requiresClear) { |
131 if (requiresClear) { |
132 requiresClear = false; |
132 requiresClear = false; |
200 |
200 |
201 /** |
201 /** |
202 * Holder of JAXB contexts -> tables. |
202 * Holder of JAXB contexts -> tables. |
203 * <p> |
203 * <p> |
204 * An instance will be registered with the |
204 * An instance will be registered with the |
205 * {@link LowLevelStAXDocumentSerializer}. |
205 * {@link StAXDocumentSerializer}. |
206 */ |
206 */ |
207 final static class AppData implements VocabularyApplicationData { |
207 final static class AppData implements VocabularyApplicationData { |
208 final Map<JAXBContext, TablesPerJAXBContext> contexts = |
208 final Map<JAXBContext, TablesPerJAXBContext> contexts = |
209 new WeakHashMap<JAXBContext, TablesPerJAXBContext>(); |
209 new WeakHashMap<JAXBContext, TablesPerJAXBContext>(); |
210 final Collection<TablesPerJAXBContext> collectionOfContexts = contexts.values(); |
210 final Collection<TablesPerJAXBContext> collectionOfContexts = contexts.values(); |