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

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