1 /* Copyright 2004 The Apache Software Foundation 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 package org.apache.xmlbeans; 17 18 import javax.xml.stream.XMLStreamReader; 19 20 21 /** 22 * Corresponds to the XML Schema 23 * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#unsignedInt">xs:unsignedInt</a> type. 24 * One of the derived types based on <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#decimal">xs:decimal</a>. 25 * <p> 26 * Verified to be in the range 0..4294967295 when validating. 27 * <p> 28 * Convertible to Java long. 29 */ 30 public interface XmlUnsignedInt extends XmlUnsignedLong 31 { 32 /** The constant {@link SchemaType} object representing this schema type. */ 33 public static final SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_unsignedInt"); 34 35 /** Returns this value as a long */ 36 long getLongValue(); 37 /** Sets this value as a long */ 38 void setLongValue(long v); 39 40 /** 41 * Returns this value as a long 42 * @deprecated replaced with {@link #getLongValue} 43 **/ 44 long longValue(); 45 /** 46 * Sets this value as a long 47 * @deprecated replaced with {@link #setLongValue} 48 **/ 49 void set(long v); 50 51 /** 52 * A class with methods for creating instances 53 * of {@link XmlUnsignedInt}. 54 */ 55 public static final class Factory 56 { 57 /** Creates an empty instance of {@link XmlUnsignedInt} */ 58 public static XmlUnsignedInt newInstance() { 59 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().newInstance( type, null ); } 60 61 /** Creates an empty instance of {@link XmlUnsignedInt} */ 62 public static XmlUnsignedInt newInstance(org.apache.xmlbeans.XmlOptions options) { 63 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().newInstance( type, options ); } 64 65 /** Creates an immutable {@link XmlUnsignedInt} value */ 66 public static XmlUnsignedInt newValue(Object obj) { 67 return (XmlUnsignedInt) type.newValue( obj ); } 68 69 /** Parses a {@link XmlUnsignedInt} fragment from a String. For example: "<code><xml-fragment>1234567</xml-fragment></code>". */ 70 public static XmlUnsignedInt parse(java.lang.String s) throws org.apache.xmlbeans.XmlException { 71 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( s, type, null ); } 72 73 /** Parses a {@link XmlUnsignedInt} fragment from a String. For example: "<code><xml-fragment>1234567</xml-fragment></code>". */ 74 public static XmlUnsignedInt parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { 75 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( s, type, options ); } 76 77 /** Parses a {@link XmlUnsignedInt} fragment from a File. */ 78 public static XmlUnsignedInt parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException { 79 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( f, type, null ); } 80 81 /** Parses a {@link XmlUnsignedInt} fragment from a File. */ 82 public static XmlUnsignedInt parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { 83 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( f, type, options ); } 84 85 /** Parses a {@link XmlUnsignedInt} fragment from a URL. */ 86 public static XmlUnsignedInt parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException { 87 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( u, type, null ); } 88 89 /** Parses a {@link XmlUnsignedInt} fragment from a URL. */ 90 public static XmlUnsignedInt parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { 91 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( u, type, options ); } 92 93 /** Parses a {@link XmlUnsignedInt} fragment from an InputStream. */ 94 public static XmlUnsignedInt parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException { 95 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( is, type, null ); } 96 97 /** Parses a {@link XmlUnsignedInt} fragment from an InputStream. */ 98 public static XmlUnsignedInt parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { 99 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( is, type, options ); } 100 101 /** Parses a {@link XmlUnsignedInt} fragment from a Reader. */ 102 public static XmlUnsignedInt parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException { 103 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( r, type, null ); } 104 105 /** Parses a {@link XmlUnsignedInt} fragment from a Reader. */ 106 public static XmlUnsignedInt parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { 107 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( r, type, options ); } 108 109 /** Parses a {@link XmlUnsignedInt} fragment from a DOM Node. */ 110 public static XmlUnsignedInt parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException { 111 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( node, type, null ); } 112 113 /** Parses a {@link XmlUnsignedInt} fragment from a DOM Node. */ 114 public static XmlUnsignedInt parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { 115 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( node, type, options ); } 116 117 /** Parses a {@link XmlUnsignedInt} fragment from an XMLInputStream. 118 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API. 119 */ 120 public static XmlUnsignedInt parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { 121 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( xis, type, null ); } 122 123 /** Parses a {@link XmlUnsignedInt} fragment from an XMLInputStream. 124 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API. 125 */ 126 public static XmlUnsignedInt parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { 127 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( xis, type, options ); } 128 129 /** Parses a {@link XmlUnsignedInt} fragment from an XMLStreamReader. */ 130 public static XmlUnsignedInt parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException { 131 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( xsr, type, null ); } 132 133 /** Parses a {@link XmlUnsignedInt} fragment from an XMLStreamReader. */ 134 public static XmlUnsignedInt parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException{ 135 return (XmlUnsignedInt) XmlBeans.getContextTypeLoader().parse( xsr, type, options ); } 136 137 /** Returns a validating XMLInputStream. 138 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API. 139 */ 140 public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { 141 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); } 142 143 /** Returns a validating XMLInputStream. 144 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API. 145 */ 146 public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { 147 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); } 148 149 private Factory() { } // No instance of this class allowed 150 } 151 } 152