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   import java.util.Date;
   22   import java.util.Calendar;
   23   
   24   
   25   /**
   26    * Corresponds to the XML Schema
   27    * <a target="_blank" href="http://www.w3.org/TR/xmlschema-2/#gYearMonth">xs:gYearMonth</a> type.
   28    * A gYearMonth specifies a month in a specific year.
   29    * <p>
   30    * Convertible to {@link Calendar}, {@link GDate}.
   31    * 
   32    * @see XmlCalendar
   33    * @see GDate
   34    */ 
   35   public interface XmlGYearMonth extends XmlAnySimpleType
   36   {
   37       /** The constant {@link SchemaType} object representing this schema type. */
   38       public static final SchemaType type = XmlBeans.getBuiltinTypeSystem().typeForHandle("_BI_gYearMonth");
   39       
   40       /** Returns this value as a {@link Calendar} */
   41       Calendar getCalendarValue();
   42       /** Sets this value as a {@link Calendar} */
   43       void setCalendarValue(Calendar c);
   44       /** Returns this value as a {@link GDate} */
   45       GDate getGDateValue();
   46       /** Sets this value as a {@link GDateSpecification} */
   47       void setGDateValue(GDate gd);
   48   
   49       /**
   50        * Returns this value as a {@link Calendar}
   51        * @deprecated replaced with {@link #getCalendarValue}
   52        **/
   53       Calendar calendarValue();
   54       /**
   55        * Sets this value as a {@link Calendar}
   56        * @deprecated replaced with {@link #setCalendarValue}
   57        **/
   58       void set(Calendar c);
   59       /**
   60        * Returns this value as a {@link GDate}
   61        * @deprecated replaced with {@link #getGDateValue}
   62        **/
   63       GDate gDateValue();
   64       /**
   65        * Sets this value as a {@link GDateSpecification}
   66        * @deprecated replaced with {@link #setGDateValue}
   67        **/
   68       void set(GDateSpecification gd);
   69   
   70       /**
   71        * A class with methods for creating instances
   72        * of {@link XmlGYearMonth}.
   73        */
   74       public static final class Factory
   75       {
   76           /** Creates an empty instance of {@link XmlGYearMonth} */
   77           public static XmlGYearMonth newInstance() {
   78             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().newInstance( type, null ); }
   79           
   80           /** Creates an empty instance of {@link XmlGYearMonth} */
   81           public static XmlGYearMonth newInstance(org.apache.xmlbeans.XmlOptions options) {
   82             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().newInstance( type, options ); }
   83           
   84           /** Creates an immutable {@link XmlGYearMonth} value */
   85           public static XmlGYearMonth newValue(Object obj) {
   86             return (XmlGYearMonth) type.newValue( obj ); }
   87           
   88           /** Parses a {@link XmlGYearMonth} fragment from a String. For example: "<code>&lt;xml-fragment&gt;2003-06&lt;/xml-fragment&gt;</code>". */
   89           public static XmlGYearMonth parse(java.lang.String s) throws org.apache.xmlbeans.XmlException {
   90             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( s, type, null ); }
   91           
   92           /** Parses a {@link XmlGYearMonth} fragment from a String. For example: "<code>&lt;xml-fragment&gt;2003-06&lt;/xml-fragment&gt;</code>". */
   93           public static XmlGYearMonth parse(java.lang.String s, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
   94             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( s, type, options ); }
   95           
   96           /** Parses a {@link XmlGYearMonth} fragment from a File. */
   97           public static XmlGYearMonth parse(java.io.File f) throws org.apache.xmlbeans.XmlException, java.io.IOException {
   98             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( f, type, null ); }
   99           
  100           /** Parses a {@link XmlGYearMonth} fragment from a File. */
  101           public static XmlGYearMonth parse(java.io.File f, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  102             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( f, type, options ); }
  103           
  104           /** Parses a {@link XmlGYearMonth} fragment from a URL. */
  105           public static XmlGYearMonth parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  106             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( u, type, null ); }
  107   
  108           /** Parses a {@link XmlGYearMonth} fragment from a URL. */
  109           public static XmlGYearMonth parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  110             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( u, type, options ); }
  111   
  112           /** Parses a {@link XmlGYearMonth} fragment from an InputStream. */
  113           public static XmlGYearMonth parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  114             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( is, type, null ); }
  115           
  116           /** Parses a {@link XmlGYearMonth} fragment from an InputStream. */
  117           public static XmlGYearMonth parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  118             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( is, type, options ); }
  119           
  120           /** Parses a {@link XmlGYearMonth} fragment from a Reader. */
  121           public static XmlGYearMonth parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  122             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( r, type, null ); }
  123           
  124           /** Parses a {@link XmlGYearMonth} fragment from a Reader. */
  125           public static XmlGYearMonth parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
  126             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( r, type, options ); }
  127           
  128           /** Parses a {@link XmlGYearMonth} fragment from a DOM Node. */
  129           public static XmlGYearMonth parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
  130             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( node, type, null ); }
  131           
  132           /** Parses a {@link XmlGYearMonth} fragment from a DOM Node. */
  133           public static XmlGYearMonth parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
  134             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( node, type, options ); }
  135           
  136           /** Parses a {@link XmlGYearMonth} fragment from an XMLInputStream.
  137            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  138            */
  139           public static XmlGYearMonth parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
  140             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
  141           
  142           /** Parses a {@link XmlGYearMonth} fragment from an XMLInputStream.
  143            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  144            */
  145           public static XmlGYearMonth parse(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 (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
  147           
  148           /** Parses a {@link XmlGYearMonth} fragment from an XMLStreamReader. */
  149           public static XmlGYearMonth parse(javax.xml.stream.XMLStreamReader xsr) throws org.apache.xmlbeans.XmlException {
  150             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( xsr, type, null ); }
  151           
  152           /** Parses a {@link XmlGYearMonth} fragment from an XMLStreamReader. */
  153           public static XmlGYearMonth parse(javax.xml.stream.XMLStreamReader xsr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException{
  154             return (XmlGYearMonth) XmlBeans.getContextTypeLoader().parse( xsr, type, options ); }
  155           
  156           /** Returns a validating XMLInputStream.
  157            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  158            */
  159           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 {
  160             return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
  161           
  162           /** Returns a validating XMLInputStream.
  163            * @deprecated XMLInputStream was deprecated by XMLStreamReader from STaX - jsr173 API.
  164            */
  165           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 {
  166             return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
  167           
  168           private Factory() { } // No instance of this class allowed
  169       }
  170   }
  171   

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