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