Home » xmlbeans-2.5.0-src » org.apache » xmlbeans » [javadoc | source]

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

Home » xmlbeans-2.5.0-src » org.apache » xmlbeans » [javadoc | source]