xbean-fixed-2.4.0

16:54:49.385 INFO  jd.cli.Main - Decompiling xbean-fixed-2.4.0.jar
package org.apache.xmlbeans;

import javax.xml.namespace.QName;

public class BindingConfig
{
  private static final InterfaceExtension[] EMPTY_INTERFACE_EXT_ARRAY = new InterfaceExtension[0];
  private static final PrePostExtension[] EMPTY_PREPOST_EXT_ARRAY = new PrePostExtension[0];
  public static final int QNAME_TYPE = 1;
  public static final int QNAME_DOCUMENT_TYPE = 2;
  public static final int QNAME_ACCESSOR_ELEMENT = 3;
  public static final int QNAME_ACCESSOR_ATTRIBUTE = 4;
  
  public String lookupPackageForNamespace(String uri)
  {
    return null;
  }
  
  public String lookupPrefixForNamespace(String uri)
  {
    return null;
  }
  
  public String lookupSuffixForNamespace(String uri)
  {
    return null;
  }
  
  /**
   * @deprecated
   */
  public String lookupJavanameForQName(QName qname)
  {
    return null;
  }
  
  public String lookupJavanameForQName(QName qname, int kind)
  {
    return null;
  }
  
  public InterfaceExtension[] getInterfaceExtensions()
  {
    return EMPTY_INTERFACE_EXT_ARRAY;
  }
  
  public InterfaceExtension[] getInterfaceExtensions(String fullJavaName)
  {
    return EMPTY_INTERFACE_EXT_ARRAY;
  }
  
  public PrePostExtension[] getPrePostExtensions()
  {
    return EMPTY_PREPOST_EXT_ARRAY;
  }
  
  public PrePostExtension getPrePostExtension(String fullJavaName)
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.apache.xmlbeans.BindingConfig
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.xmlbeans;

public class CDataBookmark
  extends XmlCursor.XmlBookmark
{
  public static CDataBookmark CDATA_BOOKMARK = new CDataBookmark();
}

/* Location:
 * Qualified Name:     org.apache.xmlbeans.CDataBookmark
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.xmlbeans;

public abstract interface DelegateXmlObject
{
  public abstract XmlObject underlyingXmlObject();
}

/* Location:
 * Qualified Name:     org.apache.xmlbeans.DelegateXmlObject
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.xmlbeans;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;

public abstract interface Filer
{
  public abstract OutputStream createBinaryFile(String paramString)
    throws IOException;
  
  public abstract Writer createSourceFile(String paramString)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.apache.xmlbeans.Filer
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.xmlbeans;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader;
import org.apache.xmlbeans.xml.stream.XMLInputStream;
import org.w3c.dom.Node;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import org.xml.sax.ext.LexicalHandler;

public abstract class FilterXmlObject
  implements XmlObject, SimpleValue, DelegateXmlObject
{
  public SchemaType schemaType()
  {
    return underlyingXmlObject().schemaType();
  }
  
  public boolean validate()
  {
    return underlyingXmlObject().validate();
  }
  
  public boolean validate(XmlOptions options)
  {
    return underlyingXmlObject().validate(options);
  }
  
  public XmlObject[] selectPath(String path)
  {
    return underlyingXmlObject().selectPath(path);
  }
  
  public XmlObject[] selectPath(String path, XmlOptions options)
  {
    return underlyingXmlObject().selectPath(path, options);
  }
  
  public XmlObject[] execQuery(String query)
  {
    return underlyingXmlObject().execQuery(query);
  }
  
  public XmlObject[] execQuery(String query, XmlOptions options)
  {
    return underlyingXmlObject().execQuery(query, options);
  }
  
  public XmlObject changeType(SchemaType newType)
  {
    return underlyingXmlObject().changeType(newType);
  }
  
  public boolean isNil()
  {
    return underlyingXmlObject().isNil();
  }
  
  public void setNil()
  {
    underlyingXmlObject().setNil();
  }
  
  public boolean isImmutable()
  {
    return underlyingXmlObject().isImmutable();
  }
  
  public XmlObject set(XmlObject srcObj)
  {
    return underlyingXmlObject().set(srcObj);
  }
  
  public XmlObject copy()
  {
    return underlyingXmlObject().copy();
  }
  
  public boolean valueEquals(XmlObject obj)
  {
    return underlyingXmlObject().valueEquals(obj);
  }
  
  public int valueHashCode()
  {
    return underlyingXmlObject().valueHashCode();
  }
  
  public int compareTo(Object obj)
  {
    return underlyingXmlObject().compareTo(obj);
  }
  
  public int compareValue(XmlObject obj)
  {
    return underlyingXmlObject().compareValue(obj);
  }
  
  public Object monitor()
  {
    return underlyingXmlObject().monitor();
  }
  
  public XmlDocumentProperties documentProperties()
  {
    return underlyingXmlObject().documentProperties();
  }
  
  public XmlCursor newCursor()
  {
    return underlyingXmlObject().newCursor();
  }
  
  /**
   * @deprecated
   */
  public XMLInputStream newXMLInputStream()
  {
    return underlyingXmlObject().newXMLInputStream();
  }
  
  public XMLStreamReader newXMLStreamReader()
  {
    return underlyingXmlObject().newXMLStreamReader();
  }
  
  public String xmlText()
  {
    return underlyingXmlObject().xmlText();
  }
  
  public InputStream newInputStream()
  {
    return underlyingXmlObject().newInputStream();
  }
  
  public Reader newReader()
  {
    return underlyingXmlObject().newReader();
  }
  
  public Node newDomNode()
  {
    return underlyingXmlObject().newDomNode();
  }
  
  public Node getDomNode()
  {
    return underlyingXmlObject().getDomNode();
  }
  
  public void save(ContentHandler ch, LexicalHandler lh)
    throws SAXException
  {
    underlyingXmlObject().save(ch, lh);
  }
  
  public void save(File file)
    throws IOException
  {
    underlyingXmlObject().save(file);
  }
  
  public void save(OutputStream os)
    throws IOException
  {
    underlyingXmlObject().save(os);
  }
  
  public void save(Writer w)
    throws IOException
  {
    underlyingXmlObject().save(w);
  }
  
  /**
   * @deprecated
   */
  public XMLInputStream newXMLInputStream(XmlOptions options)
  {
    return underlyingXmlObject().newXMLInputStream(options);
  }
  
  public XMLStreamReader newXMLStreamReader(XmlOptions options)
  {
    return underlyingXmlObject().newXMLStreamReader(options);
  }
  
  public String xmlText(XmlOptions options)
  {
    return underlyingXmlObject().xmlText(options);
  }
  
  public InputStream newInputStream(XmlOptions options)
  {
    return underlyingXmlObject().newInputStream(options);
  }
  
  public Reader newReader(XmlOptions options)
  {
    return underlyingXmlObject().newReader(options);
  }
  
  public Node newDomNode(XmlOptions options)
  {
    return underlyingXmlObject().newDomNode(options);
  }
  
  public void save(ContentHandler ch, LexicalHandler lh, XmlOptions options)
    throws SAXException
  {
    underlyingXmlObject().save(ch, lh, options);
  }
  
  public void save(File file, XmlOptions options)
    throws IOException
  {
    underlyingXmlObject().save(file, options);
  }
  
  public void save(OutputStream os, XmlOptions options)
    throws IOException
  {
    underlyingXmlObject().save(os, options);
  }
  
  public void save(Writer w, XmlOptions options)
    throws IOException
  {
    underlyingXmlObject().save(w, options);
  }
  
  public SchemaType instanceType()
  {
    return ((SimpleValue)underlyingXmlObject()).instanceType();
  }
  
  /**
   * @deprecated
   */
  public String stringValue()
  {
    return ((SimpleValue)underlyingXmlObject()).stringValue();
  }
  
  /**
   * @deprecated
   */
  public boolean booleanValue()
  {
    return ((SimpleValue)underlyingXmlObject()).booleanValue();
  }
  
  /**
   * @deprecated
   */
  public byte byteValue()
  {
    return ((SimpleValue)underlyingXmlObject()).byteValue();
  }
  
  /**
   * @deprecated
   */
  public short shortValue()
  {
    return ((SimpleValue)underlyingXmlObject()).shortValue();
  }
  
  /**
   * @deprecated
   */
  public int intValue()
  {
    return ((SimpleValue)underlyingXmlObject()).intValue();
  }
  
  /**
   * @deprecated
   */
  public long longValue()
  {
    return ((SimpleValue)underlyingXmlObject()).longValue();
  }
  
  /**
   * @deprecated
   */
  public BigInteger bigIntegerValue()
  {
    return ((SimpleValue)underlyingXmlObject()).bigIntegerValue();
  }
  
  /**
   * @deprecated
   */
  public BigDecimal bigDecimalValue()
  {
    return ((SimpleValue)underlyingXmlObject()).bigDecimalValue();
  }
  
  /**
   * @deprecated
   */
  public float floatValue()
  {
    return ((SimpleValue)underlyingXmlObject()).floatValue();
  }
  
  /**
   * @deprecated
   */
  public double doubleValue()
  {
    return ((SimpleValue)underlyingXmlObject()).doubleValue();
  }
  
  /**
   * @deprecated
   */
  public byte[] byteArrayValue()
  {
    return ((SimpleValue)underlyingXmlObject()).byteArrayValue();
  }
  
  /**
   * @deprecated
   */
  public StringEnumAbstractBase enumValue()
  {
    return ((SimpleValue)underlyingXmlObject()).enumValue();
  }
  
  /**
   * @deprecated
   */
  public Calendar calendarValue()
  {
    return ((SimpleValue)underlyingXmlObject()).calendarValue();
  }
  
  /**
   * @deprecated
   */
  public Date dateValue()
  {
    return ((SimpleValue)underlyingXmlObject()).dateValue();
  }
  
  /**
   * @deprecated
   */
  public GDate gDateValue()
  {
    return ((SimpleValue)underlyingXmlObject()).gDateValue();
  }
  
  /**
   * @deprecated
   */
  public GDuration gDurationValue()
  {
    return ((SimpleValue)underlyingXmlObject()).gDurationValue();
  }
  
  /**
   * @deprecated
   */
  public QName qNameValue()
  {
    return ((SimpleValue)underlyingXmlObject()).qNameValue();
  }
  
  /**
   * @deprecated
   */
  public List listValue()
  {
    return ((SimpleValue)underlyingXmlObject()).listValue();
  }
  
  /**
   * @deprecated
   */
  public List xlistValue()
  {
    return ((SimpleValue)underlyingXmlObject()).xlistValue();
  }
  
  /**
   * @deprecated
   */
  public Object objectValue()
  {
    return ((SimpleValue)underlyingXmlObject()).objectValue();
  }
  
  /**
   * @deprecated
   */
  public void set(String obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(boolean v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(byte v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(short v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(int v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(long v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(BigInteger obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(BigDecimal obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(float v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(double v)
  {
    ((SimpleValue)underlyingXmlObject()).set(v);
  }
  
  /**
   * @deprecated
   */
  public void set(byte[] obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(StringEnumAbstractBase obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(Calendar obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(Date obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(GDateSpecification obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(GDurationSpecification obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(QName obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  /**
   * @deprecated
   */
  public void set(List obj)
  {
    ((SimpleValue)underlyingXmlObject()).set(obj);
  }
  
  public String getStringValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getStringValue();
  }
  
  public boolean getBooleanValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getBooleanValue();
  }
  
  public byte getByteValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getByteValue();
  }
  
  public short getShortValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getShortValue();
  }
  
  public int getIntValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getIntValue();
  }
  
  public long getLongValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getLongValue();
  }
  
  public BigInteger getBigIntegerValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getBigIntegerValue();
  }
  
  public BigDecimal getBigDecimalValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getBigDecimalValue();
  }
  
  public float getFloatValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getFloatValue();
  }
  
  public double getDoubleValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getDoubleValue();
  }
  
  public byte[] getByteArrayValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getByteArrayValue();
  }
  
  public StringEnumAbstractBase getEnumValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getEnumValue();
  }
  
  public Calendar getCalendarValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getCalendarValue();
  }
  
  public Date getDateValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getDateValue();
  }
  
  public GDate getGDateValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getGDateValue();
  }
  
  public GDuration getGDurationValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getGDurationValue();
  }
  
  public QName getQNameValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getQNameValue();
  }
  
  public List getListValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getListValue();
  }
  
  public List xgetListValue()
  {
    return ((SimpleValue)underlyingXmlObject()).xgetListValue();
  }
  
  public Object getObjectValue()
  {
    return ((SimpleValue)underlyingXmlObject()).getObjectValue();
  }
  
  public void setStringValue(String obj)
  {
    ((SimpleValue)underlyingXmlObject()).setStringValue(obj);
  }
  
  public void setBooleanValue(boolean v)
  {
    ((SimpleValue)underlyingXmlObject()).setBooleanValue(v);
  }
  
  public void setByteValue(byte v)
  {
    ((SimpleValue)underlyingXmlObject()).setByteValue(v);
  }
  
  public void setShortValue(short v)
  {
    ((SimpleValue)underlyingXmlObject()).setShortValue(v);
  }
  
  public void setIntValue(int v)
  {
    ((SimpleValue)underlyingXmlObject()).setIntValue(v);
  }
  
  public void setLongValue(long v)
  {
    ((SimpleValue)underlyingXmlObject()).setLongValue(v);
  }
  
  public void setBigIntegerValue(BigInteger obj)
  {
    ((SimpleValue)underlyingXmlObject()).setBigIntegerValue(obj);
  }
  
  public void setBigDecimalValue(BigDecimal obj)
  {
    ((SimpleValue)underlyingXmlObject()).setBigDecimalValue(obj);
  }
  
  public void setFloatValue(float v)
  {
    ((SimpleValue)underlyingXmlObject()).setFloatValue(v);
  }
  
  public void setDoubleValue(double v)
  {
    ((SimpleValue)underlyingXmlObject()).setDoubleValue(v);
  }
  
  public void setByteArrayValue(byte[] obj)
  {
    ((SimpleValue)underlyingXmlObject()).setByteArrayValue(obj);
  }
  
  public void setEnumValue(StringEnumAbstractBase obj)
  {
    ((SimpleValue)underlyingXmlObject()).setEnumValue(obj);
  }
  
  public void setCalendarValue(Calendar obj)
  {
    ((SimpleValue)underlyingXmlObject()).setCalendarValue(obj);
  }
  
  public void setDateValue(Date obj)
  {
    ((SimpleValue)underlyingXmlObject()).setDateValue(obj);
  }
  
  public void setGDateValue(GDate obj)
  {
    ((SimpleValue)underlyingXmlObject()).setGDateValue(obj);
  }
  
  public void setGDurationValue(GDuration obj)
  {
    ((SimpleValue)underlyingXmlObject()).setGDurationValue(obj);
  }
  
  public void setQNameValue(QName obj)
  {
    ((SimpleValue)underlyingXmlObject()).setQNameValue(obj);
  }
  
  public void setListValue(List obj)
  {
    ((SimpleValue)underlyingXmlObject()).setListValue(obj);
  }
  
  public void setObjectValue(Object obj)
  {
    ((SimpleValue)underlyingXmlObject()).setObjectValue(obj);
  }
  
  /**
   * @deprecated
   */
  public void objectSet(Object obj)
  {
    ((SimpleValue)underlyingXmlObject()).objectSet(obj);
  }
  
  public XmlObject[] selectChildren(QName elementName)
  {
    return underlyingXmlObject().selectChildren(elementName);
  }
  
  public XmlObject[] selectChildren(String elementUri, String elementLocalName)
  {
    return underlyingXmlObject().selectChildren(elementUri, elementLocalName);
  }
  
  public XmlObject[] selectChildren(QNameSet elementNameSet)
  {
    return underlyingXmlObject().selectChildren(elementNameSet);
  }
  
  public XmlObject selectAttribute(QName attributeName)
  {
    return underlyingXmlObject().selectAttribute(attributeName);
  }
  
  public XmlObject selectAttribute(String attributeUri, String attributeLocalName)
  {
    return underlyingXmlObject().selectAttribute(attributeUri, attributeLocalName);
  }
  
  public XmlObject[] selectAttributes(QNameSet attributeNameSet)
  {
    return underlyingXmlObject().selectAttributes(attributeNameSet);
  }
}

/* Location:
 * Qualified Name:     org.apache.xmlbeans.FilterXmlObject
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.xmlbeans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public final class GDate
  implements GDateSpecification, Serializable
{
  private static final long serialVersionUID = 1L;
  private transient String _canonicalString;
  private transient String _string;
  private int _bits;
  private int _CY;
  private int _M;
  private int _D;
  private int _h;
  private int _m;
  private int _s;
  private BigDecimal _fs;
  private int _tzsign;
  private int _tzh;
  private int _tzm;
  static final BigDecimal _zero = BigDecimal.valueOf(0L);
  static final BigDecimal _one = BigDecimal.valueOf(1L);
  
  public GDate(CharSequence string)
  {
    int len = string.length();
    int start = 0;
    while ((len > 0) && (isSpace(string.charAt(len - 1)))) {
      len--;
    }
    while ((start < len) && (isSpace(string.charAt(start)))) {
      start++;
    }
    if ((len - start >= 1) && (string.charAt(len - 1) == 'Z'))
    {
      _bits |= 0x1;
      len--;
    }
    else if (len - start >= 6)
    {
      if (string.charAt(len - 3) == ':')
      {
        int tzsign;
        switch (string.charAt(len - 6))
        {
        case '-': 
          tzsign = -1; break;
        case '+': 
          tzsign = 1; break;
        }
        int tzhour = twoDigit(string, len - 5);
        int tzminute = twoDigit(string, len - 2);
        if (tzhour > 14) {
          throw new IllegalArgumentException("time zone hour must be two digits between -14 and +14");
        }
        if (tzminute > 59) {
          throw new IllegalArgumentException("time zone minute must be two digits between 00 and 59");
        }
        _bits |= 0x1;
        _tzsign = tzsign;
        _tzh = tzhour;
        _tzm = tzminute;
        len -= 6;
      }
    }
    if ((start < len) && ((start + 2 >= len) || (string.charAt(start + 2) != ':')))
    {
      boolean negyear = false;
      if ((start < len) && (string.charAt(start) == '-'))
      {
        negyear = true;
        start++;
      }
      int value = 0;
      int digits = -start;
      char ch;
      for (;;)
      {
        ch = start < len ? string.charAt(start) : '\000';
        if (!isDigit(ch)) {
          break;
        }
        value = value * 10 + digitVal(ch);
        start++;
      }
      digits += start;
      if (digits > 6) {
        throw new IllegalArgumentException("year too long (up to 6 digits)");
      }
      if (digits >= 4)
      {
        _bits |= 0x2;
        _CY = (negyear ? -value : value);
        if (_CY == 0) {
          throw new IllegalArgumentException("year must not be zero");
        }
      }
      else if (digits > 0)
      {
        throw new IllegalArgumentException("year must be four digits (may pad with zeroes, e.g., 0560)");
      }
      if (ch != '-')
      {
        if ((negyear) && (!hasYear())) {
          throw new IllegalArgumentException();
        }
      }
      else
      {
        start++;
        if (len - start >= 2)
        {
          value = twoDigit(string, start);
          if ((value >= 1) && (value <= 12))
          {
            _bits |= 0x4;
            _M = value;
            start += 2;
          }
        }
        ch = start < len ? string.charAt(start) : '\000';
        if (ch != '-')
        {
          if (!hasMonth()) {
            throw new IllegalArgumentException();
          }
        }
        else
        {
          start++;
          if (len - start >= 2)
          {
            value = twoDigit(string, start);
            if ((value >= 1) && (value <= 31))
            {
              _bits |= 0x8;
              _D = value;
              start += 2;
            }
          }
          if (!hasDay())
          {
            if ((hasMonth()) && (!hasYear()))
            {
              ch = start < len ? string.charAt(start) : '\000';
              if (ch == '-')
              {
                start++;
                break label679;
              }
            }
            throw new IllegalArgumentException();
          }
        }
      }
    }
    label679:
    if (start < len)
    {
      if ((hasYear()) || (hasMonth()) || (hasDay()))
      {
        if (string.charAt(start) != 'T') {
          throw new IllegalArgumentException("date and time must be separated by 'T'");
        }
        start++;
      }
      if ((len < start + 8) || (string.charAt(start + 2) != ':') || (string.charAt(start + 5) != ':')) {
        throw new IllegalArgumentException();
      }
      int h = twoDigit(string, start);
      if (h >= 24) {
        throw new IllegalArgumentException("hour must be between 00 and 23");
      }
      int m = twoDigit(string, start + 3);
      if (m >= 60) {
        throw new IllegalArgumentException("minute must be between 00 and 59");
      }
      int s = twoDigit(string, start + 6);
      if (s >= 60) {
        throw new IllegalArgumentException("second must be between 00 and 59");
      }
      start += 8;
      
      BigDecimal fs = _zero;
      if (start < len)
      {
        if (string.charAt(start) != '.') {
          throw new IllegalArgumentException();
        }
        if (start + 1 < len)
        {
          for (int i = start + 1; i < len; i++) {
            if (!isDigit(string.charAt(i))) {
              throw new IllegalArgumentException();
            }
          }
          try
          {
            fs = new BigDecimal(string.subSequence(start, len).toString());
          }
          catch (Throwable e)
          {
            throw new IllegalArgumentException();
          }
        }
      }
      _bits |= 0x10;
      _h = h;
      _m = m;
      _s = s;
      _fs = fs;
    }
    if (!isValid()) {
      throw new IllegalArgumentException("invalid date");
    }
  }
  
  public GDate(int year, int month, int day, int hour, int minute, int second, BigDecimal fraction)
  {
    _bits = 30;
    
    _CY = year;
    _M = month;
    _D = day;
    _h = hour;
    _m = minute;
    _s = second;
    _fs = (fraction == null ? _zero : fraction);
    if (!isValid()) {
      throw new IllegalArgumentException();
    }
  }
  
  public GDate(int year, int month, int day, int hour, int minute, int second, BigDecimal fraction, int tzSign, int tzHour, int tzMinute)
  {
    _bits = 31;
    
    _CY = year;
    _M = month;
    _D = day;
    _h = hour;
    _m = minute;
    _s = second;
    _fs = (fraction == null ? _zero : fraction);
    _tzsign = tzSign;
    _tzh = tzHour;
    _tzm = tzMinute;
    if (!isValid()) {
      throw new IllegalArgumentException();
    }
  }
  
  public GDate(Date date)
  {
    this(new GDateBuilder(date));
  }
  
  public GDate(Calendar calendar)
  {
    boolean isSetYear = calendar.isSet(1);
    boolean isSetEra = calendar.isSet(0);
    boolean isSetMonth = calendar.isSet(2);
    boolean isSetDay = calendar.isSet(5);
    boolean isSetHourOfDay = calendar.isSet(11);
    boolean isSetHour = calendar.isSet(10);
    boolean isSetAmPm = calendar.isSet(9);
    boolean isSetMinute = calendar.isSet(12);
    boolean isSetSecond = calendar.isSet(13);
    boolean isSetMillis = calendar.isSet(14);
    boolean isSetZone = calendar.isSet(15);
    boolean isSetDst = calendar.isSet(16);
    if (isSetYear)
    {
      int y = calendar.get(1);
      if ((isSetEra) && ((calendar instanceof GregorianCalendar)) && 
        (calendar.get(0) == 0)) {
        y = -y;
      }
      _bits |= 0x2;
      _CY = y;
    }
    if (isSetMonth)
    {
      _bits |= 0x4;
      _M = (calendar.get(2) + 1);
    }
    if (isSetDay)
    {
      _bits |= 0x8;
      _D = calendar.get(5);
    }
    boolean gotTime = false;
    
    int h = 0;
    int m = 0;
    int s = 0;
    BigDecimal fs = _zero;
    if (isSetHourOfDay)
    {
      h = calendar.get(11);
      gotTime = true;
    }
    else if ((isSetHour) && (isSetAmPm))
    {
      h = calendar.get(10) + calendar.get(9) * 12;
      gotTime = true;
    }
    if (isSetMinute)
    {
      m = calendar.get(12);
      gotTime = true;
    }
    if (isSetSecond)
    {
      s = calendar.get(13);
      gotTime = true;
    }
    if (isSetMillis)
    {
      fs = BigDecimal.valueOf(calendar.get(14), 3);
      gotTime = true;
    }
    if (gotTime)
    {
      _bits |= 0x10;
      _h = h;
      _m = m;
      _s = s;
      _fs = fs;
    }
    if (isSetZone)
    {
      int zoneOffsetInMilliseconds = calendar.get(15);
      if (isSetDst) {
        zoneOffsetInMilliseconds += calendar.get(16);
      }
      _bits |= 0x1;
      if (zoneOffsetInMilliseconds == 0)
      {
        _tzsign = 0;
        _tzh = 0;
        _tzm = 0;
        TimeZone zone = calendar.getTimeZone();
        String id = zone.getID();
        if ((id != null) && (id.length() > 3)) {
          switch (id.charAt(3))
          {
          case '+': 
            _tzsign = 1; break;
          case '-': 
            _tzsign = -1;
          }
        }
      }
      else
      {
        _tzsign = (zoneOffsetInMilliseconds < 0 ? -1 : 1);
        zoneOffsetInMilliseconds *= _tzsign;
        _tzh = (zoneOffsetInMilliseconds / 3600000);
        _tzm = ((zoneOffsetInMilliseconds - _tzh * 3600000) / 60000);
      }
    }
  }
  
  public GDate(GDateSpecification gdate)
  {
    if (gdate.hasTimeZone())
    {
      _bits |= 0x1;
      _tzsign = gdate.getTimeZoneSign();
      _tzh = gdate.getTimeZoneHour();
      _tzm = gdate.getTimeZoneMinute();
    }
    if (gdate.hasTime())
    {
      _bits |= 0x10;
      _h = gdate.getHour();
      _m = gdate.getMinute();
      _s = gdate.getSecond();
      _fs = gdate.getFraction();
    }
    if (gdate.hasDay())
    {
      _bits |= 0x8;
      _D = gdate.getDay();
    }
    if (gdate.hasMonth())
    {
      _bits |= 0x4;
      _M = gdate.getMonth();
    }
    if (gdate.hasYear())
    {
      _bits |= 0x2;
      _CY = gdate.getYear();
    }
  }
  
  static final boolean isDigit(char ch)
  {
    return (char)(ch - '0') <= '\t';
  }
  
  static final boolean isSpace(char ch)
  {
    switch (ch)
    {
    case '\t': 
    case '\n': 
    case '\r': 
    case ' ': 
      return true;
    }
    return false;
  }
  
  static final int digitVal(char ch)
  {
    return ch - '0';
  }
  
  private static final int twoDigit(CharSequence str, int index)
  {
    char ch1 = str.charAt(index);
    char ch2 = str.charAt(index + 1);
    if ((!isDigit(ch1)) || (!isDigit(ch2))) {
      return 100;
    }
    return digitVal(ch1) * 10 + digitVal(ch2);
  }
  
  public final boolean isImmutable()
  {
    return true;
  }
  
  public int getFlags()
  {
    return _bits;
  }
  
  public final boolean hasTimeZone()
  {
    return (_bits & 0x1) != 0;
  }
  
  public final boolean hasYear()
  {
    return (_bits & 0x2) != 0;
  }
  
  public final boolean hasMonth()
  {
    return (_bits & 0x4) != 0;
  }
  
  public final boolean hasDay()
  {
    return (_bits & 0x8) != 0;
  }
  
  public final boolean hasTime()
  {
    return (_bits & 0x10) != 0;
  }
  
  public final boolean hasDate()
  {
    return (_bits & 0xE) == 14;
  }
  
  public final int getYear()
  {
    return _CY;
  }
  
  public final int getMonth()
  {
    return _M;
  }
  
  public final int getDay()
  {
    return _D;
  }
  
  public final int getHour()
  {
    return _h;
  }
  
  public final int getMinute()
  {
    return _m;
  }
  
  public final int getSecond()
  {
    return _s;
  }
  
  public final BigDecimal getFraction()
  {
    return _fs;
  }
  
  public final int getTimeZoneSign()
  {
    return _tzsign;
  }
  
  public final int getTimeZoneHour()
  {
    return _tzh;
  }
  
  public final int getTimeZoneMinute()
  {
    return _tzm;
  }
  
  public int getMillisecond()
  {
    if (_fs == null) {
      return 0;
    }
    return _fs.setScale(3, 4).unscaledValue().intValue();
  }
  
  public String canonicalString()
  {
    ensureCanonicalString();
    return _canonicalString;
  }
  
  public boolean isValid()
  {
    return GDateBuilder.isValidGDate(this);
  }
  
  public int getJulianDate()
  {
    return GDateBuilder.julianDateForGDate(this);
  }
  
  public XmlCalendar getCalendar()
  {
    return new XmlCalendar(this);
  }
  
  public Date getDate()
  {
    return GDateBuilder.dateForGDate(this);
  }
  
  public int compareToGDate(GDateSpecification datespec)
  {
    return GDateBuilder.compareGDate(this, datespec);
  }
  
  public int getBuiltinTypeCode()
  {
    return GDateBuilder.btcForFlags(_bits);
  }
  
  public GDate add(GDurationSpecification duration)
  {
    GDateBuilder builder = new GDateBuilder(this);
    builder.addGDuration(duration);
    return builder.toGDate();
  }
  
  public GDate subtract(GDurationSpecification duration)
  {
    GDateBuilder builder = new GDateBuilder(this);
    builder.subtractGDuration(duration);
    return builder.toGDate();
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof GDate)) {
      return false;
    }
    ensureCanonicalString();
    return _canonicalString.equals(((GDate)obj).canonicalString());
  }
  
  public int hashCode()
  {
    ensureCanonicalString();
    return _canonicalString.hashCode();
  }
  
  private void ensureCanonicalString()
  {
    if (_canonicalString != null) {
      return;
    }
    boolean needNormalize = (hasTimeZone()) && (getTimeZoneSign() != 0) && (hasTime()) && (hasDay() == hasMonth()) && (hasDay() == hasYear());
    if ((!needNormalize) && (getFraction() != null) && (getFraction().scale() > 0))
    {
      BigInteger bi = getFraction().unscaledValue();
      needNormalize = bi.mod(GDateBuilder.TEN).signum() == 0;
    }
    if (!needNormalize)
    {
      _canonicalString = toString();
    }
    else
    {
      GDateBuilder gdb = new GDateBuilder(this);
      gdb.normalize();
      _canonicalString = gdb.toString();
    }
  }
  
  public String toString()
  {
    if (_string == null) {
      _string = formatGDate(this);
    }
    return _string;
  }
  
  private static final char[] _tensDigit = { '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '4', '4', '4', '4', '4', '4', '4', '4', '4', '4', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '6', '6', '6', '6', '6', '6', '6', '6', '6', '6', '7', '7', '7', '7', '7', '7', '7', '7', '7', '7', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '9', '9', '9', '9', '9', '9', '9', '9', '9', '9' };
  private static final char[] _onesDigit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
  
  private static final int _padTwoAppend(char[] b, int i, int n)
  {
    assert ((n >= 0) && (n < 100));
    b[i] = _tensDigit[n];
    b[(i + 1)] = _onesDigit[n];
    return i + 2;
  }
  
  private static final int _padFourAppend(char[] b, int i, int n)
  {
    if (n < 0)
    {
      b[(i++)] = '-';
      n = -n;
    }
    if (n >= 10000)
    {
      String s = Integer.toString(n);
      s.getChars(0, s.length(), b, i);
      return i + s.length();
    }
    int q = n / 100;
    int r = n - q * 100;
    b[i] = _tensDigit[q];
    b[(i + 1)] = _onesDigit[q];
    b[(i + 2)] = _tensDigit[r];
    b[(i + 3)] = _onesDigit[r];
    return i + 4;
  }
  
  private static final TimeZone GMTZONE = TimeZone.getTimeZone("GMT");
  private static final TimeZone[] MINUSZONE = { TimeZone.getTimeZone("GMT-00:00"), TimeZone.getTimeZone("GMT-01:00"), TimeZone.getTimeZone("GMT-02:00"), TimeZone.getTimeZone("GMT-03:00"), TimeZone.getTimeZone("GMT-04:00"), TimeZone.getTimeZone("GMT-05:00"), TimeZone.getTimeZone("GMT-06:00"), TimeZone.getTimeZone("GMT-07:00"), TimeZone.getTimeZone("GMT-08:00"), TimeZone.getTimeZone("GMT-09:00"), TimeZone.getTimeZone("GMT-10:00"), TimeZone.getTimeZone("GMT-11:00"), TimeZone.getTimeZone("GMT-12:00"), TimeZone.getTimeZone("GMT-13:00"), TimeZone.getTimeZone("GMT-14:00") };
  private static final TimeZone[] PLUSZONE = { TimeZone.getTimeZone("GMT+00:00"), TimeZone.getTimeZone("GMT+01:00"), TimeZone.getTimeZone("GMT+02:00"), TimeZone.getTimeZone("GMT+03:00"), TimeZone.getTimeZone("GMT+04:00"), TimeZone.getTimeZone("GMT+05:00"), TimeZone.getTimeZone("GMT+06:00"), TimeZone.getTimeZone("GMT+07:00"), TimeZone.getTimeZone("GMT+08:00"), TimeZone.getTimeZone("GMT+09:00"), TimeZone.getTimeZone("GMT+10:00"), TimeZone.getTimeZone("GMT+11:00"), TimeZone.getTimeZone("GMT+12:00"), TimeZone.getTimeZone("GMT+13:00"), TimeZone.getTimeZone("GMT+14:00") };
  
  static final TimeZone timeZoneForGDate(GDateSpecification date)
  {
    if (!date.hasTimeZone()) {
      return TimeZone.getDefault();
    }
    if (date.getTimeZoneSign() == 0) {
      return GMTZONE;
    }
    if ((date.getTimeZoneMinute() == 0) && (date.getTimeZoneHour() <= 14) && (date.getTimeZoneHour() >= 0)) {
      return date.getTimeZoneSign() < 0 ? MINUSZONE[date.getTimeZoneHour()] : PLUSZONE[date.getTimeZoneHour()];
    }
    char[] zb = new char[9];
    zb[0] = 'G';
    zb[1] = 'M';
    zb[2] = 'T';
    zb[3] = (date.getTimeZoneSign() < 0 ? 45 : '+');
    _padTwoAppend(zb, 4, date.getTimeZoneHour());
    zb[6] = ':';
    _padTwoAppend(zb, 7, date.getTimeZoneMinute());
    return TimeZone.getTimeZone(new String(zb));
  }
  
  static String formatGDate(GDateSpecification spec)
  {
    BigDecimal fs = spec.getFraction();
    char[] message = new char[33 + (fs == null ? 0 : fs.scale())];
    int i = 0;
    if ((spec.hasYear()) || (spec.hasMonth()) || (spec.hasDay()))
    {
      if (spec.hasYear()) {
        i = _padFourAppend(message, 0, spec.getYear());
      } else {
        message[(i++)] = '-';
      }
      if ((spec.hasMonth()) || (spec.hasDay()))
      {
        message[(i++)] = '-';
        if (spec.hasMonth()) {
          i = _padTwoAppend(message, i, spec.getMonth());
        }
        if (spec.hasDay())
        {
          message[(i++)] = '-';
          i = _padTwoAppend(message, i, spec.getDay());
        }
      }
      if (spec.hasTime()) {
        message[(i++)] = 'T';
      }
    }
    if (spec.hasTime())
    {
      i = _padTwoAppend(message, i, spec.getHour());
      message[(i++)] = ':';
      i = _padTwoAppend(message, i, spec.getMinute());
      message[(i++)] = ':';
      i = _padTwoAppend(message, i, spec.getSecond());
      if (fs != _zero)
      {
        String frac = fs.toString();
        int point = frac.indexOf('.');
        if (point >= 0)
        {
          frac.getChars(point, frac.length(), message, i);
          i += frac.length() - point;
        }
      }
    }
    if (spec.hasTimeZone()) {
      if (spec.getTimeZoneSign() == 0)
      {
        message[(i++)] = 'Z';
      }
      else
      {
        message[(i++)] = (spec.getTimeZoneSign() > 0 ? 43 : '-');
        i = _padTwoAppend(message, i, spec.getTimeZoneHour());
        message[(i++)] = ':';
        i = _padTwoAppend(message, i, spec.getTimeZoneMinute());
      }
    }
    return new String(message, 0, i);
  }
}

/* Location:
 * Qualified Name:     org.apache.xmlbeans.GDate
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.xmlbeans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public final class GDateBuilder
  implements GDateSpecification, Serializable
{
  private static final long serialVersionUID = 1L;
  private int _bits;
  private int _CY;
  private int _M;
  private int _D;
  private int _h;
  private int _m;
  private int _s;
  private BigDecimal _fs;
  private int _tzsign;
  private int _tzh;
  private int _tzm;
  
  public GDateBuilder() {}
  
  public Object clone()
  {
    return new GDateBuilder(this);
  }
  
  public GDate toGDate()
  {
    return new GDate(this);
  }
  
  public GDateBuilder(GDateSpecification gdate)
  {
    if (gdate.hasTimeZone()) {
      setTimeZone(gdate.getTimeZoneSign(), gdate.getTimeZoneHour(), gdate.getTimeZoneMinute());
    }
    if (gdate.hasTime()) {
      setTime(gdate.getHour(), gdate.getMinute(), gdate.getSecond(), gdate.getFraction());
    }
    if (gdate.hasDay()) {
      setDay(gdate.getDay());
    }
    if (gdate.hasMonth()) {
      setMonth(gdate.getMonth());
    }
    if (gdate.hasYear()) {
      setYear(gdate.getYear());
    }
  }
  
  public GDateBuilder(CharSequence string)
  {
    this(new GDate(string));
  }
  
  public GDateBuilder(Calendar calendar)
  {
    this(new GDate(calendar));
  }
  
  public GDateBuilder(int year, int month, int day, int hour, int minute, int second, BigDecimal fraction)
  {
    _bits = 30;
    if (year == 0) {
      throw new IllegalArgumentException();
    }
    _CY = (year > 0 ? year : year + 1);
    _M = month;
    _D = day;
    _h = hour;
    _m = minute;
    _s = second;
    _fs = (fraction == null ? GDate._zero : fraction);
    if (!isValid()) {
      throw new IllegalArgumentException();
    }
  }
  
  public GDateBuilder(int year, int month, int day, int hour, int minute, int second, BigDecimal fraction, int tzSign, int tzHour, int tzMinute)
  {
    _bits = 31;
    if (year == 0) {
      throw new IllegalArgumentException();
    }
    _CY = (year > 0 ? year : year + 1);
    _M = month;
    _D = day;
    _h = hour;
    _m = minute;
    _s = second;
    _fs = (fraction == null ? GDate._zero : fraction);
    _tzsi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd