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/#Name">xs:Name</a> type.
   24    * One of the derived types based on <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#string">xs:string</a>.
   25    * <p>
   26    * This kind of string is the same as the non-colonized strings that are used
   27    * for XML localnames and prefixes, "my-href.2".  It is just a physical
   28    * string, however, and it should NOT be confused with {@link XmlQName},
   29    * which is a logical combination of localname and namespace URI.
   30    * <p>
   31    * Convertible to {@link String}.
   32    */ 
   33   public interface XmlNCName extends XmlName
   34   {
   35       /** The constant {@link SchemaType} object representing this schema type. */
   36       public static final SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_NCName");
   37       
   38       /**
   39        * A class with methods for creating instances
   40        * of {@link XmlNCName}.
   41        */
   42       public static final class Factory
   43       {
   44           /** Creates an empty instance of {@link XmlNCName} */
   45           public static XmlNCName newInstance() {
   46             return (XmlNCName) XmlBeans.getContextTypeLoader().newInstance( type, null ); }
   47           
   48           /** Creates an empty instance of {@link XmlNCName} */
   49           public static XmlNCName newInstance(org.apache.xmlbeans.XmlOptions options) {
   50             return (XmlNCName) XmlBeans.getContextTypeLoader().newInstance( type, options ); }
   51           
   52           /** Creates an immutable {@link XmlNCName} value */
   53           public static XmlNCName newValue(Object obj) {
   54             return (XmlNCName) type.newValue( obj ); }
   55           
   56           /** Parses a {@link XmlNCName} fragment from a String. For example: "<code>&lt;xml-fragment&gt;My-Name&lt;/xml-fragment&gt;</code>". */
   57           public static XmlNCName parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
   58             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( s, type, null ); }
   59           
   60           /** Parses a {@link XmlNCName} fragment from a String. For example: "<code>&lt;xml-fragment&gt;My-Name&lt;/xml-fragment&gt;</code>". */
   61           public static XmlNCName parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
   62             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( s, type, options ); }
   63           
   64           /** Parses a {@link XmlNCName} fragment from a File. */
   65           public static XmlNCName parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   66             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( f, type, null ); }
   67           
   68           /** Parses a {@link XmlNCName} fragment from a File. */
   69           public static XmlNCName parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   70             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( f, type, options ); }
   71           
   72           /** Parses a {@link XmlNCName} fragment from a URL. */
   73           public static XmlNCName parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   74             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( u, type, null ); }
   75   
   76           /** Parses a {@link XmlNCName} fragment from a URL. */
   77           public static XmlNCName parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   78             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( u, type, options ); }
   79   
   80           /** Parses a {@link XmlNCName} fragment from an InputStream. */
   81           public static XmlNCName parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   82             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( is, type, null ); }
   83           
   84           /** Parses a {@link XmlNCName} fragment from an InputStream. */
   85           public static XmlNCName parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   86             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( is, type, options ); }
   87           
   88           /** Parses a {@link XmlNCName} fragment from a Reader. */
   89           public static XmlNCName parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   90             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( r, type, null ); }
   91           
   92           /** Parses a {@link XmlNCName} fragment from a Reader. */
   93           public static XmlNCName parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   94             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( r, type, options ); }
   95           
   96           /** Parses a {@link XmlNCName} fragment from a DOM Node. */
   97           public static XmlNCName parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
   98             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( node, type, null ); }
   99           
  100           /** Parses a {@link XmlNCName} fragment from a DOM Node. */
  101           public static XmlNCName parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
  102             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( node, type, options ); }
  103           
  104           /** Parses a {@link XmlNCName} fragment from an XMLInputStream.
  105            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  106            */
  107           public static XmlNCName parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
  108             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
  109           
  110           /** Parses a {@link XmlNCName} fragment from an XMLInputStream.
  111            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  112            */
  113           public static XmlNCName parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
  114             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
  115           
  116           /** Parses a {@link XmlNCName} fragment from an XMLStreamReader. */
  117           public static XmlNCName parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
  118             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( xsr, type, null ); }
  119           
  120           /** Parses a {@link XmlNCName} fragment from an XMLStreamReader. */
  121           public static XmlNCName parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException{
  122             return (XmlNCName) XmlBeans.getContextTypeLoader().parse( xsr, type, options ); }
  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) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
  128             return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
  129           
  130           /** Returns a validating XMLInputStream.
  131            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  132            */
  133           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 {
  134             return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
  135           
  136           private Factory() { } // No instance of this class allowed
  137       }
  138   }
  139   

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