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/#nonPositiveInteger">xs:nonPositiveInteger</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 zero or negative when validating.
27 * <p>
28 * Convertible to {@link java.math.BigInteger}.
29 */
30 public interface XmlNonPositiveInteger extends XmlInteger
31 {
32 /** The constant {@link SchemaType} object representing this schema type. */
33 public static final SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_nonPositiveInteger");
34
35 /**
36 * A class with methods for creating instances
37 * of {@link XmlNonPositiveInteger}.
38 */
39 public static final class Factory
40 {
41 /** Creates an empty instance of {@link XmlNonPositiveInteger} */
42 public static XmlNonPositiveInteger newInstance() {
43 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().newInstance( type, null ); }
44
45 /** Creates an empty instance of {@link XmlNonPositiveInteger} */
46 public static XmlNonPositiveInteger newInstance(org.apache.xmlbeans.XmlOptions options) {
47 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().newInstance( type, options ); }
48
49 /** Creates an immutable {@link XmlNonPositiveInteger} value */
50 public static XmlNonPositiveInteger newValue(Object obj) {
51 return (XmlNonPositiveInteger) type.newValue( obj ); }
52
53 /** Parses a {@link XmlNonPositiveInteger} fragment from a String. For example: "<code><xml-fragment>-1234567890</xml-fragment></code>". */
54 public static XmlNonPositiveInteger parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
55 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( s, type, null ); }
56
57 /** Parses a {@link XmlNonPositiveInteger} fragment from a String. For example: "<code><xml-fragment>-1234567890</xml-fragment></code>". */
58 public static XmlNonPositiveInteger parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
59 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( s, type, options ); }
60
61 /** Parses a {@link XmlNonPositiveInteger} fragment from a File. */
62 public static XmlNonPositiveInteger parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
63 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( f, type, null ); }
64
65 /** Parses a {@link XmlNonPositiveInteger} fragment from a File. */
66 public static XmlNonPositiveInteger parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
67 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( f, type, options ); }
68
69 /** Parses a {@link XmlNonPositiveInteger} fragment from a URL. */
70 public static XmlNonPositiveInteger parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
71 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( u, type, null ); }
72
73 /** Parses a {@link XmlNonPositiveInteger} fragment from a URL. */
74 public static XmlNonPositiveInteger parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
75 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( u, type, options ); }
76
77 /** Parses a {@link XmlNonPositiveInteger} fragment from an InputStream. */
78 public static XmlNonPositiveInteger parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
79 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( is, type, null ); }
80
81 /** Parses a {@link XmlNonPositiveInteger} fragment from an InputStream. */
82 public static XmlNonPositiveInteger parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
83 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( is, type, options ); }
84
85 /** Parses a {@link XmlNonPositiveInteger} fragment from a Reader. */
86 public static XmlNonPositiveInteger parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
87 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( r, type, null ); }
88
89 /** Parses a {@link XmlNonPositiveInteger} fragment from a Reader. */
90 public static XmlNonPositiveInteger parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
91 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( r, type, options ); }
92
93 /** Parses a {@link XmlNonPositiveInteger} fragment from a DOM Node. */
94 public static XmlNonPositiveInteger parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
95 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( node, type, null ); }
96
97 /** Parses a {@link XmlNonPositiveInteger} fragment from a DOM Node. */
98 public static XmlNonPositiveInteger parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
99 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( node, type, options ); }
100
101 /** Parses a {@link XmlNonPositiveInteger} fragment from an XMLInputStream.
102 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
103 */
104 public static XmlNonPositiveInteger parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
105 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
106
107 /** Parses a {@link XmlNonPositiveInteger} fragment from an XMLInputStream.
108 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
109 */
110 public static XmlNonPositiveInteger parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
111 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
112
113 /** Parses a {@link XmlNonPositiveInteger} fragment from an XMLStreamReader. */
114 public static XmlNonPositiveInteger parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
115 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( xsr, type, null ); }
116
117 /** Parses a {@link XmlNonPositiveInteger} fragment from an XMLStreamReader. */
118 public static XmlNonPositiveInteger parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
119 return (XmlNonPositiveInteger) XmlBeans.getContextTypeLoader().parse( xsr, type, options ); }
120
121 /** Returns a validating XMLInputStream.
122 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
123 */
124 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 {
125 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
126
127 /** Returns a validating XMLInputStream.
128 * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
129 */
130 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 {
131 return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
132
133 private Factory() { } // No instance of this class allowed
134 }
135 }
136