< prev index next >

src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java

Print this page


   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


  60  */
  61 public final class PackageOutlineImpl implements PackageOutline {
  62     private final Model _model;
  63     private final JPackage _package;
  64     private final ObjectFactoryGenerator objectFactoryGenerator;
  65 
  66     /*package*/ final Set<ClassOutlineImpl> classes = new HashSet<ClassOutlineImpl>();
  67     private final Set<ClassOutlineImpl> classesView = Collections.unmodifiableSet(classes);
  68 
  69     private String mostUsedNamespaceURI;
  70     private XmlNsForm elementFormDefault;
  71     private XmlNsForm attributeFormDefault;
  72 
  73     /**
  74      * The namespace URI most commonly used in classes in this package.
  75      * This should be used as the namespace URI for {@link XmlSchema#namespace()}.
  76      *
  77      * <p>
  78      * Null if no default
  79      *
  80      * @see #calcDefaultValues().
  81      */
  82     public String getMostUsedNamespaceURI() {
  83         return mostUsedNamespaceURI;
  84     }
  85 
  86     /**
  87      * The attribute form default for this package.
  88      * <p>
  89      * The value is computed by examining what would yield the smallest generated code.
  90      */
  91     public XmlNsForm getAttributeFormDefault() {
  92         assert attributeFormDefault!=null;
  93         return attributeFormDefault;
  94     }
  95 
  96     /**
  97      * The element form default for this package.
  98      * <p>
  99      * The value is computed by examining what would yield the smallest generated code.
 100      */


   1 /*
   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.
   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


  60  */
  61 public final class PackageOutlineImpl implements PackageOutline {
  62     private final Model _model;
  63     private final JPackage _package;
  64     private final ObjectFactoryGenerator objectFactoryGenerator;
  65 
  66     /*package*/ final Set<ClassOutlineImpl> classes = new HashSet<ClassOutlineImpl>();
  67     private final Set<ClassOutlineImpl> classesView = Collections.unmodifiableSet(classes);
  68 
  69     private String mostUsedNamespaceURI;
  70     private XmlNsForm elementFormDefault;
  71     private XmlNsForm attributeFormDefault;
  72 
  73     /**
  74      * The namespace URI most commonly used in classes in this package.
  75      * This should be used as the namespace URI for {@link XmlSchema#namespace()}.
  76      *
  77      * <p>
  78      * Null if no default
  79      *
  80      * @see #calcDefaultValues()
  81      */
  82     public String getMostUsedNamespaceURI() {
  83         return mostUsedNamespaceURI;
  84     }
  85 
  86     /**
  87      * The attribute form default for this package.
  88      * <p>
  89      * The value is computed by examining what would yield the smallest generated code.
  90      */
  91     public XmlNsForm getAttributeFormDefault() {
  92         assert attributeFormDefault!=null;
  93         return attributeFormDefault;
  94     }
  95 
  96     /**
  97      * The element form default for this package.
  98      * <p>
  99      * The value is computed by examining what would yield the smallest generated code.
 100      */


< prev index next >