jaxb-impl

16:37:15.131 INFO  jd.cli.Main - Decompiling jaxb-impl.jar
package com.sun.xml.bind;

import com.sun.xml.bind.v2.runtime.reflect.Accessor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import javax.xml.bind.JAXBException;

public abstract interface AccessorFactory
{
  public abstract Accessor createFieldAccessor(Class paramClass, Field paramField, boolean paramBoolean)
    throws JAXBException;
  
  public abstract Accessor createPropertyAccessor(Class paramClass, Method paramMethod1, Method paramMethod2)
    throws JAXBException;
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.AccessorFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import com.sun.xml.bind.v2.runtime.reflect.Accessor;
import com.sun.xml.bind.v2.runtime.reflect.Accessor.FieldReflection;
import com.sun.xml.bind.v2.runtime.reflect.Accessor.GetterOnlyReflection;
import com.sun.xml.bind.v2.runtime.reflect.Accessor.GetterSetterReflection;
import com.sun.xml.bind.v2.runtime.reflect.Accessor.ReadOnlyFieldReflection;
import com.sun.xml.bind.v2.runtime.reflect.Accessor.SetterOnlyReflection;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AccessorFactoryImpl
  implements AccessorFactory
{
  private static AccessorFactoryImpl instance = new AccessorFactoryImpl();
  
  public static AccessorFactoryImpl getInstance()
  {
    return instance;
  }
  
  public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly)
  {
    return readOnly ? new Accessor.ReadOnlyFieldReflection(field) : new Accessor.FieldReflection(field);
  }
  
  public Accessor createPropertyAccessor(Class bean, Method getter, Method setter)
  {
    if (getter == null) {
      return new Accessor.SetterOnlyReflection(setter);
    }
    if (setter == null) {
      return new Accessor.GetterOnlyReflection(getter);
    }
    return new Accessor.GetterSetterReflection(getter, setter);
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.AccessorFactoryImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public final class AnyTypeAdapter
  extends XmlAdapter<Object, Object>
{
  public Object unmarshal(Object v)
  {
    return v;
  }
  
  public Object marshal(Object v)
  {
    return v;
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.AnyTypeAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import javax.xml.bind.Marshaller;

public abstract interface CycleRecoverable$Context
{
  public abstract Marshaller getMarshaller();
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.CycleRecoverable.Context
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import javax.xml.bind.Marshaller;

public abstract interface CycleRecoverable
{
  public abstract Object onCycleDetected(Context paramContext);
  
  public static abstract interface Context
  {
    public abstract Marshaller getMarshaller();
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.CycleRecoverable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

final class DatatypeConverterImpl$CalendarFormatter
{
  public static String doFormat(String format, Calendar cal)
    throws IllegalArgumentException
  {
    int fidx = 0;
    int flen = format.length();
    StringBuilder buf = new StringBuilder();
    while (fidx < flen)
    {
      char fch = format.charAt(fidx++);
      if (fch != '%') {
        buf.append(fch);
      } else {
        switch (format.charAt(fidx++))
        {
        case 'Y': 
          formatYear(cal, buf);
          break;
        case 'M': 
          formatMonth(cal, buf);
          break;
        case 'D': 
          formatDays(cal, buf);
          break;
        case 'h': 
          formatHours(cal, buf);
          break;
        case 'm': 
          formatMinutes(cal, buf);
          break;
        case 's': 
          formatSeconds(cal, buf);
          break;
        case 'z': 
          formatTimeZone(cal, buf);
          break;
        default: 
          throw new InternalError();
        }
      }
    }
    return buf.toString();
  }
  
  private static void formatYear(Calendar cal, StringBuilder buf)
  {
    int year = cal.get(1);
    String s;
    String s;
    if (year <= 0) {
      s = Integer.toString(1 - year);
    } else {
      s = Integer.toString(year);
    }
    while (s.length() < 4) {
      s = '0' + s;
    }
    if (year <= 0) {
      s = '-' + s;
    }
    buf.append(s);
  }
  
  private static void formatMonth(Calendar cal, StringBuilder buf)
  {
    formatTwoDigits(cal.get(2) + 1, buf);
  }
  
  private static void formatDays(Calendar cal, StringBuilder buf)
  {
    formatTwoDigits(cal.get(5), buf);
  }
  
  private static void formatHours(Calendar cal, StringBuilder buf)
  {
    formatTwoDigits(cal.get(11), buf);
  }
  
  private static void formatMinutes(Calendar cal, StringBuilder buf)
  {
    formatTwoDigits(cal.get(12), buf);
  }
  
  private static void formatSeconds(Calendar cal, StringBuilder buf)
  {
    formatTwoDigits(cal.get(13), buf);
    if (cal.isSet(14))
    {
      int n = cal.get(14);
      if (n != 0)
      {
        String ms = Integer.toString(n);
        while (ms.length() < 3) {
          ms = '0' + ms;
        }
        buf.append('.');
        buf.append(ms);
      }
    }
  }
  
  private static void formatTimeZone(Calendar cal, StringBuilder buf)
  {
    TimeZone tz = cal.getTimeZone();
    if (tz == null) {
      return;
    }
    int offset = tz.getOffset(cal.getTime().getTime());
    if (offset == 0)
    {
      buf.append('Z');
      return;
    }
    if (offset >= 0)
    {
      buf.append('+');
    }
    else
    {
      buf.append('-');
      offset *= -1;
    }
    offset /= 60000;
    
    formatTwoDigits(offset / 60, buf);
    buf.append(':');
    formatTwoDigits(offset % 60, buf);
  }
  
  private static void formatTwoDigits(int n, StringBuilder buf)
  {
    if (n < 10) {
      buf.append('0');
    }
    buf.append(n);
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.DatatypeConverterImpl.CalendarFormatter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import javax.xml.bind.DatatypeConverter;
import javax.xml.bind.DatatypeConverterInterface;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;

public final class DatatypeConverterImpl
  implements DatatypeConverterInterface
{
  public static final DatatypeConverterInterface theInstance;
  private static final char[] hexCode;
  private static final byte[] decodeMap;
  private static final byte PADDING = 127;
  private static final char[] encodeMap;
  private static final DatatypeFactory datatypeFactory;
  
  public String parseString(String lexicalXSDString)
  {
    return lexicalXSDString;
  }
  
  public BigInteger parseInteger(String lexicalXSDInteger)
  {
    return _parseInteger(lexicalXSDInteger);
  }
  
  public static BigInteger _parseInteger(CharSequence s)
  {
    return new BigInteger(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
  }
  
  public String printInteger(BigInteger val)
  {
    return _printInteger(val);
  }
  
  public static String _printInteger(BigInteger val)
  {
    return val.toString();
  }
  
  public int parseInt(String s)
  {
    return _parseInt(s);
  }
  
  public static int _parseInt(CharSequence s)
  {
    int len = s.length();
    int sign = 1;
    
    int r = 0;
    for (int i = 0; i < len; i++)
    {
      char ch = s.charAt(i);
      if (!WhiteSpaceProcessor.isWhiteSpace(ch)) {
        if (('0' <= ch) && (ch <= '9')) {
          r = r * 10 + (ch - '0');
        } else if (ch == '-') {
          sign = -1;
        } else if (ch != '+') {
          throw new NumberFormatException("Not a number: " + s);
        }
      }
    }
    return r * sign;
  }
  
  public long parseLong(String lexicalXSLong)
  {
    return _parseLong(lexicalXSLong);
  }
  
  public static long _parseLong(CharSequence s)
  {
    return Long.valueOf(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString()).longValue();
  }
  
  public short parseShort(String lexicalXSDShort)
  {
    return _parseShort(lexicalXSDShort);
  }
  
  public static short _parseShort(CharSequence s)
  {
    return (short)_parseInt(s);
  }
  
  public String printShort(short val)
  {
    return _printShort(val);
  }
  
  public static String _printShort(short val)
  {
    return String.valueOf(val);
  }
  
  public BigDecimal parseDecimal(String content)
  {
    return _parseDecimal(content);
  }
  
  public static BigDecimal _parseDecimal(CharSequence content)
  {
    content = WhiteSpaceProcessor.trim(content);
    if (content.length() <= 0) {
      return null;
    }
    return new BigDecimal(content.toString());
  }
  
  public float parseFloat(String lexicalXSDFloat)
  {
    return _parseFloat(lexicalXSDFloat);
  }
  
  public static float _parseFloat(CharSequence _val)
  {
    String s = WhiteSpaceProcessor.trim(_val).toString();
    if (s.equals("NaN")) {
      return NaN.0F;
    }
    if (s.equals("INF")) {
      return Float.POSITIVE_INFINITY;
    }
    if (s.equals("-INF")) {
      return Float.NEGATIVE_INFINITY;
    }
    if ((s.length() == 0) || (!isDigitOrPeriodOrSign(s.charAt(0))) || (!isDigitOrPeriodOrSign(s.charAt(s.length() - 1)))) {
      throw new NumberFormatException();
    }
    return Float.parseFloat(s);
  }
  
  public String printFloat(float v)
  {
    return _printFloat(v);
  }
  
  public static String _printFloat(float v)
  {
    if (Float.isNaN(v)) {
      return "NaN";
    }
    if (v == Float.POSITIVE_INFINITY) {
      return "INF";
    }
    if (v == Float.NEGATIVE_INFINITY) {
      return "-INF";
    }
    return String.valueOf(v);
  }
  
  public double parseDouble(String lexicalXSDDouble)
  {
    return _parseDouble(lexicalXSDDouble);
  }
  
  public static double _parseDouble(CharSequence _val)
  {
    String val = WhiteSpaceProcessor.trim(_val).toString();
    if (val.equals("NaN")) {
      return NaN.0D;
    }
    if (val.equals("INF")) {
      return Double.POSITIVE_INFINITY;
    }
    if (val.equals("-INF")) {
      return Double.NEGATIVE_INFINITY;
    }
    if ((val.length() == 0) || (!isDigitOrPeriodOrSign(val.charAt(0))) || (!isDigitOrPeriodOrSign(val.charAt(val.length() - 1)))) {
      throw new NumberFormatException(val);
    }
    return Double.parseDouble(val);
  }
  
  public boolean parseBoolean(String lexicalXSDBoolean)
  {
    return _parseBoolean(lexicalXSDBoolean).booleanValue();
  }
  
  public static Boolean _parseBoolean(CharSequence literal)
  {
    int i = 0;
    int len = literal.length();
    
    boolean value = false;
    if (literal.length() <= 0) {
      return null;
    }
    char ch;
    do
    {
      ch = literal.charAt(i++);
    } while ((WhiteSpaceProcessor.isWhiteSpace(ch)) && (i < len));
    int strIndex = 0;
    switch (ch)
    {
    case '1': 
      value = true;
      break;
    case '0': 
      value = false;
      break;
    case 't': 
      String strTrue = "rue";
      do
      {
        ch = literal.charAt(i++);
      } while ((strTrue.charAt(strIndex++) == ch) && (i < len) && (strIndex < 3));
      if (strIndex == 3) {
        value = true;
      } else {
        throw new IllegalArgumentException("String \"" + literal + "\" is not valid boolean value.");
      }
      break;
    case 'f': 
      String strFalse = "alse";
      do
      {
        ch = literal.charAt(i++);
      } while ((strFalse.charAt(strIndex++) == ch) && (i < len) && (strIndex < 4));
      if (strIndex == 4) {
        value = false;
      } else {
        throw new IllegalArgumentException("String \"" + literal + "\" is not valid boolean value.");
      }
      break;
    }
    if (i < len) {
      do
      {
        ch = literal.charAt(i++);
      } while ((WhiteSpaceProcessor.isWhiteSpace(ch)) && (i < len));
    }
    if (i == len) {
      return Boolean.valueOf(value);
    }
    throw new IllegalArgumentException("String \"" + literal + "\" is not valid boolean value.");
  }
  
  public String printBoolean(boolean val)
  {
    return val ? "true" : "false";
  }
  
  public static String _printBoolean(boolean val)
  {
    return val ? "true" : "false";
  }
  
  public byte parseByte(String lexicalXSDByte)
  {
    return _parseByte(lexicalXSDByte);
  }
  
  public static byte _parseByte(CharSequence literal)
  {
    return (byte)_parseInt(literal);
  }
  
  public String printByte(byte val)
  {
    return _printByte(val);
  }
  
  public static String _printByte(byte val)
  {
    return String.valueOf(val);
  }
  
  public QName parseQName(String lexicalXSDQName, NamespaceContext nsc)
  {
    return _parseQName(lexicalXSDQName, nsc);
  }
  
  public static QName _parseQName(CharSequence text, NamespaceContext nsc)
  {
    int length = text.length();
    
    int start = 0;
    while ((start < length) && (WhiteSpaceProcessor.isWhiteSpace(text.charAt(start)))) {
      start++;
    }
    int end = length;
    while ((end > start) && (WhiteSpaceProcessor.isWhiteSpace(text.charAt(end - 1)))) {
      end--;
    }
    if (end == start) {
      throw new IllegalArgumentException("input is empty");
    }
    int idx = start + 1;
    while ((idx < end) && (text.charAt(idx) != ':')) {
      idx++;
    }
    String prefix;
    String prefix;
    String localPart;
    String uri;
    if (idx == end)
    {
      String uri = nsc.getNamespaceURI("");
      String localPart = text.subSequence(start, end).toString();
      prefix = "";
    }
    else
    {
      prefix = text.subSequence(start, idx).toString();
      localPart = text.subSequence(idx + 1, end).toString();
      uri = nsc.getNamespaceURI(prefix);
      if ((uri == null) || (uri.length() == 0)) {
        throw new IllegalArgumentException("prefix " + prefix + " is not bound to a namespace");
      }
    }
    return new QName(uri, localPart, prefix);
  }
  
  public Calendar parseDateTime(String lexicalXSDDateTime)
  {
    return _parseDateTime(lexicalXSDDateTime);
  }
  
  public static GregorianCalendar _parseDateTime(CharSequence s)
  {
    String val = WhiteSpaceProcessor.trim(s).toString();
    return datatypeFactory.newXMLGregorianCalendar(val).toGregorianCalendar();
  }
  
  public String printDateTime(Calendar val)
  {
    return _printDateTime(val);
  }
  
  public static String _printDateTime(Calendar val)
  {
    return CalendarFormatter.doFormat("%Y-%M-%DT%h:%m:%s%z", val);
  }
  
  public byte[] parseBase64Binary(String lexicalXSDBase64Binary)
  {
    return _parseBase64Binary(lexicalXSDBase64Binary);
  }
  
  public byte[] parseHexBinary(String s)
  {
    int len = s.length();
    if (len % 2 != 0) {
      throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
    }
    byte[] out = new byte[len / 2];
    for (int i = 0; i < len; i += 2)
    {
      int h = hexToBin(s.charAt(i));
      int l = hexToBin(s.charAt(i + 1));
      if ((h == -1) || (l == -1)) {
        throw new IllegalArgumentException("contains illegal character for hexBinary: " + s);
      }
      out[(i / 2)] = ((byte)(h * 16 + l));
    }
    return out;
  }
  
  private static int hexToBin(char ch)
  {
    if (('0' <= ch) && (ch <= '9')) {
      return ch - '0';
    }
    if (('A' <= ch) && (ch <= 'F')) {
      return ch - 'A' + 10;
    }
    if (('a' <= ch) && (ch <= 'f')) {
      return ch - 'a' + 10;
    }
    return -1;
  }
  
  public String printHexBinary(byte[] data)
  {
    StringBuilder r = new StringBuilder(data.length * 2);
    for (byte b : data)
    {
      r.append(hexCode[(b >> 4 & 0xF)]);
      r.append(hexCode[(b & 0xF)]);
    }
    return r.toString();
  }
  
  public long parseUnsignedInt(String lexicalXSDUnsignedInt)
  {
    return _parseLong(lexicalXSDUnsignedInt);
  }
  
  public String printUnsignedInt(long val)
  {
    return _printLong(val);
  }
  
  public int parseUnsignedShort(String lexicalXSDUnsignedShort)
  {
    return _parseInt(lexicalXSDUnsignedShort);
  }
  
  public Calendar parseTime(String lexicalXSDTime)
  {
    return datatypeFactory.newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar();
  }
  
  public String printTime(Calendar val)
  {
    return CalendarFormatter.doFormat("%h:%m:%s%z", val);
  }
  
  public Calendar parseDate(String lexicalXSDDate)
  {
    return datatypeFactory.newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar();
  }
  
  public String printDate(Calendar val)
  {
    return _printDate(val);
  }
  
  public static String _printDate(Calendar val)
  {
    return CalendarFormatter.doFormat("%Y-%M-%D", val);
  }
  
  public String parseAnySimpleType(String lexicalXSDAnySimpleType)
  {
    return lexicalXSDAnySimpleType;
  }
  
  public String printString(String val)
  {
    return val;
  }
  
  public String printInt(int val)
  {
    return _printInt(val);
  }
  
  public static String _printInt(int val)
  {
    return String.valueOf(val);
  }
  
  public String printLong(long val)
  {
    return _printLong(val);
  }
  
  public static String _printLong(long val)
  {
    return String.valueOf(val);
  }
  
  public String printDecimal(BigDecimal val)
  {
    return _printDecimal(val);
  }
  
  public static String _printDecimal(BigDecimal val)
  {
    return val.toPlainString();
  }
  
  public String printDouble(double v)
  {
    return _printDouble(v);
  }
  
  public static String _printDouble(double v)
  {
    if (Double.isNaN(v)) {
      return "NaN";
    }
    if (v == Double.POSITIVE_INFINITY) {
      return "INF";
    }
    if (v == Double.NEGATIVE_INFINITY) {
      return "-INF";
    }
    return String.valueOf(v);
  }
  
  public String printQName(QName val, NamespaceContext nsc)
  {
    return _printQName(val, nsc);
  }
  
  public static String _printQName(QName val, NamespaceContext nsc)
  {
    String prefix = nsc.getPrefix(val.getNamespaceURI());
    String localPart = val.getLocalPart();
    String qname;
    String qname;
    if ((prefix == null) || (prefix.length() == 0)) {
      qname = localPart;
    } else {
      qname = prefix + ':' + localPart;
    }
    return qname;
  }
  
  public String printBase64Binary(byte[] val)
  {
    return _printBase64Binary(val);
  }
  
  public String printUnsignedShort(int val)
  {
    return String.valueOf(val);
  }
  
  public String printAnySimpleType(String val)
  {
    return val;
  }
  
  public static String installHook(String s)
  {
    DatatypeConverter.setDatatypeConverter(theInstance);
    return s;
  }
  
  private static byte[] initDecodeMap()
  {
    byte[] map = new byte['?'];
    for (int i = 0; i < 128; i++) {
      map[i] = -1;
    }
    for (i = 65; i <= 90; i++) {
      map[i] = ((byte)(i - 65));
    }
    for (i = 97; i <= 122; i++) {
      map[i] = ((byte)(i - 97 + 26));
    }
    for (i = 48; i <= 57; i++) {
      map[i] = ((byte)(i - 48 + 52));
    }
    map[43] = 62;
    map[47] = 63;
    map[61] = Byte.MAX_VALUE;
    
    return map;
  }
  
  private static int guessLength(String text)
  {
    int len = text.length();
    for (int j = len - 1; j >= 0; j--)
    {
      byte code = decodeMap[text.charAt(j)];
      if (code != Byte.MAX_VALUE)
      {
        if (code != -1) {
          break;
        }
        return text.length() / 4 * 3;
      }
    }
    j++;
    int padSize = len - j;
    if (padSize > 2) {
      return text.length() / 4 * 3;
    }
    return text.length() / 4 * 3 - padSize;
  }
  
  public static byte[] _parseBase64Binary(String text)
  {
    int buflen = guessLength(text);
    byte[] out = new byte[buflen];
    int o = 0;
    
    int len = text.length();
    
    byte[] quadruplet = new byte[4];
    int q = 0;
    for (int i = 0; i < len; i++)
    {
      char ch = text.charAt(i);
      byte v = decodeMap[ch];
      if (v != -1) {
        quadruplet[(q++)] = v;
      }
      if (q == 4)
      {
        out[(o++)] = ((byte)(quadruplet[0] << 2 | quadruplet[1] >> 4));
        if (quadruplet[2] != Byte.MAX_VALUE) {
          out[(o++)] = ((byte)(quadruplet[1] << 4 | quadruplet[2] >> 2));
        }
        if (quadruplet[3] != Byte.MAX_VALUE) {
          out[(o++)] = ((byte)(quadruplet[2] << 6 | quadruplet[3]));
        }
        q = 0;
      }
    }
    if (buflen == o) {
      return out;
    }
    byte[] nb = new byte[o];
    System.arraycopy(out, 0, nb, 0, o);
    return nb;
  }
  
  private static char[] initEncodeMap()
  {
    char[] map = new char[64];
    for (int i = 0; i < 26; i++) {
      map[i] = ((char)(65 + i));
    }
    for (i = 26; i < 52; i++) {
      map[i] = ((char)(97 + (i - 26)));
    }
    for (i = 52; i < 62; i++) {
      map[i] = ((char)(48 + (i - 52)));
    }
    map[62] = '+';
    map[63] = '/';
    
    return map;
  }
  
  public static char encode(int i)
  {
    return encodeMap[(i & 0x3F)];
  }
  
  public static byte encodeByte(int i)
  {
    return (byte)encodeMap[(i & 0x3F)];
  }
  
  public static String _printBase64Binary(byte[] input)
  {
    return _printBase64Binary(input, 0, input.length);
  }
  
  public static String _printBase64Binary(byte[] input, int offset, int len)
  {
    char[] buf = new char[(len + 2) / 3 * 4];
    int ptr = _printBase64Binary(input, offset, len, buf, 0);
    assert (ptr == buf.length);
    return new String(buf);
  }
  
  public static int _printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr)
  {
    for (int i = offset; i < len; i += 3) {
      switch (len - i)
      {
      case 1: 
        buf[(ptr++)] = encode(input[i] >> 2);
        buf[(ptr++)] = encode((input[i] & 0x3) << 4);
        buf[(ptr++)] = '=';
        buf[(ptr++)] = '=';
        break;
      case 2: 
        buf[(ptr++)] = encode(input[i] >> 2);
        buf[(ptr++)] = encode((input[i] & 0x3) << 4 | input[(i + 1)] >> 4 & 0xF);
        
        buf[(ptr++)] = encode((input[(i + 1)] & 0xF) << 2);
        buf[(ptr++)] = '=';
        break;
      default: 
        buf[(ptr++)] = encode(input[i] >> 2);
        buf[(ptr++)] = encode((input[i] & 0x3) << 4 | input[(i + 1)] >> 4 & 0xF);
        
        buf[(ptr++)] = encode((input[(i + 1)] & 0xF) << 2 | input[(i + 2)] >> 6 & 0x3);
        
        buf[(ptr++)] = encode(input[(i + 2)] & 0x3F);
      }
    }
    return ptr;
  }
  
  public static int _printBase64Binary(byte[] input, int offset, int len, byte[] out, int ptr)
  {
    byte[] buf = out;
    int max = len + offset;
    for (int i = offset; i < max; i += 3) {
      switch (max - i)
      {
      case 1: 
        buf[(ptr++)] = encodeByte(input[i] >> 2);
        buf[(ptr++)] = encodeByte((input[i] & 0x3) << 4);
        buf[(ptr++)] = 61;
        buf[(ptr++)] = 61;
        break;
      case 2: 
        buf[(ptr++)] = encodeByte(input[i] >> 2);
        buf[(ptr++)] = encodeByte((input[i] & 0x3) << 4 | input[(i + 1)] >> 4 & 0xF);
        
        buf[(ptr++)] = encodeByte((input[(i + 1)] & 0xF) << 2);
        buf[(ptr++)] = 61;
        break;
      default: 
        buf[(ptr++)] = encodeByte(input[i] >> 2);
        buf[(ptr++)] = encodeByte((input[i] & 0x3) << 4 | input[(i + 1)] >> 4 & 0xF);
        
        buf[(ptr++)] = encodeByte((input[(i + 1)] & 0xF) << 2 | input[(i + 2)] >> 6 & 0x3);
        
        buf[(ptr++)] = encodeByte(input[(i + 2)] & 0x3F);
      }
    }
    return ptr;
  }
  
  private static CharSequence removeOptionalPlus(CharSequence s)
  {
    int len = s.length();
    if ((len <= 1) || (s.charAt(0) != '+')) {
      return s;
    }
    s = s.subSequence(1, len);
    char ch = s.charAt(0);
    if (('0' <= ch) && (ch <= '9')) {
      return s;
    }
    if ('.' == ch) {
      return s;
    }
    throw new NumberFormatException();
  }
  
  private static boolean isDigitOrPeriodOrSign(char ch)
  {
    if (('0' <= ch) && (ch <= '9')) {
      return true;
    }
    if ((ch == '+') || (ch == '-') || (ch == '.')) {
      return true;
    }
    return false;
  }
  
  static
  {
    theInstance = new DatatypeConverterImpl();
    
    hexCode = "0123456789ABCDEF".toCharArray();
    
    decodeMap = initDecodeMap();
    
    encodeMap = initEncodeMap();
    try
    {
      datatypeFactory = DatatypeFactory.newInstance();
    }
    catch (DatatypeConfigurationException e)
    {
      throw new Error(e);
    }
  }
  
  private static final class CalendarFormatter
  {
    public static String doFormat(String format, Calendar cal)
      throws IllegalArgumentException
    {
      int fidx = 0;
      int flen = format.length();
      StringBuilder buf = new StringBuilder();
      while (fidx < flen)
      {
        char fch = format.charAt(fidx++);
        if (fch != '%') {
          buf.append(fch);
        } else {
          switch (format.charAt(fidx++))
          {
          case 'Y': 
            formatYear(cal, buf);
            break;
          case 'M': 
            formatMonth(cal, buf);
            break;
          case 'D': 
            formatDays(cal, buf);
            break;
          case 'h': 
            formatHours(cal, buf);
            break;
          case 'm': 
            formatMinutes(cal, buf);
            break;
          case 's': 
            formatSeconds(cal, buf);
            break;
          case 'z': 
            formatTimeZone(cal, buf);
            break;
          default: 
            throw new InternalError();
          }
        }
      }
      return buf.toString();
    }
    
    private static void formatYear(Calendar cal, StringBuilder buf)
    {
      int year = cal.get(1);
      String s;
      String s;
      if (year <= 0) {
        s = Integer.toString(1 - year);
      } else {
        s = Integer.toString(year);
      }
      while (s.length() < 4) {
        s = '0' + s;
      }
      if (year <= 0) {
        s = '-' + s;
      }
      buf.append(s);
    }
    
    private static void formatMonth(Calendar cal, StringBuilder buf)
    {
      formatTwoDigits(cal.get(2) + 1, buf);
    }
    
    private static void formatDays(Calendar cal, StringBuilder buf)
    {
      formatTwoDigits(cal.get(5), buf);
    }
    
    private static void formatHours(Calendar cal, StringBuilder buf)
    {
      formatTwoDigits(cal.get(11), buf);
    }
    
    private static void formatMinutes(Calendar cal, StringBuilder buf)
    {
      formatTwoDigits(cal.get(12), buf);
    }
    
    private static void formatSeconds(Calendar cal, StringBuilder buf)
    {
      formatTwoDigits(cal.get(13), buf);
      if (cal.isSet(14))
      {
        int n = cal.get(14);
        if (n != 0)
        {
          String ms = Integer.toString(n);
          while (ms.length() < 3) {
            ms = '0' + ms;
          }
          buf.append('.');
          buf.append(ms);
        }
      }
    }
    
    private static void formatTimeZone(Calendar cal, StringBuilder buf)
    {
      TimeZone tz = cal.getTimeZone();
      if (tz == null) {
        return;
      }
      int offset = tz.getOffset(cal.getTime().getTime());
      if (offset == 0)
      {
        buf.append('Z');
        return;
      }
      if (offset >= 0)
      {
        buf.append('+');
      }
      else
      {
        buf.append('-');
        offset *= -1;
      }
      offset /= 60000;
      
      formatTwoDigits(offset / 60, buf);
      buf.append(':');
      formatTwoDigits(offset % 60, buf);
    }
    
    private static void formatTwoDigits(int n, StringBuilder buf)
    {
      if (n < 10) {
        buf.append('0');
      }
      buf.append(n);
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.DatatypeConverterImpl
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import java.util.concurrent.Callable;
import javax.xml.bind.ValidationEventHandler;
import org.xml.sax.SAXException;

public abstract class IDResolver
{
  public void startDocument(ValidationEventHandler eventHandler)
    throws SAXException
  {}
  
  public void endDocument()
    throws SAXException
  {}
  
  public abstract void bind(String paramString, Object paramObject)
    throws SAXException;
  
  public abstract Callable<?> resolve(String paramString, Class paramClass)
    throws SAXException;
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.IDResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import org.xml.sax.Locator;

public abstract interface Locatable
{
  public abstract Locator sourceLocation();
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.Locatable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import java.util.logging.Logger;

public abstract class Util
{
  public static Logger getClassLogger()
  {
    try
    {
      StackTraceElement[] trace = new Exception().getStackTrace();
      return Logger.getLogger(trace[1].getClassName());
    }
    catch (SecurityException _) {}
    return Logger.getLogger("com.sun.xml.bind");
  }
  
  public static String getSystemProperty(String name)
  {
    try
    {
      return System.getProperty(name);
    }
    catch (SecurityException e) {}
    return null;
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.Util
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import javax.xml.bind.ValidationEventLocator;

public abstract interface ValidationEventLocatorEx
  extends ValidationEventLocator
{
  public abstract String getFieldName();
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.ValidationEventLocatorEx
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

public abstract class WhiteSpaceProcessor
{
  public static String replace(String text)
  {
    return replace(text).toString();
  }
  
  public static CharSequence replace(CharSequence text)
  {
    int i = text.length() - 1;
    while ((i >= 0) && (!isWhiteSpaceExceptSpace(text.charAt(i)))) {
      i--;
    }
    if (i < 0) {
      return text;
    }
    StringBuilder buf = new StringBuilder(text);
    
    buf.setCharAt(i--, ' ');
    for (; i >= 0; i--) {
      if (isWhiteSpaceExceptSpace(buf.charAt(i))) {
        buf.setCharAt(i, ' ');
      }
    }
    return new String(buf);
  }
  
  public static CharSequence trim(CharSequence text)
  {
    int len = text.length();
    int start = 0;
    while ((start < len) && (isWhiteSpace(text.charAt(start)))) {
      start++;
    }
    int end = len - 1;
    while ((end > start) && (isWhiteSpace(text.charAt(end)))) {
      end--;
    }
    if ((start == 0) && (end == len - 1)) {
      return text;
    }
    return text.subSequence(start, end + 1);
  }
  
  public static String collapse(String text)
  {
    return collapse(text).toString();
  }
  
  public static CharSequence collapse(CharSequence text)
  {
    int len = text.length();
    
    int s = 0;
    while ((s < len) && 
      (!isWhiteSpace(text.charAt(s)))) {
      s++;
    }
    if (s == len) {
      return text;
    }
    StringBuilder result = new StringBuilder(len);
    if (s != 0)
    {
      for (int i = 0; i < s; i++) {
        result.append(text.charAt(i));
      }
      result.append(' ');
    }
    boolean inStripMode = true;
    for (int i = s + 1; i < len; i++)
    {
      char ch = text.charAt(i);
      boolean b = isWhiteSpace(ch);
      if ((!inStripMode) || (!b))
      {
        inStripMode = b;
        if (inStripMode) {
          result.append(' ');
        } else {
          result.append(ch);
        }
      }
    }
    len = result.length();
    if ((len > 0) && (result.charAt(len - 1) == ' ')) {
      result.setLength(len - 1);
    }
    return result;
  }
  
  public static final boolean isWhiteSpace(CharSequence s)
  {
    for (int i = s.length() - 1; i >= 0; i--) {
      if (!isWhiteSpace(s.charAt(i))) {
        return false;
      }
    }
    return true;
  }
  
  public static final boolean isWhiteSpace(char ch)
  {
    if (ch > ' ') {
      return false;
    }
    return (ch == '\t') || (ch == '\n') || (ch == '\r') || (ch == ' ');
  }
  
  protected static final boolean isWhiteSpaceExceptSpace(char ch)
  {
    if (ch >= ' ') {
      return false;
    }
    return (ch == '\t') || (ch == '\n') || (ch == '\r');
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.WhiteSpaceProcessor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PACKAGE})
public @interface XmlAccessorFactory
{
  Class<? extends AccessorFactory> value();
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.XmlAccessorFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind.annotation;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.FIELD})
public @interface OverrideAnnotationOf
{
  String value() default "content";
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.annotation.OverrideAnnotationOf
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind.annotation;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @deprecated
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD})
public @interface XmlIsSet
{
  String value();
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.annotation.XmlIsSet
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind.annotation;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD})
public @interface XmlLocation {}

/* Location:
 * Qualified Name:     com.sun.xml.bind.annotation.XmlLocation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind.api;

public final class AccessorException
  extends Exception
{
  public AccessorException() {}
  
  public AccessorException(String message)
  {
    super(message);
  }
  
  public AccessorException(String message, Throwable cause)
  {
    super(message, cause);
  }
  
  public AccessorException(Throwable cause)
  {
    super(cause);
  }
}

/* Location:
 * Qualified Name:     com.sun.xml.bind.api.AccessorException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.xml.bind.api;

import com.sun.istack.NotNull;
import com.sun.istack.Nullable;
import com.sun.istack.Pool;
import com.sun.xml.bind.v2.runtime.BridgeContextImpl;
import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
import java.io.InputStream;
import java.io.OutputStream;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.attachment.AttachmentMarshaller;
import javax.xml.bind.attachment.AttachmentUnmarshaller;
import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import org.w3c.dom.Node;
import org.xml.sax.ContentHandler;

public abstract class Bridge<T>
{
  protected final JAXBContextImpl context;
  
  protected Bridge(JAXBContextImpl context)
  {
    this.context = context;
  }
  
  @NotNull
  public JAXBRIContext getContext()
  {
    return context;
  }
  
  public final void marshal(T object, XMLStreamWriter output)
    throws JAXBException
  {
    marshal(object, output, null);
  }
  
  public final void marshal(T object, XMLStreamWriter output, AttachmentMarshaller am)
    throws JAXBException
  {
    Marshaller m = (Marshaller)context.marshallerPool.take();
    m.setAttachmentMarshaller(am);
    marshal(m, object, output);
    m.setAttachmentMarshaller(null);
    context.marshallerPool.recycle(m);
  }
  
  public final void marshal(@NotNull BridgeContext context, T object, XMLStreamWriter output)
    throws JAXBException
  {
    marshal(marshaller, object, output);
  }
  
  public abstract void marshal(@NotNull Marshaller paramMarshaller, T paramT, XMLStreamWriter paramXMLStreamWriter)
    throws JAXBException;
  
  public void marshal(T object, OutputStream output, NamespaceContext nsContext)
    throws JAXBException
  {
    marshal(object, output, nsContext, null);
  }
  
  public void marshal(T object, OutputStream output, NamespaceContext nsContext, AttachmentMarshaller am)
    throws JAXBException
  {
    Marshaller m = (Marshaller)context.marshallerPool.take();
    m.setAttachmentMarshaller(am);
    marshal(m, object, output, nsContext);
    m.setAttachmentMarshaller(null);
    context.marshallerPool.recycle(m);
  }
  
  public final void marshal(@NotNull BridgeContext context, T object, OutputStream output, NamespaceContext nsContext)
    throws JAXBException
  {
    marshal(marshaller, object, output, nsContext);
  }
  
  public abstract void marshal(@NotNull Marshaller paramMarshaller, T paramT, OutputStream paramOutputStream, NamespaceContext paramNamespaceContext)
    throws JAXBException;
  
  public final void marshal(T object, Node output)
    throws JAXBException
  {
    Marshaller m = (Marshaller)context.marshallerPool.take();
    marshal(m, object, output);
    context.marshallerPool.recycle(m);
  }
  
  public final void marshal(@NotNull BridgeContext context, T object, Node output)
    throws JAXBException
  {
    marshal(marshaller, object, output);
  }
  
  public abstract void marshal(@NotNull Marshaller paramMarshaller, T paramT, Node paramNode)
    throws JAXBException;
  
  public final void marshal(T object, ContentHandler contentHandler)
    throws JAXBException
  {
    marshal(object, contentHandler, null);
  }
  
  public final void marshal(T object, ContentHandler contentHandler, AttachmentMarshaller am)
    throws JAXBException
  {
    Marshaller m = (Marshaller)context.marshallerPool.take();
    m.setAttachmentMarshaller(am);
    marshal(m, object, contentHandler);
    m.setAttachmentMarshaller(null);
    context.marshallerPool.recycle(m);
  }
  
  public final void marshal(@NotNull BridgeContext context, T object, ContentHandler contentHandler)
    throws JAXBException
  {
    marshal(marshaller, object, contentHandler);
  }
  
  public abstract void marshal(@NotNull Marshaller paramMarshaller, T paramT, ContentHandler paramContentHandler)
    throws JAXBException;
  
  public final void marshal(T object, Result result)
    throws JAXBException
  {
    Marshaller m = (Marshaller)context.marshallerPool.take();
    marshal(m, object, result);
    context.marshallerPool.recycle(m);
  }
  
  public final void marshal(@NotNull BridgeContext context, T object, Result result)
    throws JAXBException
  {
    marshal(marshaller, object, result);
  }
  
  public abstract void marshal(@NotNull Marshaller paramMarshaller, T paramT, Result paramResult)
    throws JAXBException;
  
  private T exit(T r, Unmarshaller u)
  {
    u.setAtta
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

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-2017. Infinite Loop Ltd