< prev index next >

src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java

Print this page


   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  78  * put into a forest explicitly, not because it is referenced from another
  79  * document. (However, a root document can be referenced from other
  80  * documents, too.)
  81  *
  82  * @author
  83  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  84  */
  85 public final class DOMForest {
  86     /** actual data storage map&lt;SystemId,Document>. */
  87     private final Map<String,Document> core = new HashMap<String,Document>();
  88 
  89     /**
  90      * To correctly feed documents to a schema parser, we need to remember
  91      * which documents (of the forest) were given as the root
  92      * documents, and which of them are read as included/imported
  93      * documents.
  94      *
  95      * <p>
  96      * Set of system ids as strings.
  97      */
  98     private final Set<String> rootDocuments = new HashSet<String>();
  99 
 100     /** Stores location information for all the trees in this forest. */
 101     public final LocatorTable locatorTable = new LocatorTable();
 102 
 103     /** Stores all the outer-most &lt;jaxb:bindings> customizations. */
 104     public final Set<Element> outerMostBindings = new HashSet<Element>();
 105 
 106     /** Used to resolve references to other schema documents. */
 107     private EntityResolver entityResolver = null;
 108 
 109     /** Errors encountered during the parsing will be sent to this object. */
 110     private ErrorReceiver errorReceiver = null;
 111 
 112     /** Schema language dependent part of the processing. */
 113     protected final InternalizationLogic logic;
 114 
 115     private final SAXParserFactory parserFactory;
 116     private final DocumentBuilder documentBuilder;
 117 
 118     private final Options options;


   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  78  * put into a forest explicitly, not because it is referenced from another
  79  * document. (However, a root document can be referenced from other
  80  * documents, too.)
  81  *
  82  * @author
  83  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  84  */
  85 public final class DOMForest {
  86     /** actual data storage map&lt;SystemId,Document>. */
  87     private final Map<String,Document> core = new HashMap<String,Document>();
  88 
  89     /**
  90      * To correctly feed documents to a schema parser, we need to remember
  91      * which documents (of the forest) were given as the root
  92      * documents, and which of them are read as included/imported
  93      * documents.
  94      *
  95      * <p>
  96      * Set of system ids as strings.
  97      */
  98     private final Set<String> rootDocuments = new LinkedHashSet<String>();
  99 
 100     /** Stores location information for all the trees in this forest. */
 101     public final LocatorTable locatorTable = new LocatorTable();
 102 
 103     /** Stores all the outer-most &lt;jaxb:bindings> customizations. */
 104     public final Set<Element> outerMostBindings = new HashSet<Element>();
 105 
 106     /** Used to resolve references to other schema documents. */
 107     private EntityResolver entityResolver = null;
 108 
 109     /** Errors encountered during the parsing will be sent to this object. */
 110     private ErrorReceiver errorReceiver = null;
 111 
 112     /** Schema language dependent part of the processing. */
 113     protected final InternalizationLogic logic;
 114 
 115     private final SAXParserFactory parserFactory;
 116     private final DocumentBuilder documentBuilder;
 117 
 118     private final Options options;


< prev index next >