org.apache.batik.dom_1.6.0.v201011041432

createDOMException((short)9, "null.root", null);
    }
    DOMNodeIterator localDOMNodeIterator = new DOMNodeIterator(paramAbstractDocument, paramNode, paramInt, paramNodeFilter, paramBoolean);
    if (iterators == null) {
      iterators = new LinkedList();
    }
    iterators.add(localDOMNodeIterator);
    return localDOMNodeIterator;
  }
  
  public void nodeToBeRemoved(Node paramNode)
  {
    if (iterators != null)
    {
      Iterator localIterator = iterators.iterator();
      while (localIterator.hasNext()) {
        ((DOMNodeIterator)localIterator.next()).nodeToBeRemoved(paramNode);
      }
    }
  }
  
  public void detachNodeIterator(NodeIterator paramNodeIterator)
  {
    iterators.remove(paramNodeIterator);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.traversal.TraversalSupport
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.w3c.dom.css.CSSStyleDeclaration;

public abstract interface CSSStyleDeclarationFactory
{
  public abstract CSSStyleDeclaration createCSSStyleDeclaration();
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.CSSStyleDeclarationFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.io.IOException;
import java.io.Writer;
import org.apache.batik.xml.XMLUtilities;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class DOMUtilities
  extends XMLUtilities
{
  public static void writeDocument(Document paramDocument, Writer paramWriter)
    throws IOException
  {
    for (Node localNode = paramDocument.getFirstChild(); localNode != null; localNode = localNode.getNextSibling()) {
      writeNode(localNode, paramWriter);
    }
  }
  
  public static void writeNode(Node paramNode, Writer paramWriter)
    throws IOException
  {
    Object localObject2;
    switch (paramNode.getNodeType())
    {
    case 1: 
      paramWriter.write("<");
      paramWriter.write(paramNode.getNodeName());
      if (paramNode.hasAttributes())
      {
        localObject1 = paramNode.getAttributes();
        int i = ((NamedNodeMap)localObject1).getLength();
        for (int j = 0; j < i; j++)
        {
          localObject2 = (Attr)((NamedNodeMap)localObject1).item(j);
          paramWriter.write(" ");
          paramWriter.write(((Node)localObject2).getNodeName());
          paramWriter.write("=\"");
          paramWriter.write(contentToString(((Node)localObject2).getNodeValue()));
          paramWriter.write("\"");
        }
      }
      Object localObject1 = paramNode.getFirstChild();
      if (localObject1 != null)
      {
        paramWriter.write(">");
        while (localObject1 != null)
        {
          writeNode((Node)localObject1, paramWriter);
          localObject1 = ((Node)localObject1).getNextSibling();
        }
        paramWriter.write("</");
        paramWriter.write(paramNode.getNodeName());
        paramWriter.write(">");
      }
      else
      {
        paramWriter.write("/>");
      }
      break;
    case 3: 
      paramWriter.write(contentToString(paramNode.getNodeValue()));
      break;
    case 4: 
      paramWriter.write("<![CDATA[");
      paramWriter.write(paramNode.getNodeValue());
      paramWriter.write("]]>");
      break;
    case 5: 
      paramWriter.write("&");
      paramWriter.write(paramNode.getNodeName());
      paramWriter.write(";");
      break;
    case 7: 
      paramWriter.write("<?");
      paramWriter.write(paramNode.getNodeName());
      paramWriter.write(" ");
      paramWriter.write(paramNode.getNodeValue());
      paramWriter.write("?>");
      break;
    case 8: 
      paramWriter.write("<!--");
      paramWriter.write(paramNode.getNodeValue());
      paramWriter.write("-->");
      break;
    case 10: 
      DocumentType localDocumentType = (DocumentType)paramNode;
      paramWriter.write("<!DOCTYPE ");
      paramWriter.write(paramNode.getOwnerDocument().getDocumentElement().getNodeName());
      String str = localDocumentType.getPublicId();
      if (str != null)
      {
        paramWriter.write(" PUBLIC \"" + localDocumentType.getNodeName() + "\" \"" + str + "\">");
      }
      else
      {
        localObject2 = localDocumentType.getSystemId();
        if (localObject2 != null) {
          paramWriter.write(" SYSTEM \"" + (String)localObject2 + "\">");
        }
      }
      break;
    case 2: 
    case 6: 
    case 9: 
    default: 
      throw new Error("Internal error (" + paramNode.getNodeType() + ")");
    }
  }
  
  public static String contentToString(String paramString)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    for (int i = 0; i < paramString.length(); i++)
    {
      char c = paramString.charAt(i);
      switch (c)
      {
      case '<': 
        localStringBuffer.append("&lt;");
        break;
      case '>': 
        localStringBuffer.append("&gt;");
        break;
      case '&': 
        localStringBuffer.append("&amp;");
        break;
      case '"': 
        localStringBuffer.append("&quot;");
        break;
      case '\'': 
        localStringBuffer.append("&apos;");
        break;
      default: 
        localStringBuffer.append(c);
      }
    }
    return localStringBuffer.toString();
  }
  
  public static Document deepCloneDocument(Document paramDocument, DOMImplementation paramDOMImplementation)
  {
    Element localElement1 = paramDocument.getDocumentElement();
    Document localDocument = paramDOMImplementation.createDocument(localElement1.getNamespaceURI(), localElement1.getNodeName(), null);
    Element localElement2 = localDocument.getDocumentElement();
    int i = 1;
    for (Node localNode = paramDocument.getFirstChild(); localNode != null; localNode = localNode.getNextSibling()) {
      if (localNode == localElement1)
      {
        i = 0;
        if (localElement1.hasAttributes())
        {
          localObject = localElement1.getAttributes();
          int j = ((NamedNodeMap)localObject).getLength();
          for (int k = 0; k < j; k++) {
            localElement2.setAttributeNode((Attr)localDocument.importNode(((NamedNodeMap)localObject).item(k), true));
          }
        }
        for (Object localObject = localElement1.getFirstChild(); localObject != null; localObject = ((Node)localObject).getNextSibling()) {
          localElement2.appendChild(localDocument.importNode((Node)localObject, true));
        }
      }
      else if (localNode.getNodeType() != 10)
      {
        if (i != 0) {
          localDocument.insertBefore(localDocument.importNode(localNode, true), localElement2);
        } else {
          localDocument.appendChild(localDocument.importNode(localNode, true));
        }
      }
    }
    return localDocument;
  }
  
  public static boolean isValidName(String paramString)
  {
    int i = paramString.charAt(0);
    int j = i / 32;
    int k = i % 32;
    if ((org.apache.batik.xml.XMLCharacters.NAME_FIRST_CHARACTER[j] & 1 << k) == 0) {
      return false;
    }
    int m = paramString.length();
    for (int n = 1; n < m; n++)
    {
      i = paramString.charAt(n);
      j = i / 32;
      k = i % 32;
      if ((org.apache.batik.xml.XMLCharacters.NAME_CHARACTER[j] & 1 << k) == 0) {
        return false;
      }
    }
    return true;
  }
  
  public static boolean isValidPrefix(String paramString)
  {
    return paramString.indexOf(':') == -1;
  }
  
  public static String getPrefix(String paramString)
  {
    int i = paramString.indexOf(':');
    return (i == -1) || (i == paramString.length() - 1) ? null : paramString.substring(0, i);
  }
  
  public static String getLocalName(String paramString)
  {
    int i = paramString.indexOf(':');
    return (i == -1) || (i == paramString.length() - 1) ? paramString : paramString.substring(i + 1);
  }
  
  public static void parseStyleSheetPIData(String paramString, HashTable paramHashTable)
  {
    char c;
    for (int i = 0; i < paramString.length(); i++)
    {
      c = paramString.charAt(i);
      if (!XMLUtilities.isXMLSpace(c)) {
        break;
      }
    }
    while (i < paramString.length())
    {
      c = paramString.charAt(i);
      int j = c / ' ';
      int k = c % ' ';
      if ((org.apache.batik.xml.XMLCharacters.NAME_FIRST_CHARACTER[j] & 1 << k) == 0) {
        throw new DOMException((short)5, "Wrong name initial:  " + c);
      }
      StringBuffer localStringBuffer1 = new StringBuffer();
      localStringBuffer1.append(c);
      do
      {
        c = paramString.charAt(i);
        j = c / ' ';
        k = c % ' ';
        if ((org.apache.batik.xml.XMLCharacters.NAME_CHARACTER[j] & 1 << k) == 0) {
          break;
        }
        localStringBuffer1.append(c);
        i++;
      } while (i < paramString.length());
      if (i >= paramString.length()) {
        throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
      }
      while (i < paramString.length())
      {
        c = paramString.charAt(i);
        if (!XMLUtilities.isXMLSpace(c)) {
          break;
        }
        i++;
      }
      if (i >= paramString.length()) {
        throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
      }
      if (paramString.charAt(i) != '=') {
        throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
      }
      i++;
      while (i < paramString.length())
      {
        c = paramString.charAt(i);
        if (!XMLUtilities.isXMLSpace(c)) {
          break;
        }
        i++;
      }
      if (i >= paramString.length()) {
        throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
      }
      c = paramString.charAt(i);
      i++;
      StringBuffer localStringBuffer2 = new StringBuffer();
      if (c == '\'')
      {
        while (i < paramString.length())
        {
          c = paramString.charAt(i);
          if (c == '\'') {
            break;
          }
          localStringBuffer2.append(c);
          i++;
        }
        if (i >= paramString.length()) {
          throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
        }
      }
      else if (c == '"')
      {
        while (i < paramString.length())
        {
          c = paramString.charAt(i);
          if (c == '"') {
            break;
          }
          localStringBuffer2.append(c);
          i++;
        }
        if (i >= paramString.length()) {
          throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
        }
      }
      else
      {
        throw new DOMException((short)12, "Wrong xml-stylesheet data: " + paramString);
      }
      paramHashTable.put(localStringBuffer1.toString().intern(), localStringBuffer2.toString());
      i++;
      while (i < paramString.length())
      {
        c = paramString.charAt(i);
        if (!XMLUtilities.isXMLSpace(c)) {
          break;
        }
        i++;
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.DOMUtilities
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.apache.batik.util.CleanerThread.WeakReferenceCleared;
import org.w3c.dom.Element;

public class DocumentDescriptor$Entry
  extends CleanerThread.WeakReferenceCleared
{
  public int hash;
  public int locationLine;
  public Entry next;
  private final DocumentDescriptor this$0;
  
  public DocumentDescriptor$Entry(DocumentDescriptor paramDocumentDescriptor, int paramInt1, Element paramElement, int paramInt2, Entry paramEntry)
  {
    super(paramElement);
    this$0 = paramDocumentDescriptor;
    hash = paramInt1;
    locationLine = paramInt2;
    next = paramEntry;
  }
  
  public void cleared()
  {
    this$0.removeEntry(this);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.DocumentDescriptor.Entry
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.lang.ref.Reference;
import org.apache.batik.util.CleanerThread.WeakReferenceCleared;
import org.w3c.dom.Element;

public class DocumentDescriptor
{
  protected static final int INITIAL_CAPACITY = 101;
  protected Entry[] table = new Entry[101];
  protected int count;
  
  public int getNumberOfElements()
  {
    synchronized (this)
    {
      int i = count;
      return i;
    }
  }
  
  public int getLocationLine(Element paramElement)
  {
    synchronized (this)
    {
      int i = paramElement.hashCode() & 0x7FFFFFFF;
      int j = i % table.length;
      for (Entry localEntry = table[j]; localEntry != null; localEntry = next) {
        if (hash == i)
        {
          Object localObject1 = localEntry.get();
          if (localObject1 == paramElement)
          {
            int k = locationLine;
            return k;
          }
        }
      }
    }
    return 0;
  }
  
  public void setLocationLine(Element paramElement, int paramInt)
  {
    synchronized (this)
    {
      int i = paramElement.hashCode() & 0x7FFFFFFF;
      int j = i % table.length;
      for (Entry localEntry1 = table[j]; localEntry1 != null; localEntry1 = next) {
        if (hash == i)
        {
          Object localObject1 = localEntry1.get();
          if (localObject1 == paramElement) {
            locationLine = paramInt;
          }
        }
      }
      int k = table.length;
      if (count++ >= k * 3 >>> 2)
      {
        rehash();
        j = i % table.length;
      }
      Entry localEntry2 = new Entry(i, paramElement, paramInt, table[j]);
      table[j] = localEntry2;
    }
  }
  
  protected void rehash()
  {
    Entry[] arrayOfEntry = table;
    table = new Entry[arrayOfEntry.length * 2 + 1];
    for (int i = arrayOfEntry.length - 1; i >= 0; i--)
    {
      Entry localEntry1 = arrayOfEntry[i];
      while (localEntry1 != null)
      {
        Entry localEntry2 = localEntry1;
        localEntry1 = next;
        int j = hash % table.length;
        next = table[j];
        table[j] = localEntry2;
      }
    }
  }
  
  protected void removeEntry(Entry paramEntry)
  {
    synchronized (this)
    {
      int i = hash;
      int j = i % table.length;
      Entry localEntry1 = table[j];
      Entry localEntry2 = null;
      while (localEntry1 != paramEntry)
      {
        localEntry2 = localEntry1;
        localEntry1 = next;
      }
      if (localEntry1 == null) {
        return;
      }
      if (localEntry2 == null) {
        table[j] = next;
      } else {
        next = next;
      }
      count -= 1;
    }
  }
  
  protected class Entry
    extends CleanerThread.WeakReferenceCleared
  {
    public int hash;
    public int locationLine;
    public Entry next;
    
    public Entry(int paramInt1, Element paramElement, int paramInt2, Entry paramEntry)
    {
      super();
      hash = paramInt1;
      locationLine = paramInt2;
      next = paramEntry;
    }
    
    public void cleared()
    {
      removeEntry(this);
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.DocumentDescriptor
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import org.w3c.dom.Document;
import org.xml.sax.XMLReader;

public abstract interface DocumentFactory
{
  public abstract void setValidating(boolean paramBoolean);
  
  public abstract boolean isValidating();
  
  public abstract Document createDocument(String paramString1, String paramString2, String paramString3)
    throws IOException;
  
  public abstract Document createDocument(String paramString1, String paramString2, String paramString3, InputStream paramInputStream)
    throws IOException;
  
  public abstract Document createDocument(String paramString1, String paramString2, String paramString3, XMLReader paramXMLReader)
    throws IOException;
  
  public abstract Document createDocument(String paramString1, String paramString2, String paramString3, Reader paramReader)
    throws IOException;
  
  public abstract DocumentDescriptor getDocumentDescriptor();
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.DocumentFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

public class DoublyIndexedTable$Entry
{
  public int hash;
  public Object key1;
  public Object key2;
  public Object value;
  public Entry next;
  
  public DoublyIndexedTable$Entry(int paramInt, Object paramObject1, Object paramObject2, Object paramObject3, Entry paramEntry)
  {
    hash = paramInt;
    key1 = paramObject1;
    key2 = paramObject2;
    value = paramObject3;
    next = paramEntry;
  }
  
  public boolean match(Object paramObject1, Object paramObject2)
  {
    if (key1 != null)
    {
      if (!key1.equals(paramObject1)) {
        return false;
      }
    }
    else if (paramObject1 != null) {
      return false;
    }
    if (key2 != null) {
      return key2.equals(paramObject2);
    }
    return paramObject2 == null;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.DoublyIndexedTable.Entry
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

public class DoublyIndexedTable
{
  protected static final int INITIAL_CAPACITY = 11;
  protected Entry[] table;
  protected int count;
  
  public DoublyIndexedTable()
  {
    table = new Entry[11];
  }
  
  public DoublyIndexedTable(int paramInt)
  {
    table = new Entry[paramInt];
  }
  
  public int size()
  {
    return count;
  }
  
  public Object put(Object paramObject1, Object paramObject2, Object paramObject3)
  {
    int i = hashCode(paramObject1, paramObject2) & 0x7FFFFFFF;
    int j = i % table.length;
    for (Entry localEntry1 = table[j]; localEntry1 != null; localEntry1 = next) {
      if ((hash == i) && (localEntry1.match(paramObject1, paramObject2)))
      {
        Object localObject = value;
        value = paramObject3;
        return localObject;
      }
    }
    int k = table.length;
    if (count++ >= k * 3 >>> 2)
    {
      rehash();
      j = i % table.length;
    }
    Entry localEntry2 = new Entry(i, paramObject1, paramObject2, paramObject3, table[j]);
    table[j] = localEntry2;
    return null;
  }
  
  public Object get(Object paramObject1, Object paramObject2)
  {
    int i = hashCode(paramObject1, paramObject2) & 0x7FFFFFFF;
    int j = i % table.length;
    for (Entry localEntry = table[j]; localEntry != null; localEntry = next) {
      if ((hash == i) && (localEntry.match(paramObject1, paramObject2))) {
        return value;
      }
    }
    return null;
  }
  
  protected void rehash()
  {
    Entry[] arrayOfEntry = table;
    table = new Entry[arrayOfEntry.length * 2 + 1];
    for (int i = arrayOfEntry.length - 1; i >= 0; i--)
    {
      Entry localEntry1 = arrayOfEntry[i];
      while (localEntry1 != null)
      {
        Entry localEntry2 = localEntry1;
        localEntry1 = next;
        int j = hash % table.length;
        next = table[j];
        table[j] = localEntry2;
      }
    }
  }
  
  protected int hashCode(Object paramObject1, Object paramObject2)
  {
    int i = paramObject1 == null ? 0 : paramObject1.hashCode();
    return i ^ (paramObject2 == null ? 0 : paramObject2.hashCode());
  }
  
  protected static class Entry
  {
    public int hash;
    public Object key1;
    public Object key2;
    public Object value;
    public Entry next;
    
    public Entry(int paramInt, Object paramObject1, Object paramObject2, Object paramObject3, Entry paramEntry)
    {
      hash = paramInt;
      key1 = paramObject1;
      key2 = paramObject2;
      value = paramObject3;
      next = paramEntry;
    }
    
    public boolean match(Object paramObject1, Object paramObject2)
    {
      if (key1 != null)
      {
        if (!key1.equals(paramObject1)) {
          return false;
        }
      }
      else if (paramObject1 != null) {
        return false;
      }
      if (key2 != null) {
        return key2.equals(paramObject2);
      }
      return paramObject2 == null;
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.DoublyIndexedTable
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.io.Serializable;

public class HashTable$Entry
  implements Serializable
{
  public int hash;
  public Object key;
  public Object value;
  public Entry next;
  
  public HashTable$Entry(int paramInt, Object paramObject1, Object paramObject2, Entry paramEntry)
  {
    hash = paramInt;
    key = paramObject1;
    value = paramObject2;
    next = paramEntry;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.HashTable.Entry
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.io.Serializable;

public class HashTable
  implements Serializable
{
  protected static final int INITIAL_CAPACITY = 11;
  protected Entry[] table;
  protected int count;
  
  public HashTable()
  {
    table = new Entry[11];
  }
  
  public HashTable(int paramInt)
  {
    table = new Entry[paramInt];
  }
  
  public HashTable(HashTable paramHashTable)
  {
    count = count;
    table = new Entry[table.length];
    for (int i = 0; i < table.length; i++)
    {
      Entry localEntry1 = table[i];
      Entry localEntry2 = null;
      if (localEntry1 != null)
      {
        localEntry2 = new Entry(hash, key, value, null);
        table[i] = localEntry2;
        for (localEntry1 = next; localEntry1 != null; localEntry1 = next)
        {
          next = new Entry(hash, key, value, null);
          localEntry2 = next;
        }
      }
    }
  }
  
  public int size()
  {
    return count;
  }
  
  public Object get(Object paramObject)
  {
    int i = paramObject.hashCode() & 0x7FFFFFFF;
    int j = i % table.length;
    for (Entry localEntry = table[j]; localEntry != null; localEntry = next) {
      if ((hash == i) && (key.equals(paramObject))) {
        return value;
      }
    }
    return null;
  }
  
  public Object put(Object paramObject1, Object paramObject2)
  {
    int i = paramObject1.hashCode() & 0x7FFFFFFF;
    int j = i % table.length;
    for (Entry localEntry1 = table[j]; localEntry1 != null; localEntry1 = next) {
      if ((hash == i) && (key.equals(paramObject1)))
      {
        Object localObject = value;
        value = paramObject2;
        return localObject;
      }
    }
    int k = table.length;
    if (count++ >= k * 3 >>> 2)
    {
      rehash();
      j = i % table.length;
    }
    Entry localEntry2 = new Entry(i, paramObject1, paramObject2, table[j]);
    table[j] = localEntry2;
    return null;
  }
  
  public Object remove(Object paramObject)
  {
    int i = paramObject.hashCode() & 0x7FFFFFFF;
    int j = i % table.length;
    Object localObject1 = null;
    for (Entry localEntry = table[j]; localEntry != null; localEntry = next)
    {
      if ((hash == i) && (key.equals(paramObject)))
      {
        Object localObject2 = value;
        if (localObject1 == null) {
          table[j] = next;
        } else {
          next = next;
        }
        count -= 1;
        return localObject2;
      }
      localObject1 = localEntry;
    }
    return null;
  }
  
  public Object key(int paramInt)
  {
    if ((paramInt < 0) || (paramInt >= count)) {
      return null;
    }
    int i = 0;
    for (int j = 0; j < table.length; j++)
    {
      Entry localEntry = table[j];
      if (localEntry != null) {
        do
        {
          if (i++ == paramInt) {
            return key;
          }
          localEntry = next;
        } while (localEntry != null);
      }
    }
    return null;
  }
  
  public Object item(int paramInt)
  {
    if ((paramInt < 0) || (paramInt >= count)) {
      return null;
    }
    int i = 0;
    for (int j = 0; j < table.length; j++)
    {
      Entry localEntry = table[j];
      if (localEntry != null) {
        do
        {
          if (i++ == paramInt) {
            return value;
          }
          localEntry = next;
        } while (localEntry != null);
      }
    }
    return null;
  }
  
  public void clear()
  {
    for (int i = 0; i < table.length; i++) {
      table[i] = null;
    }
    count = 0;
  }
  
  protected void rehash()
  {
    Entry[] arrayOfEntry = table;
    table = new Entry[arrayOfEntry.length * 2 + 1];
    for (int i = arrayOfEntry.length - 1; i >= 0; i--)
    {
      Entry localEntry1 = arrayOfEntry[i];
      while (localEntry1 != null)
      {
        Entry localEntry2 = localEntry1;
        localEntry1 = next;
        int j = hash % table.length;
        next = table[j];
        table[j] = localEntry2;
      }
    }
  }
  
  protected static class Entry
    implements Serializable
  {
    public int hash;
    public Object key;
    public Object value;
    public Entry next;
    
    public Entry(int paramInt, Object paramObject1, Object paramObject2, Entry paramEntry)
    {
      hash = paramInt;
      key = paramObject1;
      value = paramObject2;
      next = paramEntry;
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.HashTable
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

public class HashTableStack$Link
{
  public HashTable table = new HashTable();
  public Link next;
  public String defaultStr;
  public int pushCount = 0;
  
  public HashTableStack$Link(Link paramLink)
  {
    next = paramLink;
    if (next != null) {
      defaultStr = next.defaultStr;
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.HashTableStack.Link
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

public class HashTableStack
{
  protected Link current = new Link(null);
  
  public void push()
  {
    current.pushCount += 1;
  }
  
  public void pop()
  {
    if (current.pushCount-- == 0) {
      current = current.next;
    }
  }
  
  public String put(String paramString1, String paramString2)
  {
    if (current.pushCount != 0)
    {
      current.pushCount -= 1;
      current = new Link(current);
    }
    if (paramString1.length() == 0) {
      current.defaultStr = paramString2;
    }
    return (String)current.table.put(paramString1, paramString2);
  }
  
  public String get(String paramString)
  {
    if (paramString.length() == 0) {
      return current.defaultStr;
    }
    for (Link localLink = current; localLink != null; localLink = next)
    {
      String str = (String)table.get(paramString);
      if (str != null) {
        return str;
      }
    }
    return null;
  }
  
  protected static class Link
  {
    public HashTable table = new HashTable();
    public Link next;
    public String defaultStr;
    public int pushCount = 0;
    
    public Link(Link paramLink)
    {
      next = paramLink;
      if (next != null) {
        defaultStr = next.defaultStr;
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.HashTableStack
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.util.List;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class ListNodeList
  implements NodeList
{
  protected List list;
  
  public ListNodeList(List paramList)
  {
    list = paramList;
  }
  
  public Node item(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > list.size())) {
      return null;
    }
    return (Node)list.get(paramInt);
  }
  
  public int getLength()
  {
    return list.size();
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.ListNodeList
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

class SAXDocumentFactory$CDataInfo
  implements SAXDocumentFactory.PreInfo
{
  public String cdata;
  
  public SAXDocumentFactory$CDataInfo(String paramString)
  {
    cdata = paramString;
  }
  
  public Node createNode(Document paramDocument)
  {
    return paramDocument.createCDATASection(cdata);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.SAXDocumentFactory.CDataInfo
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

class SAXDocumentFactory$CommentInfo
  implements SAXDocumentFactory.PreInfo
{
  public String comment;
  
  public SAXDocumentFactory$CommentInfo(String paramString)
  {
    comment = paramString;
  }
  
  public Node createNode(Document paramDocument)
  {
    return paramDocument.createComment(comment);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.SAXDocumentFactory.CommentInfo
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

public abstract interface SAXDocumentFactory$PreInfo
{
  public abstract Node createNode(Document paramDocument);
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.SAXDocumentFactory.PreInfo
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

class SAXDocumentFactory$ProcessingInstructionInfo
  implements SAXDocumentFactory.PreInfo
{
  public String target;
  public String data;
  
  public SAXDocumentFactory$ProcessingInstructionInfo(String paramString1, String paramString2)
  {
    target = paramString1;
    data = paramString2;
  }
  
  public Node createNode(Document paramDocument)
  {
    return paramDocument.createProcessingInstruction(target, data);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.SAXDocumentFactory.ProcessingInstructionInfo
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

class SAXDocumentFactory$TextInfo
  implements SAXDocumentFactory.PreInfo
{
  public String text;
  
  public SAXDocumentFactory$TextInfo(String paramString)
  {
    text = paramString;
  }
  
  public Node createNode(Document paramDocument)
  {
    return paramDocument.createTextNode(text);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.util.SAXDocumentFactory.TextInfo
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.Reader;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.batik.util.HaltingThread;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.Attributes;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;

public class SAXDocumentFactory
  extends DefaultHandler
  implements LexicalHandler, DocumentFactory
{
  protected DOMImplementation implementation;
  protected String parserClassName;
  protected Document document;
  protected DocumentDescriptor documentDescriptor;
  protected boolean createDocumentDescriptor;
  protected Node currentNode;
  protected Locator locator;
  protected StringBuffer stringBuffer = new StringBuffer();
  protected boolean stringContent;
  protected boolean inDTD;
  protected boolean inCDATA;
  protected boolean isValidating;
  protected HashTableStack namespaces;
  protected ErrorHandler errorHandler;
  protected List preInfo;
  
  public SAXDocumentFactory(DOMImplementation paramDOMImplementation, String paramString)
  {
    implementation = paramDOMImplementation;
    parserClassName = paramString;
  }
  
  public SAXDocumentFactory(DOMImplementation paramDOMImplementation, String paramString, boolean paramBoolean)
  {
    implementation = paramDOMImplementation;
    parserClassName = paramString;
    createDocumentDescriptor = paramBoolean;
  }
  
  public Document createDocument(String paramString1, String paramString2, String paramString3)
    throws IOException
  {
    return createDocument(paramString1, paramString2, paramString3, new InputSource(paramString3));
  }
  
  public Document createDocument(String paramString)
    throws IOException
  {
    return createDocument(new InputSource(paramString));
  }
  
  public Document createDocument(String paramString1, String paramString2, String paramString3, InputStream paramInputStream)
    throws IOException
  {
    InputSource localInputSource = new InputSource(paramInputStream);
    localInputSource.setSystemId(paramString3);
    return createDocument(paramString1, paramString2, paramString3, localInputSource);
  }
  
  public Document createDocument(String paramString, InputStream paramInputStream)
    throws IOException
  {
    InputSource localInputSource = new InputSource(paramInputStream);
    localInputSource.setSystemId(paramString);
    return createDocument(localInputSource);
  }
  
  public Document createDocument(String paramString1, String paramString2, String paramString3, Reader paramReader)
    throws IOException
  {
    InputSource localInputSource = new InputSource(paramReader);
    localInputSource.setSystemId(paramString3);
    return createDocument(paramString1, paramString2, paramString3, localInputSource);
  }
  
  public Document createDocument(String paramString1, String paramString2, String paramString3, XMLReader paramXMLReader)
    throws IOException
  {
    paramXMLReader.setContentHandler(this);
    paramXMLReader.setDTDHandler(this);
    paramXMLReader.setEntityResolver(this);
    try
    {
      paramXMLReader.parse(paramString3);
    }
    catch (SAXException localSAXException)
    {
      Exception localException = localSAXException.getException();
      if ((localException != null) && ((localException instanceof InterruptedIOException))) {
        throw ((InterruptedIOException)localException);
      }
      throw new IOException(localSAXException.getMessage());
    }
    currentNode = null;
    Document localDocument = document;
    document = null;
    return localDocument;
  }
  
  public Document createDocument(String paramString, Reader paramReader)
    throws IOException
  {
    InputSource localInputSource = new InputSource(paramReader);
    localInputSource.setSystemId(paramString);
    return createDocument(localInputSource);
  }
  
  protected Document createDocument(String paramString1, String paramString2, String paramString3, InputSource paramInputSource)
    throws IOException
  {
    Document localDocument = createDocument(paramInputSource);
    Element localElement = localDocument.getDocumentElement();
    String str1 = paramString2;
    String str2 = paramString1;
    if (paramString1 == null)
    {
      int i = str1.indexOf(':');
      String str4 = (i == -1) || (i == str1.length() - 1) ? "" : str1.substring(0, i);
      str2 = namespaces.get(str4);
      if ((i != -1) && (i != str1.length() - 1)) {
        str1 = str1.substring(i + 1);
      }
    }
    String str3 = localElement.getNamespaceURI();
    if ((str3 != str2) && ((str3 == null) || (!str3.equals(str2)))) {
      throw new IOException("Root element namespace does not match that requested:\nRequested: " + str2 + "\n" + "Found: " + str3);
    }
    if (str3 != null)
    {
      if (!localElement.getLocalName().equals(str1)) {
        throw new IOException("Root element does not match that requested:\nRequested: " + str1 + "\n" + "Found: " + localElement.getLocalName());
      }
    }
    else if (!localElement.getNodeName().equals(str1)) {
      throw new IOException("Root element does not match that requested:\nRequested: " + str1 + "\n" + "Found: " + localElement.getNodeName());
    }
    return localDocument;
  }
  
  protected Document createDocument(InputSource paramInputSource)
    throws IOException
  {
    try
    {
      XMLReader localXMLReader = XMLReaderFactory.createXMLReader(parserClassName);
      localXMLReader.setContentHandler(this);
      localXMLReader.setDTDHandler(this);
      localXMLReader.setEntityResolver(this);
      localXMLReader.setErrorHandler(errorHandler == null ? this : errorHandler);
      localXMLReader.setFeature("http://xml.org/sax/features/namespaces", true);
      localXMLReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
      localXMLReader.setFeature("http://xml.org/sax/features/validation", isValidating);
      localXMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", this);
      localXMLReader.parse(paramInputSource);
    }
    catch (SAXException localSAXException)
    {
      Exception localException = localSAXException.getException();
      if ((localException != null) && ((localException instanceof InterruptedIOException))) {
        throw ((InterruptedIOException)localException);
      }
      throw new IOException(localSAXException.getMessage());
    }
    currentNode = null;
    Document localDocument = document;
    document = null;
    locator = null;
    return localDocument;
  }
  
  public DocumentDescriptor getDocumentDescriptor()
  {
    return documentDescriptor;
  }
  
  public void setDocumentLocator(Locator paramLocator)
  {
    locator = paramLocator;
  }
  
  public void setValidating(boolean paramBoolean)
  {
    isValidating = paramBoolean;
  }
  
  public boolean isValidating()
  {
    return isValidating;
  }
  
  public void setErrorHandler(ErrorHandler paramErrorHandler)
  {
    errorHandler = paramErrorHandler;
  }
  
  public DOMImplementation getDOMImplementation(String paramString)
  {
    return implementation;
  }
  
  public void fatalError(SAXParseException paramSAXParseException)
    throws SAXException
  {
    throw paramSAXParseException;
  }
  
  public void error(SAXParseException paramSAXParseException)
    throws SAXException
  {
    throw paramSAXParseException;
  }
  
  public void warning(SAXParseException paramSAXParseException)
    throws SAXException
  {}
  
  public void startDocument()
    throws SAXException
  {
    preInfo = new LinkedList();
    namespaces = new HashTableStack();
    namespaces.put("xml", "http://www.w3.org/XML/1998/namespace");
    namespaces.put("xmlns", "http://www.w3.org/2000/xmlns/");
    namespaces.put("", null);
    inDTD = false;
    inCDATA = false;
    currentNode = null;
    document = null;
    stringBuffer.setLength(0);
    stringContent = false;
    if (createDocumentDescriptor) {
      documentDescriptor = new DocumentDescriptor();
    } else {
      documentDescriptor = null;
    }
  }
  
  public void startElement(String paramString1, String paramString2, String paramString3, Attributes paramAttributes)
    throws SAXException
  {
    if (HaltingThread.hasBeenHalted()) {
      throw new SAXException(new InterruptedIOException());
    }
    int i = paramAttributes.getLength();
    namespaces.push();
    String str1 = null;
    Object localObject1;
    for (int j = 0; j < i; j++)
    {
      localObject1 = paramAttributes.getQName(j);
      k = ((String)localObject1).length();
      if (k >= 5) {
        if (((String)localObject1).equals("version")) {
          str1 = paramAttributes.getValue(j);
        } else if (((String)localObject1).startsWith("xmlns")) {
          if (k == 5)
          {
            str2 = paramAttributes.getValue(j);
            if (str2.length() == 0) {
              str2 = null;
           
1 2 3 4 5 6 7

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