You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2021/02/21 21:34:01 UTC

svn commit: r1886771 [4/8] - in /xmlbeans/trunk: ./ src/main/java/org/apache/xmlbeans/ src/main/java/org/apache/xmlbeans/impl/schema/ src/main/java/org/apache/xmlbeans/impl/tool/ src/main/java/org/apache/xmlbeans/impl/values/ src/main/multimodule/java9...

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlObject.java Sun Feb 21 21:34:00 2021
@@ -15,15 +15,10 @@
 
 package org.apache.xmlbeans;
 
-import org.w3c.dom.DOMImplementation;
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
 import org.w3c.dom.Node;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
 
 /**
  * Corresponds to the XML Schema
@@ -40,7 +35,7 @@ import java.io.Reader;
  * <p>
  * <ul>
  * <li>Every XML Bean class has an inner Factory class for creating and parsing
- *     instances, including XmlObject. Use {@link XmlObject.Factory} itself
+ *     instances, including XmlObject. Use {@link XmlObjectFactory} itself
  *     to produce untyped XML trees or XML trees that implement specific
  *     subtypes of XmlObject depending on a recognized root document element.
  *     If you depend on the automatic type inference, you will want to understand
@@ -53,8 +48,8 @@ import java.io.Reader;
  *     an XML document, you will want to understand the inner contents
  *     versus outer container issues described below.
  * <li>It is also simple to copy an XmlObject instance to or from a standard
- *     DOM tree or SAX stream.  Use {@link XmlObject.Factory#parse(Node)},
- *     for example, to load from DOM; use {@link XmlObject.Factory#newXmlSaxHandler}
+ *     DOM tree or SAX stream.  Use {@link XmlObjectFactory#parse(Node)},
+ *     for example, to load from DOM; use {@link XmlObjectFactory#newXmlSaxHandler}
  *     to load from SAX; use {@link #newDomNode()} to save to DOM; and use
  *     {@link #save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)}
  *     to save to SAX.
@@ -72,7 +67,7 @@ import java.io.Reader;
  *     the current element or attribute.)
  * </ul>
  * <p>
- * Type inference.  When using {@link XmlObject.Factory} to parse XML documents,
+ * Type inference.  When using {@link XmlObjectFactory} to parse XML documents,
  * the actual document type is not {@link XmlObject#type} itself, but a subtype
  * based on the contents of the parsed document.  If the parsed document
  * contains a recognized root document element, then the actual type of the
@@ -113,7 +108,7 @@ import java.io.Reader;
  * which is saved by default.
  * <p>
  * Reading and writing fragments. When reading or writing the contents of a
- * whole XML document, the standard XML reprentation for a document is used.
+ * whole XML document, the standard XML representation for a document is used.
  * However, there is no standard concrete XML representation for "just the
  * contents" of an interior element or attribute. So when one is needed,
  * the tag &lt;xml-fragment&gt; is used to wrap the contents.  This tag is used
@@ -130,10 +125,12 @@ import java.io.Reader;
  * with future versions of XMLBeans that add additional methods on XmlObject.
  */
 public interface XmlObject extends XmlTokenSource {
+    XmlObjectFactory<XmlObject> Factory = new XmlObjectFactory<>("_BI_anyType");
+
     /**
      * The constant {@link SchemaType} object representing this schema type.
      */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_anyType");
+    SchemaType type = Factory.getType();
 
     /**
      * @return The schema type for this instance. This is a permanent,
@@ -148,7 +145,7 @@ public interface XmlObject extends XmlTo
      * tree.
      *
      * @return true if the contents of this object are valid
-     * accoring to schemaType().
+     * according to schemaType().
      */
     boolean validate();
 
@@ -187,7 +184,7 @@ public interface XmlObject extends XmlTo
      * @param options An object that implements the {@link java.util.Collection
      *                Collection} interface.
      * @return true if the contents of this object are valid
-     * accoring to schemaType().
+     * according to schemaType().
      */
     boolean validate(XmlOptions options);
 
@@ -196,7 +193,7 @@ public interface XmlObject extends XmlTo
      * <p>
      * <p>
      * The path must be a relative path, where "." represents the
-     * element or attribute containg this XmlObject, and it must select
+     * element or attribute containing this XmlObject, and it must select
      * only other elements or attributes.  If a non-element or non-attribute
      * is selected, an unchecked exception is thrown.
      * <p>
@@ -364,7 +361,7 @@ public interface XmlObject extends XmlTo
      * In order for the operation to succeed, several conditions must hold:
      * <ul><li> the container of this type must be an element </li>
      * <li> a global element with the name <code>newName</code> must exist
-     * and must be in the substition group of the containing element </li>
+     * and must be in the substitution group of the containing element </li>
      * <li> the <code>newType</code> type must be consistent with the declared
      * type of the new element </li></ul>
      * <p>
@@ -440,7 +437,7 @@ public interface XmlObject extends XmlTo
      * not copied.
      * <p>
      * Note: The result object will be in the same synchronization domain as the source,
-     * and additional synchronization is required for concurent access.
+     * and additional synchronization is required for concurrent access.
      * To use a different synchronization domain use setCopyUseNewSynchronizationDomain
      * option with copy(XmlOptions) method.
      *
@@ -457,7 +454,7 @@ public interface XmlObject extends XmlTo
      * not copied.
      * <p>
      * Note: The result object will be in the same synchronization domain as the source,
-     * and additional synchronization is required for concurent access.
+     * and additional synchronization is required for concurrent access.
      * To use a different synchronization domain use setCopyUseNewSynchronizationDomain
      * option when creating the original XmlObject.
      *
@@ -470,7 +467,7 @@ public interface XmlObject extends XmlTo
      * (which are distinguished by equals(obj) == false) may of
      * course have equal values (valueEquals(obj) == true).
      * <p>
-     * Usually this method can be treated as an ordinary equvalence
+     * Usually this method can be treated as an ordinary equivalence
      * relation, but actually it is not is not transitive.
      * Here is a precise specification:
      * <p>
@@ -501,7 +498,7 @@ public interface XmlObject extends XmlTo
     int valueHashCode();
 
     /**
-     * Impelements the Comparable interface by comparing two simple
+     * Implements the Comparable interface by comparing two simple
      * xml values based on their standard XML schema ordering.
      * Throws a ClassCastException if no standard ordering applies,
      * or if the two values are incomparable within a partial order.
@@ -520,22 +517,22 @@ public interface XmlObject extends XmlTo
     /**
      * LESS_THAN is -1. See {@link #compareValue}.
      */
-    static final int LESS_THAN = -1;
+    int LESS_THAN = -1;
 
     /**
      * EQUAL is 0. See {@link #compareValue}.
      */
-    static final int EQUAL = 0;
+    int EQUAL = 0;
 
     /**
      * GREATER_THAN is 1. See {@link #compareValue}.
      */
-    static final int GREATER_THAN = 1;
+    int GREATER_THAN = 1;
 
     /**
      * NOT_EQUAL is 2. See {@link #compareValue}.
      */
-    static final int NOT_EQUAL = 2;
+    int NOT_EQUAL = 2;
 
     /**
      * Selects the contents of the children elements with the given name.
@@ -590,283 +587,4 @@ public interface XmlObject extends XmlTo
      * @see QNameSetBuilder for creating sets of qnames
      */
     XmlObject[] selectAttributes(QNameSet attributeNameSet);
-
-    /**
-     * Static factory class for creating new instances.  Note that if
-     * a type can be inferred from the XML being loaded (for example,
-     * by recognizing the document element QName), then the instance
-     * returned by a factory will have the inferred type.  Otherwise
-     * the Factory will returned an untyped document.
-     */
-    final class Factory {
-        /**
-         * Creates a new, completely empty instance.
-         */
-        public static XmlObject newInstance() {
-            return XmlBeans.getContextTypeLoader().newInstance(null, null);
-        }
-
-        /**
-         * <p>Creates a new, completely empty instance, specifying options
-         * for the root element's document type and/or whether to validate
-         * value facets as they are set.</p>
-         * <p>
-         * Use the <em>options</em> parameter to specify the following:</p>
-         *
-         * <table>
-         * <tr><th>To specify this</th><th>Use this method</th></tr>
-         * <tr>
-         *  <td>The document type for the root element.</td>
-         *  <td>{@link XmlOptions#setDocumentType}</td>
-         * </tr>
-         * <tr>
-         *  <td>Whether value facets should be checked as they are set.</td>
-         *  <td>{@link XmlOptions#setValidateOnSet}</td>
-         * </tr>
-         * </table>
-         *
-         * @param options Options specifying root document type and/or value facet
-         *                checking.
-         * @return A new, empty instance of XmlObject.</li>
-         */
-        public static XmlObject newInstance(XmlOptions options) {
-            return XmlBeans.getContextTypeLoader().newInstance(null, options);
-        }
-
-        /**
-         * Creates a new immutable value.
-         */
-        /**
-         * Creates an immutable {@link XmlObject} value
-         */
-        public static XmlObject newValue(Object obj) {
-            return type.newValue(obj);
-        }
-
-        /**
-         * Parses the given {@link String} as XML.
-         */
-        public static XmlObject parse(String xmlAsString) throws XmlException {
-            return XmlBeans.getContextTypeLoader().parse(xmlAsString, null, null);
-        }
-
-        /**
-         * Parses the given {@link String} as XML.
-         * <p>
-         * Use the <em>options</em> parameter to specify the following:</p>
-         *
-         * <table>
-         * <tr><th>To specify this</th><th>Use this method</th></tr>
-         * <tr>
-         *  <td>The document type for the root element.</td>
-         *  <td>{@link XmlOptions#setDocumentType}</td>
-         * </tr>
-         * <tr>
-         *  <td>To place line number annotations in the store when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadLineNumbers}</td>
-         * </tr>
-         * <tr>
-         *  <td>To replace the document element with the specified QName when parsing.</td>
-         *  <td>{@link XmlOptions#setLoadReplaceDocumentElement}</td>
-         * </tr>
-         * <tr>
-         *  <td>To strip all insignificant whitespace when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadStripWhitespace}</td>
-         * </tr>
-         * <tr>
-         *  <td>To strip all comments when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadStripComments}</td>
-         * </tr>
-         * <tr>
-         *  <td>To strip all processing instructions when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadStripProcinsts}</td>
-         * </tr>
-         * <tr>
-         *  <td>A map of namespace URI substitutions to use when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadSubstituteNamespaces}</td>
-         * </tr>
-         * <tr>
-         *  <td>Additional namespace mappings to be added when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadAdditionalNamespaces}</td>
-         * </tr>
-         * <tr>
-         *  <td>To trim the underlying XML text buffer immediately after parsing
-         *  a document, resulting in a smaller memory footprint.</td>
-         *  <td>{@link XmlOptions#setLoadTrimTextBuffer}</td>
-         * </tr>
-         * </table>
-         *
-         * @param xmlAsString The string to parse.
-         * @param options     Options as specified.
-         * @return A new instance containing the specified XML.
-         */
-        public static XmlObject parse(String xmlAsString, XmlOptions options) throws XmlException {
-            return XmlBeans.getContextTypeLoader().parse(xmlAsString, null, options);
-        }
-
-        /**
-         * Parses the given {@link File} as XML.
-         */
-        public static XmlObject parse(File file) throws XmlException, IOException {
-            return XmlBeans.getContextTypeLoader().parse(file, null, null);
-        }
-
-        /**
-         * Parses the given {@link File} as XML.
-         */
-        public static XmlObject parse(File file, XmlOptions options) throws XmlException, IOException {
-            return XmlBeans.getContextTypeLoader().parse(file, null, options);
-        }
-
-        /**
-         * Downloads the given {@link java.net.URL} as XML.
-         */
-        public static XmlObject parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return XmlBeans.getContextTypeLoader().parse(u, null, null);
-        }
-
-        /**
-         * Downloads the given {@link java.net.URL} as XML.
-         */
-        public static XmlObject parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return XmlBeans.getContextTypeLoader().parse(u, null, options);
-        }
-
-        /**
-         * Decodes and parses the given {@link InputStream} as XML.
-         */
-        public static XmlObject parse(InputStream is) throws XmlException, IOException {
-            return XmlBeans.getContextTypeLoader().parse(is, null, null);
-        }
-
-        /**
-         * Decodes and parses the given {@link XMLStreamReader} as XML.
-         */
-        public static XmlObject parse(XMLStreamReader xsr) throws XmlException {
-            return XmlBeans.getContextTypeLoader().parse(xsr, null, null);
-        }
-
-        /**
-         * Decodes and parses the given {@link InputStream} as XML.
-         * <p>
-         * Use the <em>options</em> parameter to specify the following:</p>
-         *
-         * <table>
-         * <tr><th>To specify this</th><th>Use this method</th></tr>
-         * <tr>
-         *  <td>The character encoding to use when parsing or writing a document.</td>
-         *  <td>{@link XmlOptions#setCharacterEncoding}</td>
-         * </tr>
-         * <tr>
-         *  <td>The document type for the root element.</td>
-         *  <td>{@link XmlOptions#setDocumentType}</td>
-         * </tr>
-         * <tr>
-         *  <td>Place line number annotations in the store when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadLineNumbers}</td>
-         * </tr>
-         * <tr>
-         *  <td>Replace the document element with the specified QName when parsing.</td>
-         *  <td>{@link XmlOptions#setLoadReplaceDocumentElement}</td>
-         * </tr>
-         * <tr>
-         *  <td>Strip all insignificant whitespace when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadStripWhitespace}</td>
-         * </tr>
-         * <tr>
-         *  <td>Strip all comments when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadStripComments}</td>
-         * </tr>
-         * <tr>
-         *  <td>Strip all processing instructions when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadStripProcinsts}</td>
-         * </tr>
-         * <tr>
-         *  <td>Set a map of namespace URI substitutions to use when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadSubstituteNamespaces}</td>
-         * </tr>
-         * <tr>
-         *  <td>Set additional namespace mappings to be added when parsing a document.</td>
-         *  <td>{@link XmlOptions#setLoadAdditionalNamespaces}</td>
-         * </tr>
-         * <tr>
-         *  <td>Trim the underlying XML text buffer immediately after parsing
-         *  a document, resulting in a smaller memory footprint.</td>
-         *  <td>{@link XmlOptions#setLoadTrimTextBuffer}</td>
-         * </tr>
-         * </table>
-         */
-        public static XmlObject parse(InputStream is, XmlOptions options) throws XmlException, IOException {
-            return XmlBeans.getContextTypeLoader().parse(is, null, options);
-        }
-
-        /**
-         * Parses the given {@link XMLStreamReader} as XML.
-         */
-        public static XmlObject parse(XMLStreamReader xsr, XmlOptions options) throws XmlException {
-            return XmlBeans.getContextTypeLoader().parse(xsr, null, options);
-        }
-
-        /**
-         * Parses the given {@link Reader} as XML.
-         */
-        public static XmlObject parse(Reader r) throws XmlException, IOException {
-            return XmlBeans.getContextTypeLoader().parse(r, null, null);
-        }
-
-        /**
-         * Parses the given {@link Reader} as XML.
-         */
-        public static XmlObject parse(Reader r, XmlOptions options) throws XmlException, IOException {
-            return XmlBeans.getContextTypeLoader().parse(r, null, options);
-        }
-
-        /**
-         * Converts the given DOM {@link Node} into an XmlObject.
-         */
-        public static XmlObject parse(Node node) throws XmlException {
-            return XmlBeans.getContextTypeLoader().parse(node, null, null);
-        }
-
-        /**
-         * Converts the given DOM {@link Node} into an XmlObject.
-         */
-        public static XmlObject parse(Node node, XmlOptions options) throws XmlException {
-            return XmlBeans.getContextTypeLoader().parse(node, null, options);
-        }
-
-        /**
-         * Returns an {@link XmlSaxHandler} that can load an XmlObject from SAX events.
-         */
-        public static XmlSaxHandler newXmlSaxHandler() {
-            return XmlBeans.getContextTypeLoader().newXmlSaxHandler(null, null);
-        }
-
-        /**
-         * Returns an {@link XmlSaxHandler} that can load an XmlObject from SAX events.
-         */
-        public static XmlSaxHandler newXmlSaxHandler(XmlOptions options) {
-            return XmlBeans.getContextTypeLoader().newXmlSaxHandler(null, options);
-        }
-
-        /**
-         * Creates a new DOMImplementation object
-         */
-        public static DOMImplementation newDomImplementation() {
-            return XmlBeans.getContextTypeLoader().newDomImplementation(null);
-        }
-
-        /**
-         * Creates a new DOMImplementation object, taking options
-         */
-        public static DOMImplementation newDomImplementation(XmlOptions options) {
-            return XmlBeans.getContextTypeLoader().newDomImplementation(options);
-        }
-
-        /**
-         * Instances cannot be created.
-         */
-        private Factory() {
-        }
-    }
 }

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java Sun Feb 21 21:34:00 2021
@@ -133,6 +133,7 @@ public class XmlOptions implements java.
         COMPILE_DOWNLOAD_URLS,
         COMPILE_MDEF_NAMESPACES,
         COMPILE_PARTIAL_TYPESYSTEM,
+        COMPILE_PARTIAL_METHODS,
         VALIDATE_ON_SET,
         VALIDATE_TREAT_LAX_AS_SKIP,
         VALIDATE_STRICT,
@@ -1390,6 +1391,33 @@ public class XmlOptions implements java.
         return flag != null && flag;
     }
 
+    public enum BeanMethod {
+        GET, XGET, IS_SET, IS_NIL, IS_NIL_IDX, SET, SET_NIL, SET_NIL_IDX, XSET, UNSET,
+        GET_ARRAY, XGET_ARRAY, GET_IDX, XGET_IDX, XSET_ARRAY, XSET_IDX,
+        SIZE_OF_ARRAY, SET_ARRAY, SET_IDX,
+        INSERT_IDX, INSERT_NEW_IDX,
+        ADD, ADD_NEW, REMOVE_IDX,
+        GET_LIST, XGET_LIST, SET_LIST,
+        INSTANCE_TYPE
+    }
+
+    /**
+     * @return the list of methods to be generated in the XmlBean or {@code null} for all
+     */
+    @SuppressWarnings("unchecked")
+    public Set<BeanMethod> getCompilePartialMethod() {
+        return (Set<BeanMethod>)get(XmlOptionsKeys.COMPILE_PARTIAL_METHODS);
+    }
+
+    public void setCompilePartialMethod(Set<BeanMethod> list) {
+        if (list == null || list.isEmpty()) {
+            remove(XmlOptionsKeys.COMPILE_PARTIAL_METHODS);
+        } else {
+            set(XmlOptionsKeys.COMPILE_PARTIAL_METHODS, list);
+        }
+    }
+
+
     /**
      * If passed null, returns an empty options object.  Otherwise, returns its argument.
      */

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlPositiveInteger.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlPositiveInteger.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlPositiveInteger.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlPositiveInteger.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 /**
  * Corresponds to the XML Schema
  * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#positiveInteger">xs:positiveInteger</a> type.
@@ -25,138 +27,11 @@ package org.apache.xmlbeans;
  * Convertible to {@link java.math.BigInteger}.
  */
 public interface XmlPositiveInteger extends XmlNonNegativeInteger {
-    /**
-     * The constant {@link SchemaType} object representing this schema type.
-     */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_positiveInteger");
+    XmlObjectFactory<XmlPositiveInteger> Factory = new XmlObjectFactory<>("_BI_positiveInteger");
 
     /**
-     * A class with methods for creating instances
-     * of {@link XmlPositiveInteger}.
+     * The constant {@link SchemaType} object representing this schema type.
      */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlPositiveInteger}
-         */
-        public static XmlPositiveInteger newInstance() {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlPositiveInteger}
-         */
-        public static XmlPositiveInteger newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlPositiveInteger} value
-         */
-        public static XmlPositiveInteger newValue(Object obj) {
-            return (XmlPositiveInteger) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a String. For example: "<code>&lt;xml-fragment&gt;1234567890&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlPositiveInteger parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a String. For example: "<code>&lt;xml-fragment&gt;1234567890&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlPositiveInteger parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a File.
-         */
-        public static XmlPositiveInteger parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a File.
-         */
-        public static XmlPositiveInteger parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a URL.
-         */
-        public static XmlPositiveInteger parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a URL.
-         */
-        public static XmlPositiveInteger parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from an InputStream.
-         */
-        public static XmlPositiveInteger parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from an InputStream.
-         */
-        public static XmlPositiveInteger parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a Reader.
-         */
-        public static XmlPositiveInteger parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a Reader.
-         */
-        public static XmlPositiveInteger parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a DOM Node.
-         */
-        public static XmlPositiveInteger parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from a DOM Node.
-         */
-        public static XmlPositiveInteger parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from an XMLStreamReader.
-         */
-        public static XmlPositiveInteger parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlPositiveInteger} fragment from an XMLStreamReader.
-         */
-        public static XmlPositiveInteger parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlPositiveInteger) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
+    SchemaType type = Factory.getType();
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlQName.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlQName.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlQName.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlQName.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 import javax.xml.namespace.QName;
 
 
@@ -32,10 +34,12 @@ import javax.xml.namespace.QName;
  * Convertible to {@link javax.xml.namespace.QName}.
  */
 public interface XmlQName extends XmlAnySimpleType {
+    XmlObjectFactory<XmlQName> Factory = new XmlObjectFactory<>("_BI_QName");
+
     /**
      * The constant {@link SchemaType} object representing this schema type.
      */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_QName");
+    SchemaType type = Factory.getType();
 
     /**
      * Returns this value as a {@link QName}
@@ -46,134 +50,5 @@ public interface XmlQName extends XmlAny
      * Sets this value as a {@link QName}
      */
     void setQNameValue(QName name);
-
-    /**
-     * A class with methods for creating instances
-     * of {@link XmlQName}.
-     */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlQName}
-         */
-        public static XmlQName newInstance() {
-            return (XmlQName) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlQName}
-         */
-        public static XmlQName newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlQName) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlQName} value
-         */
-        public static XmlQName newValue(Object obj) {
-            return (XmlQName) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a String. For example: "<code>&lt;xml-fragment xmlns:x="http://openuri.org/"&gt;x:sample&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlQName parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a String. For example: "<code>&lt;xml-fragment xmlns:x="http://openuri.org/"&gt;x:sample&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlQName parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a File.
-         */
-        public static XmlQName parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a File.
-         */
-        public static XmlQName parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a URL.
-         */
-        public static XmlQName parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a URL.
-         */
-        public static XmlQName parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from an InputStream.
-         */
-        public static XmlQName parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from an InputStream.
-         */
-        public static XmlQName parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a Reader.
-         */
-        public static XmlQName parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a Reader.
-         */
-        public static XmlQName parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a DOM Node.
-         */
-        public static XmlQName parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from a DOM Node.
-         */
-        public static XmlQName parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from an XMLStreamReader.
-         */
-        public static XmlQName parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlQName} fragment from an XMLStreamReader.
-         */
-        public static XmlQName parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlQName) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlShort.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlShort.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlShort.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlShort.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 /**
  * Corresponds to the XML Schema
  * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#short">xs:short</a> type.
@@ -23,10 +25,12 @@ package org.apache.xmlbeans;
  * Naturally, convertible to a Java short.
  */
 public interface XmlShort extends XmlInt {
+    XmlObjectFactory<XmlShort> Factory = new XmlObjectFactory<>("_BI_short");
+
     /**
      * The constant {@link SchemaType} object representing this schema type.
      */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_short");
+    SchemaType type = Factory.getType();
 
     /**
      * Returns this value as a short
@@ -37,134 +41,5 @@ public interface XmlShort extends XmlInt
      * Sets this value as a short
      */
     void setShortValue(short s);
-
-    /**
-     * A class with methods for creating instances
-     * of {@link XmlShort}.
-     */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlShort}
-         */
-        public static XmlShort newInstance() {
-            return (XmlShort) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlShort}
-         */
-        public static XmlShort newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlShort) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlShort} value
-         */
-        public static XmlShort newValue(Object obj) {
-            return (XmlShort) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a String. For example: "<code>&lt;xml-fragment&gt;12345&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlShort parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a String. For example: "<code>&lt;xml-fragment&gt;12345&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlShort parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a File.
-         */
-        public static XmlShort parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a File.
-         */
-        public static XmlShort parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a URL.
-         */
-        public static XmlShort parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a URL.
-         */
-        public static XmlShort parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from an InputStream.
-         */
-        public static XmlShort parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from an InputStream.
-         */
-        public static XmlShort parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a Reader.
-         */
-        public static XmlShort parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a Reader.
-         */
-        public static XmlShort parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a DOM Node.
-         */
-        public static XmlShort parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from a DOM Node.
-         */
-        public static XmlShort parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from an XMLStreamReader.
-         */
-        public static XmlShort parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlShort} fragment from an XMLStreamReader.
-         */
-        public static XmlShort parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlShort) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlString.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlString.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlString.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlString.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 /**
  * Corresponds to the XML Schema
  * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#string">xs:string</a> type.
@@ -32,138 +34,11 @@ package org.apache.xmlbeans;
  * Convertible to {@link String}.
  */
 public interface XmlString extends XmlAnySimpleType {
-    /**
-     * The constant {@link SchemaType} object representing this schema type.
-     */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_string");
+    XmlObjectFactory<XmlString> Factory = new XmlObjectFactory<>("_BI_string");
 
     /**
-     * A class with methods for creating instances
-     * of {@link XmlString}.
+     * The constant {@link SchemaType} object representing this schema type.
      */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlString}
-         */
-        public static XmlString newInstance() {
-            return (XmlString) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlString}
-         */
-        public static XmlString newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlString) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlString} value
-         */
-        public static XmlString newValue(Object obj) {
-            return (XmlString) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a String. For example: "<code>&lt;xml-fragment&gt; arbitrary string &lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlString parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a String. For example: "<code>&lt;xml-fragment&gt; arbitrary string &lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlString parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a File.
-         */
-        public static XmlString parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a File.
-         */
-        public static XmlString parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a URL.
-         */
-        public static XmlString parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a URL.
-         */
-        public static XmlString parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from an InputStream.
-         */
-        public static XmlString parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from an InputStream.
-         */
-        public static XmlString parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a Reader.
-         */
-        public static XmlString parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a Reader.
-         */
-        public static XmlString parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a DOM Node.
-         */
-        public static XmlString parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from a DOM Node.
-         */
-        public static XmlString parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from an XMLStreamReader.
-         */
-        public static XmlString parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlString} fragment from an XMLStreamReader.
-         */
-        public static XmlString parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlString) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
+    SchemaType type = Factory.getType();
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlTime.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlTime.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlTime.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlTime.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 import java.util.Calendar;
 
 
@@ -29,10 +31,12 @@ import java.util.Calendar;
  * @see GDate
  */
 public interface XmlTime extends XmlAnySimpleType {
+    XmlObjectFactory<XmlTime> Factory = new XmlObjectFactory<>("_BI_time");
+
     /**
      * The constant {@link SchemaType} object representing this schema type.
      */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_time");
+    SchemaType type = Factory.getType();
 
     /**
      * Returns this value as a {@link Calendar}
@@ -53,134 +57,5 @@ public interface XmlTime extends XmlAnyS
      * Sets this value as a {@link GDateSpecification}
      */
     void setGDateValue(GDate gd);
-
-    /**
-     * A class with methods for creating instances
-     * of {@link XmlTime}.
-     */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlTime}
-         */
-        public static XmlTime newInstance() {
-            return (XmlTime) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlTime}
-         */
-        public static XmlTime newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlTime) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlTime} value
-         */
-        public static XmlTime newValue(Object obj) {
-            return (XmlTime) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a String. For example: "<code>&lt;xml-fragment&gt;12:00:00&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlTime parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a String. For example: "<code>&lt;xml-fragment&gt;12:00:00&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlTime parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a File.
-         */
-        public static XmlTime parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a File.
-         */
-        public static XmlTime parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a URL.
-         */
-        public static XmlTime parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a URL.
-         */
-        public static XmlTime parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from an InputStream.
-         */
-        public static XmlTime parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from an InputStream.
-         */
-        public static XmlTime parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a Reader.
-         */
-        public static XmlTime parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a Reader.
-         */
-        public static XmlTime parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a DOM Node.
-         */
-        public static XmlTime parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from a DOM Node.
-         */
-        public static XmlTime parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from an XMLStreamReader.
-         */
-        public static XmlTime parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlTime} fragment from an XMLStreamReader.
-         */
-        public static XmlTime parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlTime) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlToken.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlToken.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlToken.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlToken.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 /**
  * Corresponds to the XML Schema
  * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#token">xs:token</a> type.
@@ -36,138 +38,11 @@ package org.apache.xmlbeans;
  * Convertible to {@link String}.
  */
 public interface XmlToken extends XmlNormalizedString {
-    /**
-     * The constant {@link SchemaType} object representing this schema type.
-     */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_token");
+    XmlObjectFactory<XmlToken> Factory = new XmlObjectFactory<>("_BI_token");
 
     /**
-     * A class with methods for creating instances
-     * of {@link XmlToken}.
+     * The constant {@link SchemaType} object representing this schema type.
      */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlToken}
-         */
-        public static XmlToken newInstance() {
-            return (XmlToken) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlToken}
-         */
-        public static XmlToken newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlToken) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlToken} value
-         */
-        public static XmlToken newValue(Object obj) {
-            return (XmlToken) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a String. For example: "<code>&lt;xml-fragment&gt;string to collapse&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlToken parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a String. For example: "<code>&lt;xml-fragment&gt;string to collapse&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlToken parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a File.
-         */
-        public static XmlToken parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a File.
-         */
-        public static XmlToken parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a URL.
-         */
-        public static XmlToken parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a URL.
-         */
-        public static XmlToken parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from an InputStream.
-         */
-        public static XmlToken parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from an InputStream.
-         */
-        public static XmlToken parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a Reader.
-         */
-        public static XmlToken parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a Reader.
-         */
-        public static XmlToken parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a DOM Node.
-         */
-        public static XmlToken parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from a DOM Node.
-         */
-        public static XmlToken parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from an XMLStreamReader.
-         */
-        public static XmlToken parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlToken} fragment from an XMLStreamReader.
-         */
-        public static XmlToken parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlToken) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
+    SchemaType type = Factory.getType();
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedByte.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedByte.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedByte.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedByte.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 /**
  * Corresponds to the XML Schema
  * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#unsignedByte">xs:unsignedByte</a> type.
@@ -25,10 +27,12 @@ package org.apache.xmlbeans;
  * As suggested by JAXB, convertible to Java short.
  */
 public interface XmlUnsignedByte extends XmlUnsignedShort {
+    XmlObjectFactory<XmlUnsignedByte> Factory = new XmlObjectFactory<>("_BI_unsignedByte");
+
     /**
      * The constant {@link SchemaType} object representing this schema type.
      */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_unsignedByte");
+    SchemaType type = Factory.getType();
 
     /**
      * Returns this value as a short
@@ -39,135 +43,5 @@ public interface XmlUnsignedByte extends
      * Sets this value as a short
      */
     void setShortValue(short s);
-
-
-    /**
-     * A class with methods for creating instances
-     * of {@link XmlUnsignedByte}.
-     */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlUnsignedByte}
-         */
-        public static XmlUnsignedByte newInstance() {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlUnsignedByte}
-         */
-        public static XmlUnsignedByte newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlUnsignedByte} value
-         */
-        public static XmlUnsignedByte newValue(Object obj) {
-            return (XmlUnsignedByte) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a String. For example: "<code>&lt;xml-fragment&gt;123&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlUnsignedByte parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a String. For example: "<code>&lt;xml-fragment&gt;123&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlUnsignedByte parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a File.
-         */
-        public static XmlUnsignedByte parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a File.
-         */
-        public static XmlUnsignedByte parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a URL.
-         */
-        public static XmlUnsignedByte parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a URL.
-         */
-        public static XmlUnsignedByte parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from an InputStream.
-         */
-        public static XmlUnsignedByte parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from an InputStream.
-         */
-        public static XmlUnsignedByte parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a Reader.
-         */
-        public static XmlUnsignedByte parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a Reader.
-         */
-        public static XmlUnsignedByte parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a DOM Node.
-         */
-        public static XmlUnsignedByte parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from a DOM Node.
-         */
-        public static XmlUnsignedByte parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from an XMLStreamReader.
-         */
-        public static XmlUnsignedByte parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedByte} fragment from an XMLStreamReader.
-         */
-        public static XmlUnsignedByte parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedByte) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedInt.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedInt.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedInt.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedInt.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 /**
  * Corresponds to the XML Schema
  * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#unsignedInt">xs:unsignedInt</a> type.
@@ -25,10 +27,12 @@ package org.apache.xmlbeans;
  * Convertible to Java long.
  */
 public interface XmlUnsignedInt extends XmlUnsignedLong {
+    XmlObjectFactory<XmlUnsignedInt> Factory = new XmlObjectFactory<>("_BI_unsignedInt");
+
     /**
      * The constant {@link SchemaType} object representing this schema type.
      */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_unsignedInt");
+    SchemaType type = Factory.getType();
 
     /**
      * Returns this value as a long
@@ -39,134 +43,5 @@ public interface XmlUnsignedInt extends
      * Sets this value as a long
      */
     void setLongValue(long v);
-
-    /**
-     * A class with methods for creating instances
-     * of {@link XmlUnsignedInt}.
-     */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlUnsignedInt}
-         */
-        public static XmlUnsignedInt newInstance() {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlUnsignedInt}
-         */
-        public static XmlUnsignedInt newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlUnsignedInt} value
-         */
-        public static XmlUnsignedInt newValue(Object obj) {
-            return (XmlUnsignedInt) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a String. For example: "<code>&lt;xml-fragment&gt;1234567&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlUnsignedInt parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a String. For example: "<code>&lt;xml-fragment&gt;1234567&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlUnsignedInt parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a File.
-         */
-        public static XmlUnsignedInt parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a File.
-         */
-        public static XmlUnsignedInt parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a URL.
-         */
-        public static XmlUnsignedInt parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a URL.
-         */
-        public static XmlUnsignedInt parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from an InputStream.
-         */
-        public static XmlUnsignedInt parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from an InputStream.
-         */
-        public static XmlUnsignedInt parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a Reader.
-         */
-        public static XmlUnsignedInt parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a Reader.
-         */
-        public static XmlUnsignedInt parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a DOM Node.
-         */
-        public static XmlUnsignedInt parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from a DOM Node.
-         */
-        public static XmlUnsignedInt parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from an XMLStreamReader.
-         */
-        public static XmlUnsignedInt parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedInt} fragment from an XMLStreamReader.
-         */
-        public static XmlUnsignedInt parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
 }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedLong.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedLong.java?rev=1886771&r1=1886770&r2=1886771&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedLong.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlUnsignedLong.java Sun Feb 21 21:34:00 2021
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.schema.XmlObjectFactory;
+
 import java.math.BigInteger;
 
 
@@ -28,138 +30,11 @@ import java.math.BigInteger;
  * Convertible to {@link BigInteger}.
  */
 public interface XmlUnsignedLong extends XmlNonNegativeInteger {
-    /**
-     * The constant {@link SchemaType} object representing this schema type.
-     */
-    SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_unsignedLong");
+    XmlObjectFactory<XmlUnsignedLong> Factory = new XmlObjectFactory<>("_BI_unsignedLong");
 
     /**
-     * A class with methods for creating instances
-     * of {@link XmlUnsignedLong}.
+     * The constant {@link SchemaType} object representing this schema type.
      */
-    final class Factory {
-        /**
-         * Creates an empty instance of {@link XmlUnsignedLong}
-         */
-        public static XmlUnsignedLong newInstance() {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().newInstance(type, null);
-        }
-
-        /**
-         * Creates an empty instance of {@link XmlUnsignedLong}
-         */
-        public static XmlUnsignedLong newInstance(org.apache.xmlbeans.XmlOptions options) {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().newInstance(type, options);
-        }
-
-        /**
-         * Creates an immutable {@link XmlUnsignedLong} value
-         */
-        public static XmlUnsignedLong newValue(Object obj) {
-            return (XmlUnsignedLong) type.newValue(obj);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a String. For example: "<code>&lt;xml-fragment&gt;123456789&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlUnsignedLong parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(s, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a String. For example: "<code>&lt;xml-fragment&gt;123456789&lt;/xml-fragment&gt;</code>".
-         */
-        public static XmlUnsignedLong parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(s, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a File.
-         */
-        public static XmlUnsignedLong parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(f, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a File.
-         */
-        public static XmlUnsignedLong parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(f, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a URL.
-         */
-        public static XmlUnsignedLong parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(u, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a URL.
-         */
-        public static XmlUnsignedLong parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(u, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from an InputStream.
-         */
-        public static XmlUnsignedLong parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(is, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from an InputStream.
-         */
-        public static XmlUnsignedLong parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(is, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a Reader.
-         */
-        public static XmlUnsignedLong parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(r, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a Reader.
-         */
-        public static XmlUnsignedLong parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(r, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a DOM Node.
-         */
-        public static XmlUnsignedLong parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(node, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from a DOM Node.
-         */
-        public static XmlUnsignedLong parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(node, type, options);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from an XMLStreamReader.
-         */
-        public static XmlUnsignedLong parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(xsr, type, null);
-        }
-
-        /**
-         * Parses a {@link XmlUnsignedLong} fragment from an XMLStreamReader.
-         */
-        public static XmlUnsignedLong parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
-            return (XmlUnsignedLong) XmlBeans.getContextTypeLoader().parse(xsr, type, options);
-        }
-
-        private Factory() {
-            // No instance of this class allowed
-        }
-    }
+    SchemaType type = Factory.getType();
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org