org.apache.xml.serializer_2.7.1.v201005080400

16:41:18.211 INFO  jd.cli.Main - Decompiling org.apache.xml.serializer_2.7.1.v201005080400.jar
package org.apache.xml.serializer;

import java.util.Hashtable;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;

public final class AttributesImplSerializer
  extends AttributesImpl
{
  private final Hashtable m_indexFromQName = new Hashtable();
  private final StringBuffer m_buff = new StringBuffer();
  private static final int MAX = 12;
  private static final int MAXMinus1 = 11;
  
  public final int getIndex(String qname)
  {
    int index;
    if (super.getLength() < 12)
    {
      index = super.getIndex(qname);
      return index;
    }
    Integer i = (Integer)m_indexFromQName.get(qname);
    if (i == null) {
      index = -1;
    } else {
      index = i.intValue();
    }
    return index;
  }
  
  public final void addAttribute(String uri, String local, String qname, String type, String val)
  {
    int index = super.getLength();
    super.addAttribute(uri, local, qname, type, val);
    if (index < 11) {
      return;
    }
    if (index == 11)
    {
      switchOverToHash(12);
    }
    else
    {
      Integer i = new Integer(index);
      m_indexFromQName.put(qname, i);
      
      m_buff.setLength(0);
      m_buff.append('{').append(uri).append('}').append(local);
      String key = m_buff.toString();
      m_indexFromQName.put(key, i);
    }
  }
  
  private void switchOverToHash(int numAtts)
  {
    for (int index = 0; index < numAtts; index++)
    {
      String qName = super.getQName(index);
      Integer i = new Integer(index);
      m_indexFromQName.put(qName, i);
      
      String uri = super.getURI(index);
      String local = super.getLocalName(index);
      m_buff.setLength(0);
      m_buff.append('{').append(uri).append('}').append(local);
      String key = m_buff.toString();
      m_indexFromQName.put(key, i);
    }
  }
  
  public final void clear()
  {
    int len = super.getLength();
    super.clear();
    if (12 <= len) {
      m_indexFromQName.clear();
    }
  }
  
  public final void setAttributes(Attributes atts)
  {
    super.setAttributes(atts);
    
    int numAtts = atts.getLength();
    if (12 <= numAtts) {
      switchOverToHash(numAtts);
    }
  }
  
  public final int getIndex(String uri, String localName)
  {
    int index;
    if (super.getLength() < 12)
    {
      index = super.getIndex(uri, localName);
      return index;
    }
    m_buff.setLength(0);
    m_buff.append('{').append(uri).append('}').append(localName);
    String key = m_buff.toString();
    Integer i = (Integer)m_indexFromQName.get(key);
    if (i == null) {
      index = -1;
    } else {
      index = i.intValue();
    }
    return index;
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.AttributesImplSerializer
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

import java.security.PrivilegedAction;

class CharInfo$1
  implements PrivilegedAction
{
  private final String val$entitiesFileName;
  private final String val$method;
  private final boolean val$internal;
  
  CharInfo$1(String val$entitiesFileName, String val$method, boolean val$internal)
  {
    this.val$entitiesFileName = val$entitiesFileName;this.val$method = val$method;this.val$internal = val$internal;
  }
  
  public Object run()
  {
    return new CharInfo(val$entitiesFileName, val$method, val$internal, null);
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.CharInfo.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

class CharInfo$CharKey
{
  private char m_char;
  
  public CharInfo$CharKey(char key)
  {
    m_char = key;
  }
  
  public CharInfo$CharKey() {}
  
  public final void setChar(char c)
  {
    m_char = c;
  }
  
  public final int hashCode()
  {
    return m_char;
  }
  
  public final boolean equals(Object obj)
  {
    return m_char == m_char;
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.CharInfo.CharKey
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.ResourceBundle;
import javax.xml.transform.TransformerException;
import org.apache.xml.serializer.utils.Messages;
import org.apache.xml.serializer.utils.SystemIDResolver;
import org.apache.xml.serializer.utils.Utils;
import org.apache.xml.serializer.utils.WrappedRuntimeException;

final class CharInfo
{
  private HashMap m_charToString;
  
  CharInfo(String x0, String x1, boolean x2, 1 x3)
  {
    this(x0, x1, x2);
  }
  
  public static final String HTML_ENTITIES_RESOURCE = SerializerBase.PKG_NAME + ".HTMLEntities";
  public static final String XML_ENTITIES_RESOURCE = SerializerBase.PKG_NAME + ".XMLEntities";
  static final char S_HORIZONAL_TAB = '\t';
  static final char S_LINEFEED = '\n';
  static final char S_CARRIAGERETURN = '\r';
  static final char S_SPACE = ' ';
  static final char S_QUOTE = '"';
  static final char S_LT = '<';
  static final char S_GT = '>';
  static final char S_NEL = '?';
  static final char S_LINE_SEPARATOR = '?';
  boolean onlyQuotAmpLtGt;
  static final int ASCII_MAX = 128;
  private final boolean[] shouldMapAttrChar_ASCII;
  private final boolean[] shouldMapTextChar_ASCII;
  private final int[] array_of_bits;
  private static final int SHIFT_PER_WORD = 5;
  private static final int LOW_ORDER_BITMASK = 31;
  private int firstWordNotUsed;
  private final CharKey m_charKey;
  
  private CharInfo()
  {
    array_of_bits = createEmptySetOfIntegers(65535);
    firstWordNotUsed = 0;
    shouldMapAttrChar_ASCII = new boolean['?'];
    shouldMapTextChar_ASCII = new boolean['?'];
    m_charKey = new CharKey();
    
    onlyQuotAmpLtGt = true;
  }
  
  private CharInfo(String entitiesResource, String method, boolean internal)
  {
    this();
    m_charToString = new HashMap();
    
    ResourceBundle entities = null;
    boolean noExtraEntities = true;
    if (internal) {
      try
      {
        entities = ResourceBundle.getBundle(entitiesResource);
      }
      catch (Exception e) {}
    }
    if (entities != null)
    {
      Enumeration keys = entities.getKeys();
      while (keys.hasMoreElements())
      {
        String name = (String)keys.nextElement();
        String value = entities.getString(name);
        int code = Integer.parseInt(value);
        boolean extra = defineEntity(name, (char)code);
        if (extra) {
          noExtraEntities = false;
        }
      }
    }
    else
    {
      InputStream is = null;
      try
      {
        if (internal)
        {
          is = CharInfo.class.getResourceAsStream(entitiesResource);
        }
        else
        {
          ClassLoader cl = ObjectFactory.findClassLoader();
          if (cl == null) {
            is = ClassLoader.getSystemResourceAsStream(entitiesResource);
          } else {
            is = cl.getResourceAsStream(entitiesResource);
          }
          if (is == null) {
            try
            {
              URL url = new URL(entitiesResource);
              is = url.openStream();
            }
            catch (Exception e) {}
          }
        }
        if (is == null) {
          throw new RuntimeException(Utils.messages.createMessage("ER_RESOURCE_COULD_NOT_FIND", new Object[] { entitiesResource, entitiesResource }));
        }
        BufferedReader reader;
        try
        {
          reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        }
        catch (UnsupportedEncodingException e)
        {
          reader = new BufferedReader(new InputStreamReader(is));
        }
        String line = reader.readLine();
        while (line != null) {
          if ((line.length() == 0) || (line.charAt(0) == '#'))
          {
            line = reader.readLine();
          }
          else
          {
            int index = line.indexOf(' ');
            if (index > 1)
            {
              String name = line.substring(0, index);
              
              index++;
              if (index < line.length())
              {
                String value = line.substring(index);
                index = value.indexOf(' ');
                if (index > 0) {
                  value = value.substring(0, index);
                }
                int code = Integer.parseInt(value);
                
                boolean extra = defineEntity(name, (char)code);
                if (extra) {
                  noExtraEntities = false;
                }
              }
            }
            line = reader.readLine();
          }
        }
        is.close();
      }
      catch (Exception e)
      {
        throw new RuntimeException(Utils.messages.createMessage("ER_RESOURCE_COULD_NOT_LOAD", new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString() }));
      }
      finally
      {
        if (is != null) {
          try
          {
            is.close();
          }
          catch (Exception except) {}
        }
      }
    }
    onlyQuotAmpLtGt = noExtraEntities;
    if ("xml".equals(method)) {
      shouldMapTextChar_ASCII[34] = false;
    }
    if ("html".equals(method))
    {
      shouldMapAttrChar_ASCII[60] = false;
      
      shouldMapTextChar_ASCII[34] = false;
    }
  }
  
  private boolean defineEntity(String name, char value)
  {
    StringBuffer sb = new StringBuffer("&");
    sb.append(name);
    sb.append(';');
    String entityString = sb.toString();
    
    boolean extra = defineChar2StringMapping(entityString, value);
    return extra;
  }
  
  String getOutputStringForChar(char value)
  {
    m_charKey.setChar(value);
    return (String)m_charToString.get(m_charKey);
  }
  
  final boolean shouldMapAttrChar(int value)
  {
    if (value < 128) {
      return shouldMapAttrChar_ASCII[value];
    }
    return get(value);
  }
  
  final boolean shouldMapTextChar(int value)
  {
    if (value < 128) {
      return shouldMapTextChar_ASCII[value];
    }
    return get(value);
  }
  
  private static CharInfo getCharInfoBasedOnPrivilege(String entitiesFileName, String method, boolean internal)
  {
    (CharInfo)AccessController.doPrivileged(new PrivilegedAction()
    {
      private final String val$entitiesFileName;
      private final String val$method;
      private final boolean val$internal;
      
      public Object run()
      {
        return new CharInfo(val$entitiesFileName, val$method, val$internal, null);
      }
    });
  }
  
  static CharInfo getCharInfo(String entitiesFileName, String method)
  {
    CharInfo charInfo = (CharInfo)m_getCharInfoCache.get(entitiesFileName);
    if (charInfo != null) {
      return mutableCopyOf(charInfo);
    }
    try
    {
      charInfo = getCharInfoBasedOnPrivilege(entitiesFileName, method, true);
      
      m_getCharInfoCache.put(entitiesFileName, charInfo);
      return mutableCopyOf(charInfo);
    }
    catch (Exception e)
    {
      try
      {
        return getCharInfoBasedOnPrivilege(entitiesFileName, method, false);
      }
      catch (Exception e)
      {
        String absoluteEntitiesFileName;
        if (entitiesFileName.indexOf(':') < 0) {
          absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
        } else {
          try
          {
            absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
          }
          catch (TransformerException te)
          {
            throw new WrappedRuntimeException(te);
          }
        }
      }
    }
    return getCharInfoBasedOnPrivilege(entitiesFileName, method, false);
  }
  
  private static CharInfo mutableCopyOf(CharInfo charInfo)
  {
    CharInfo copy = new CharInfo();
    
    int max = array_of_bits.length;
    System.arraycopy(array_of_bits, 0, array_of_bits, 0, max);
    
    firstWordNotUsed = firstWordNotUsed;
    
    max = shouldMapAttrChar_ASCII.length;
    System.arraycopy(shouldMapAttrChar_ASCII, 0, shouldMapAttrChar_ASCII, 0, max);
    
    max = shouldMapTextChar_ASCII.length;
    System.arraycopy(shouldMapTextChar_ASCII, 0, shouldMapTextChar_ASCII, 0, max);
    
    m_charToString = ((HashMap)m_charToString.clone());
    
    onlyQuotAmpLtGt = onlyQuotAmpLtGt;
    
    return copy;
  }
  
  private static Hashtable m_getCharInfoCache = new Hashtable();
  
  private static int arrayIndex(int i)
  {
    return i >> 5;
  }
  
  private static int bit(int i)
  {
    int ret = 1 << (i & 0x1F);
    return ret;
  }
  
  private int[] createEmptySetOfIntegers(int max)
  {
    firstWordNotUsed = 0;
    
    int[] arr = new int[arrayIndex(max - 1) + 1];
    return arr;
  }
  
  private final void set(int i)
  {
    setASCIItextDirty(i);
    setASCIIattrDirty(i);
    
    int j = i >> 5;
    int k = j + 1;
    if (firstWordNotUsed < k) {
      firstWordNotUsed = k;
    }
    array_of_bits[j] |= 1 << (i & 0x1F);
  }
  
  private final boolean get(int i)
  {
    boolean in_the_set = false;
    int j = i >> 5;
    if (j < firstWordNotUsed) {
      in_the_set = (array_of_bits[j] & 1 << (i & 0x1F)) != 0;
    }
    return in_the_set;
  }
  
  private boolean extraEntity(String outputString, int charToMap)
  {
    boolean extra = false;
    if (charToMap < 128) {
      switch (charToMap)
      {
      case 34: 
        if (!outputString.equals("&quot;")) {
          extra = true;
        }
        break;
      case 38: 
        if (!outputString.equals("&amp;")) {
          extra = true;
        }
        break;
      case 60: 
        if (!outputString.equals("&lt;")) {
          extra = true;
        }
        break;
      case 62: 
        if (!outputString.equals("&gt;")) {
          extra = true;
        }
        break;
      default: 
        extra = true;
      }
    }
    return extra;
  }
  
  private void setASCIItextDirty(int j)
  {
    if ((0 <= j) && (j < 128)) {
      shouldMapTextChar_ASCII[j] = true;
    }
  }
  
  private void setASCIIattrDirty(int j)
  {
    if ((0 <= j) && (j < 128)) {
      shouldMapAttrChar_ASCII[j] = true;
    }
  }
  
  boolean defineChar2StringMapping(String outputString, char inputChar)
  {
    CharKey character = new CharKey(inputChar);
    m_charToString.put(character, outputString);
    set(inputChar);
    
    boolean extraMapping = extraEntity(outputString, inputChar);
    return extraMapping;
  }
  
  private static class CharKey
  {
    private char m_char;
    
    public CharKey(char key)
    {
      m_char = key;
    }
    
    public CharKey() {}
    
    public final void setChar(char c)
    {
      m_char = c;
    }
    
    public final int hashCode()
    {
      return m_char;
    }
    
    public final boolean equals(Object obj)
    {
      return m_char == m_char;
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.CharInfo
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

import java.io.IOException;
import org.w3c.dom.DOMErrorHandler;
import org.w3c.dom.Node;
import org.w3c.dom.ls.LSSerializerFilter;

public abstract interface DOM3Serializer
{
  public abstract void serializeDOM3(Node paramNode)
    throws IOException;
  
  public abstract void setErrorHandler(DOMErrorHandler paramDOMErrorHandler);
  
  public abstract DOMErrorHandler getErrorHandler();
  
  public abstract void setNodeFilter(LSSerializerFilter paramLSSerializerFilter);
  
  public abstract LSSerializerFilter getNodeFilter();
  
  public abstract void setNewLine(char[] paramArrayOfChar);
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.DOM3Serializer
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

import java.io.IOException;
import org.w3c.dom.Node;

public abstract interface DOMSerializer
{
  public abstract void serialize(Node paramNode)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.DOMSerializer
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

final class ElemContext
{
  final int m_currentElemDepth;
  ElemDesc m_elementDesc = null;
  String m_elementLocalName = null;
  String m_elementName = null;
  String m_elementURI = null;
  boolean m_isCdataSection;
  boolean m_isRaw = false;
  private ElemContext m_next;
  final ElemContext m_prev;
  boolean m_startTagOpen = false;
  
  ElemContext()
  {
    m_prev = this;
    
    m_currentElemDepth = 0;
  }
  
  private ElemContext(ElemContext previous)
  {
    m_prev = previous;
    m_currentElemDepth += 1;
  }
  
  final ElemContext pop()
  {
    return m_prev;
  }
  
  final ElemContext push()
  {
    ElemContext frame = m_next;
    if (frame == null)
    {
      frame = new ElemContext(this);
      m_next = frame;
    }
    m_startTagOpen = true;
    return frame;
  }
  
  final ElemContext push(String uri, String localName, String qName)
  {
    ElemContext frame = m_next;
    if (frame == null)
    {
      frame = new ElemContext(this);
      m_next = frame;
    }
    m_elementName = qName;
    m_elementLocalName = localName;
    m_elementURI = uri;
    m_isCdataSection = false;
    m_startTagOpen = true;
    
    return frame;
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.ElemContext
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

import org.apache.xml.serializer.utils.StringToIntTable;

public final class ElemDesc
{
  private int m_flags;
  private StringToIntTable m_attrs = null;
  static final int EMPTY = 2;
  private static final int FLOW = 4;
  static final int BLOCK = 8;
  static final int BLOCKFORM = 16;
  static final int BLOCKFORMFIELDSET = 32;
  private static final int CDATA = 64;
  private static final int PCDATA = 128;
  static final int RAW = 256;
  private static final int INLINE = 512;
  private static final int INLINEA = 1024;
  static final int INLINELABEL = 2048;
  static final int FONTSTYLE = 4096;
  static final int PHRASE = 8192;
  static final int FORMCTRL = 16384;
  static final int SPECIAL = 32768;
  static final int ASPECIAL = 65536;
  static final int HEADMISC = 131072;
  static final int HEAD = 262144;
  static final int LIST = 524288;
  static final int PREFORMATTED = 1048576;
  static final int WHITESPACESENSITIVE = 2097152;
  static final int HEADELEM = 4194304;
  static final int HTMLELEM = 8388608;
  public static final int ATTRURL = 2;
  public static final int ATTREMPTY = 4;
  
  ElemDesc(int flags)
  {
    m_flags = flags;
  }
  
  private boolean is(int flags)
  {
    return (m_flags & flags) != 0;
  }
  
  int getFlags()
  {
    return m_flags;
  }
  
  void setAttr(String name, int flags)
  {
    if (null == m_attrs) {
      m_attrs = new StringToIntTable();
    }
    m_attrs.put(name, flags);
  }
  
  public boolean isAttrFlagSet(String name, int flags)
  {
    return (m_attrs.getIgnoreCase(name) & flags) != 0;
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.ElemDesc
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import java.util.Hashtable;
import java.util.Properties;
import java.util.Vector;
import javax.xml.transform.SourceLocator;
import javax.xml.transform.Transformer;
import org.w3c.dom.Node;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class EmptySerializer
  implements SerializationHandler
{
  protected static final String ERR = "EmptySerializer method not over-ridden";
  
  protected void couldThrowIOException()
    throws IOException
  {}
  
  protected void couldThrowSAXException()
    throws SAXException
  {}
  
  protected void couldThrowSAXException(char[] chars, int off, int len)
    throws SAXException
  {}
  
  protected void couldThrowSAXException(String elemQName)
    throws SAXException
  {}
  
  protected void couldThrowException()
    throws Exception
  {}
  
  void aMethodIsCalled() {}
  
  public ContentHandler asContentHandler()
    throws IOException
  {
    couldThrowIOException();
    return null;
  }
  
  public void setContentHandler(ContentHandler ch)
  {
    aMethodIsCalled();
  }
  
  public void close()
  {
    aMethodIsCalled();
  }
  
  public Properties getOutputFormat()
  {
    aMethodIsCalled();
    return null;
  }
  
  public OutputStream getOutputStream()
  {
    aMethodIsCalled();
    return null;
  }
  
  public Writer getWriter()
  {
    aMethodIsCalled();
    return null;
  }
  
  public boolean reset()
  {
    aMethodIsCalled();
    return false;
  }
  
  public void serialize(Node node)
    throws IOException
  {
    couldThrowIOException();
  }
  
  public void setCdataSectionElements(Vector URI_and_localNames)
  {
    aMethodIsCalled();
  }
  
  public boolean setEscaping(boolean escape)
    throws SAXException
  {
    couldThrowSAXException();
    return false;
  }
  
  public void setIndent(boolean indent)
  {
    aMethodIsCalled();
  }
  
  public void setIndentAmount(int spaces)
  {
    aMethodIsCalled();
  }
  
  public void setOutputFormat(Properties format)
  {
    aMethodIsCalled();
  }
  
  public void setOutputStream(OutputStream output)
  {
    aMethodIsCalled();
  }
  
  public void setVersion(String version)
  {
    aMethodIsCalled();
  }
  
  public void setWriter(Writer writer)
  {
    aMethodIsCalled();
  }
  
  public void setTransformer(Transformer transformer)
  {
    aMethodIsCalled();
  }
  
  public Transformer getTransformer()
  {
    aMethodIsCalled();
    return null;
  }
  
  public void flushPending()
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void addAttributes(Attributes atts)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void addAttribute(String name, String value)
  {
    aMethodIsCalled();
  }
  
  public void characters(String chars)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void endElement(String elemName)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startDocument()
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startElement(String uri, String localName, String qName)
    throws SAXException
  {
    couldThrowSAXException(qName);
  }
  
  public void startElement(String qName)
    throws SAXException
  {
    couldThrowSAXException(qName);
  }
  
  public void namespaceAfterStartElement(String uri, String prefix)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush)
    throws SAXException
  {
    couldThrowSAXException();
    return false;
  }
  
  public void entityReference(String entityName)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public NamespaceMappings getNamespaceMappings()
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getPrefix(String uri)
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getNamespaceURI(String name, boolean isElement)
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getNamespaceURIFromPrefix(String prefix)
  {
    aMethodIsCalled();
    return null;
  }
  
  public void setDocumentLocator(Locator arg0)
  {
    aMethodIsCalled();
  }
  
  public void endDocument()
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startPrefixMapping(String arg0, String arg1)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void endPrefixMapping(String arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startElement(String arg0, String arg1, String arg2, Attributes arg3)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void endElement(String arg0, String arg1, String arg2)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void characters(char[] arg0, int arg1, int arg2)
    throws SAXException
  {
    couldThrowSAXException(arg0, arg1, arg2);
  }
  
  public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void processingInstruction(String arg0, String arg1)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void skippedEntity(String arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void comment(String comment)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startDTD(String arg0, String arg1, String arg2)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void endDTD()
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startEntity(String arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void endEntity(String arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void startCDATA()
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void endCDATA()
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void comment(char[] arg0, int arg1, int arg2)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public String getDoctypePublic()
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getDoctypeSystem()
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getEncoding()
  {
    aMethodIsCalled();
    return null;
  }
  
  public boolean getIndent()
  {
    aMethodIsCalled();
    return false;
  }
  
  public int getIndentAmount()
  {
    aMethodIsCalled();
    return 0;
  }
  
  public String getMediaType()
  {
    aMethodIsCalled();
    return null;
  }
  
  public boolean getOmitXMLDeclaration()
  {
    aMethodIsCalled();
    return false;
  }
  
  public String getStandalone()
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getVersion()
  {
    aMethodIsCalled();
    return null;
  }
  
  public void setCdataSectionElements(Hashtable h)
    throws Exception
  {
    couldThrowException();
  }
  
  public void setDoctype(String system, String pub)
  {
    aMethodIsCalled();
  }
  
  public void setDoctypePublic(String doctype)
  {
    aMethodIsCalled();
  }
  
  public void setDoctypeSystem(String doctype)
  {
    aMethodIsCalled();
  }
  
  public void setEncoding(String encoding)
  {
    aMethodIsCalled();
  }
  
  public void setMediaType(String mediatype)
  {
    aMethodIsCalled();
  }
  
  public void setOmitXMLDeclaration(boolean b)
  {
    aMethodIsCalled();
  }
  
  public void setStandalone(String standalone)
  {
    aMethodIsCalled();
  }
  
  public void elementDecl(String arg0, String arg1)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void internalEntityDecl(String arg0, String arg1)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void externalEntityDecl(String arg0, String arg1, String arg2)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void warning(SAXParseException arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void error(SAXParseException arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void fatalError(SAXParseException arg0)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public DOMSerializer asDOMSerializer()
    throws IOException
  {
    couldThrowIOException();
    return null;
  }
  
  public void setNamespaceMappings(NamespaceMappings mappings)
  {
    aMethodIsCalled();
  }
  
  public void setSourceLocator(SourceLocator locator)
  {
    aMethodIsCalled();
  }
  
  public void addUniqueAttribute(String name, String value, int flags)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void characters(Node node)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void addXSLAttribute(String qName, String value, String uri)
  {
    aMethodIsCalled();
  }
  
  public void addAttribute(String uri, String localName, String rawName, String type, String value)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void notationDecl(String arg0, String arg1, String arg2)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3)
    throws SAXException
  {
    couldThrowSAXException();
  }
  
  public void setDTDEntityExpansion(boolean expand)
  {
    aMethodIsCalled();
  }
  
  public String getOutputProperty(String name)
  {
    aMethodIsCalled();
    return null;
  }
  
  public String getOutputPropertyDefault(String name)
  {
    aMethodIsCalled();
    return null;
  }
  
  public void setOutputProperty(String name, String val)
  {
    aMethodIsCalled();
  }
  
  public void setOutputPropertyDefault(String name, String val)
  {
    aMethodIsCalled();
  }
  
  public Object asDOM3Serializer()
    throws IOException
  {
    couldThrowIOException();
    return null;
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.EmptySerializer
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

class EncodingInfo$1 {}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.EncodingInfo.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

class EncodingInfo$EncodingImpl
  implements EncodingInfo.InEncoding
{
  private final String m_encoding;
  private final int m_first;
  private final int m_explFirst;
  private final int m_explLast;
  private final int m_last;
  private EncodingInfo.InEncoding m_before;
  private EncodingInfo.InEncoding m_after;
  private static final int RANGE = 128;
  private final boolean[] m_alreadyKnown;
  private final boolean[] m_isInEncoding;
  private final EncodingInfo this$0;
  
  EncodingInfo$EncodingImpl(EncodingInfo x0, EncodingInfo.1 x1)
  {
    this(x0);
  }
  
  public boolean isInEncoding(char ch1)
  {
    int codePoint = Encodings.toCodePoint(ch1);
    boolean ret;
    if (codePoint < m_explFirst)
    {
      if (m_before == null) {
        m_before = new EncodingImpl(this$0, m_encoding, m_first, m_explFirst - 1, codePoint);
      }
      ret = m_before.isInEncoding(ch1);
    }
    else if (m_explLast < codePoint)
    {
      if (m_after == null) {
        m_after = new EncodingImpl(this$0, m_encoding, m_explLast + 1, m_last, codePoint);
      }
      ret = m_after.isInEncoding(ch1);
    }
    else
    {
      int idx = codePoint - m_explFirst;
      if (m_alreadyKnown[idx] != 0)
      {
        ret = m_isInEncoding[idx];
      }
      else
      {
        ret = EncodingInfo.access$100(ch1, m_encoding);
        m_alreadyKnown[idx] = true;
        m_isInEncoding[idx] = ret;
      }
    }
    return ret;
  }
  
  public boolean isInEncoding(char high, char low)
  {
    int codePoint = Encodings.toCodePoint(high, low);
    boolean ret;
    if (codePoint < m_explFirst)
    {
      if (m_before == null) {
        m_before = new EncodingImpl(this$0, m_encoding, m_first, m_explFirst - 1, codePoint);
      }
      ret = m_before.isInEncoding(high, low);
    }
    else if (m_explLast < codePoint)
    {
      if (m_after == null) {
        m_after = new EncodingImpl(this$0, m_encoding, m_explLast + 1, m_last, codePoint);
      }
      ret = m_after.isInEncoding(high, low);
    }
    else
    {
      int idx = codePoint - m_explFirst;
      if (m_alreadyKnown[idx] != 0)
      {
        ret = m_isInEncoding[idx];
      }
      else
      {
        ret = EncodingInfo.access$200(high, low, m_encoding);
        m_alreadyKnown[idx] = true;
        m_isInEncoding[idx] = ret;
      }
    }
    return ret;
  }
  
  private EncodingInfo$EncodingImpl(EncodingInfo this$0)
  {
    this(this$0, javaName, 0, Integer.MAX_VALUE, 0);
  }
  
  private EncodingInfo$EncodingImpl(EncodingInfo this$0, String encoding, int first, int last, int codePoint)
  {
    this.this$0 = this$0;m_alreadyKnown = new boolean['?'];m_isInEncoding = new boolean['?'];
    
    m_first = first;
    m_last = last;
    
    m_explFirst = codePoint;
    m_explLast = (codePoint + 127);
    
    m_encoding = encoding;
    if (javaName != null)
    {
      if ((0 <= m_explFirst) && (m_explFirst <= 127)) {
        if (("UTF8".equals(javaName)) || ("UTF-16".equals(javaName)) || ("ASCII".equals(javaName)) || ("US-ASCII".equals(javaName)) || ("Unicode".equals(javaName)) || ("UNICODE".equals(javaName)) || (javaName.startsWith("ISO8859"))) {
          for (int unicode = 1; unicode < 127; unicode++)
          {
            int idx = unicode - m_explFirst;
            if ((0 <= idx) && (idx < 128))
            {
              m_alreadyKnown[idx] = true;
              m_isInEncoding[idx] = true;
            }
          }
        }
      }
      if (javaName == null) {
        for (int idx = 0; idx < m_alreadyKnown.length; idx++)
        {
          m_alreadyKnown[idx] = true;
          m_isInEncoding[idx] = true;
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.EncodingInfo.EncodingImpl
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

abstract interface EncodingInfo$InEncoding
{
  public abstract boolean isInEncoding(char paramChar);
  
  public abstract boolean isInEncoding(char paramChar1, char paramChar2);
}

/* Location:
 * Qualified Name:     org.apache.xml.serializer.EncodingInfo.InEncoding
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.xml.serializer;

public final class EncodingInfo
{
  private final char m_highCharInContiguousGroup;
  final String name;
  final String javaName;
  private InEncoding m_encoding;
  
  public boolean isInEncoding(char ch)
  {
    if (m_encoding == null) {
      m_encoding = new EncodingImpl(null);
    }
    return m_encoding.isInEncoding(ch);
  }
  
  public boolean isInEncoding(char high, char low)
  {
    if (m_encoding == null) {
      m_encoding = new EncodingImpl(null);
    }
    return m_encoding.isInEncoding(high, low);
  }
  
  public EncodingInfo(String name, String javaName, char highChar)
  {
    this.name = name;
    this.javaName = javaName;
    m_highCharInContiguousGroup = highChar;
  }
  
  private class EncodingImpl
    implements EncodingInfo.InEncoding
  {
    private final String m_encoding;
    private final int m_first;
    private final int m_explFirst;
    private final int m_explLast;
    private final int m_last;
    private EncodingInfo.InEncoding m_before;
    private EncodingInfo.InEncoding m_after;
    private static final int RANGE = 128;
    
    EncodingImpl(EncodingInfo.1 x1)
    {
      this();
    }
    
    public boolean isInEncoding(char ch1)
    {
      int codePoint = Encodings.toCodePoint(ch1);
      boolean ret;
      if (codePoint < m_explFirst)
      {
        if (m_before == null) {
          m_before = new EncodingImpl(EncodingInfo.this, m_encoding, m_first, m_explFirst - 1, codePoint);
        }
        ret = m_before.isInEncoding(ch1);
      }
      else if (m_explLast < codePoint)
      {
        if (m_after == null) {
          m_after = new EncodingImpl(EncodingInfo.this, m_encoding, m_explLast + 1, m_last, codePoint);
        }
        ret = m_after.isInEncoding(ch1);
      }
      else
      {
        int idx = codePoint - m_explFirst;
        if (m_alreadyKnown[idx] != 0)
        {
          ret = m_isInEncoding[idx];
        }
        else
        {
          ret = EncodingInfo.inEncoding(ch1, m_encoding);
          m_alreadyKnown[idx] = true;
          m_isInEncoding[idx] = ret;
        }
      }
      return ret;
    }
    
    public boolean isInEncoding(char high, char low)
    {
      int codePoint = Encodings.toCodePoint(high, low);
      boolean ret;
      if (codePoint < m_explFirst)
      {
        if (m_before == null) {
          m_before = new EncodingImpl(EncodingInfo.this, m_encoding, m_first, m_explFirst - 1, codePoint);
        }
        ret = m_before.isInEncoding(high, low);
      }
      else if (m_explLast < codePoint)
      {
        if (m_after == null) {
          m_after = new EncodingImpl(EncodingInfo.this, m_encoding, m_explLast + 1, m_last, codePoint);
        }
        ret = m_after.isInEncoding(high, low);
      }
      else
      {
        int idx = codePoint - m_explFirst;
        if (m_alreadyKnown[idx] != 0)
        {
          ret = m_isInEncoding[idx];
        }
        else
        {
          ret = EncodingInfo.inEncoding(high, low, m_encoding);
          m_alreadyKnown[idx] = true;
          m_isInEncoding[idx] = ret;
        }
      }
      return ret;
    }
    
    private final boolean[] m_alreadyKnown = new boolean['?'];
    private final boolean[] m_isInEncoding = new boolean['?'];
    
    private EncodingImpl()
    {
      this(javaName, 0, Integer.MAX_VALUE, 0);
    }
    
    private EncodingImpl(String encoding, int first, int last, int codePoint)
    {
      m_first = first;
      m_last = last;
      
      m_explFirst = codePoint;
      m_explLast = (codePoint + 127);
      
      m_encoding = encoding;
      if (javaName != null)
      {
        if ((0 <= m_explFirst) && (m_explFirst <= 127)) {
          if (("UTF8".equals(javaName)) || ("UTF-16".equals(javaName)) || ("ASCII".equals(javaName)) || ("US-ASCII".equals(javaName)) || ("Unicode".equals(javaName)) || ("UNICODE".equals(javaName)) || (javaName.startsWith("ISO8859"))) {
            for (int unicode = 1; unicode < 127; unicode++)
            {
              int idx = unicode - m_explFirst;
              if ((0 <= idx) && (idx < 128))
              {
                m_alreadyKnown[idx] = true;
                m_isInEncoding[idx] = true;
              }
            }
          }
        }
        if (javaName == null) {
          for (int idx = 0; idx < m_alreadyKnown.length; idx++)
          {
            m_alreadyKnown[idx] = true;
            m_isInEncoding[idx] = true;
          }
        }
      }
    }
  }
  
  private static boolean inEncoding(char ch, String encoding)
  {
    boolean isInEncoding;
    try
    {
      char[] cArray = new char[1];
      cArray[0] = ch;
      
      String s = new String(cArray);
      
      byte[] bArray = s.getBytes(encoding);
      isInEncoding = inEncoding(ch, bArray);
    }
    catch (Exception e)
    {
      isInEncoding = false;
      if (encoding == null) {
        isInEncoding = true;
      }
    }
    return isInEncoding;
  }
  
  private static boolean inEncoding(char high, char low, String encoding)
  {
    boolean isInEncoding;
    try
    {
      char[] cArray = new char[2];
      cArray[0] = high;
      cArray[1] = low;
      
      String s = new String(cArray);
      
      byte[] bArray = s.getBytes(encoding);
      isInEncoding = inEncoding(high, bArray);
    }
    catch (Exception e)
    {
      isInEncoding = false;
    }
    return isInEncoding;
  }
  
  private static boolean inEncoding(char ch, byte[] data)
  {
    boolean isInEncoding;
    if ((data == null) || (data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

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