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