org.eclipse.equinox.p2.repository_2.2.0.v20120524-1945

16:44:27.044 INFO  jd.cli.Main - Decompiling org.eclipse.equinox.p2.repository_2.2.0.v20120524-1945.jar
package org.eclipse.equinox.internal.p2.persistence;

import java.net.URI;
import java.util.List;
import org.xml.sax.Attributes;

public class CompositeParser$ChildHandler
  extends XMLParser.AbstractHandler
{
  private final String[] required = { "location" };
  private final String[] optional = new String[0];
  URI currentRepo = null;
  private List<URI> repos;
  final CompositeParser this$0;
  
  public CompositeParser$ChildHandler(XMLParser.AbstractHandler arg1, Attributes parentHandler, List<URI> attributes)
  {
    super(???, parentHandler, "child");
    String[] values = parseAttributes(attributes, required, optional);
    this.repos = repos;
    if (values[0] == null) {
      return;
    }
    currentRepo = ???.checkURI("required", "uri", values[0]);
  }
  
  public void startElement(String name, Attributes attributes)
  {
    this$0.checkCancel();
  }
  
  protected void finished()
  {
    if (currentRepo != null) {
      repos.add(currentRepo);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeParser.ChildHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import java.net.URI;
import java.util.ArrayList;
import org.xml.sax.Attributes;

public class CompositeParser$ChildrenHandler
  extends XMLParser.AbstractHandler
{
  private ArrayList<URI> children;
  final CompositeParser this$0;
  
  public CompositeParser$ChildrenHandler(CompositeParser arg1, XMLParser.AbstractHandler parentHandler, Attributes attributes)
  {
    super(???, parentHandler, "children");
    String size = parseOptionalAttribute(attributes, "size");
    children = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList(4));
  }
  
  public URI[] getChildren()
  {
    return (URI[])children.toArray(new URI[children.size()]);
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if (name.equals("child")) {
      new CompositeParser.ChildHandler(this$0, this, attributes, children);
    } else {
      invalidElement(name, attributes);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeParser.ChildrenHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.osgi.util.NLS;
import org.xml.sax.SAXException;

final class CompositeParser$RepositoryDocHandler
  extends XMLParser.DocHandler
{
  final CompositeParser this$0;
  
  public CompositeParser$RepositoryDocHandler(CompositeParser paramCompositeParser, String rootName, XMLParser.RootHandler rootHandler)
  {
    super(paramCompositeParser, rootName, rootHandler);
  }
  
  public void processingInstruction(String target, String data)
    throws SAXException
  {
    if (this$0.repositoryType.equals(target))
    {
      Version repositoryVersion = this$0.extractPIVersion(target, data);
      if (!CompositeParser.XML_TOLERANCE.isIncluded(repositoryVersion)) {
        throw new SAXException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, CompositeParser.XML_TOLERANCE));
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeParser.RepositoryDocHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import java.net.URI;
import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.p2.metadata.Version;
import org.xml.sax.Attributes;

final class CompositeParser$RepositoryHandler
  extends XMLParser.RootHandler
{
  private final String[] required = { "name", "type", "version" };
  private final String[] optional = { "description", "provider" };
  private XMLParser.PropertiesHandler propertiesHandler = null;
  private CompositeParser.ChildrenHandler childrenHandler = null;
  private CompositeRepositoryState state;
  private String[] attrValues = new String[required.length + optional.length];
  final CompositeParser this$0;
  
  public CompositeParser$RepositoryHandler(CompositeParser paramCompositeParser)
  {
    super(paramCompositeParser);
  }
  
  public CompositeRepositoryState getRepository()
  {
    return state;
  }
  
  protected void handleRootAttributes(Attributes attributes)
  {
    attrValues = parseAttributes(attributes, required, optional);
    attrValues[2] = this$0.checkVersion("repository", "version", attrValues[2]).toString();
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if ("properties".equals(name))
    {
      if (propertiesHandler == null) {
        propertiesHandler = new XMLParser.PropertiesHandler(this$0, this, attributes);
      } else {
        this$0.duplicateElement(this, name, attributes);
      }
    }
    else if ("children".equals(name))
    {
      if (childrenHandler == null) {
        childrenHandler = new CompositeParser.ChildrenHandler(this$0, this, attributes);
      } else {
        this$0.duplicateElement(this, name, attributes);
      }
    }
    else {
      invalidElement(name, attributes);
    }
  }
  
  protected void finished()
  {
    if (this$0.isValidXML())
    {
      state = new CompositeRepositoryState();
      state.setName(attrValues[0]);
      state.setType(attrValues[1]);
      state.setVersion(attrValues[2]);
      state.setDescription(attrValues[3]);
      state.setProvider(attrValues[4]);
      state.setProperties(propertiesHandler == null ? new OrderedProperties(0) : 
        propertiesHandler.getProperties());
      state.setChildren(childrenHandler == null ? new URI[0] : 
        childrenHandler.getChildren());
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeParser.RepositoryHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

public class CompositeParser
  extends XMLParser
  implements XMLConstants
{
  private static final Version CURRENT_VERSION = Version.createOSGi(1, 0, 0);
  static final VersionRange XML_TOLERANCE = new VersionRange(CURRENT_VERSION, true, Version.createOSGi(2, 0, 0), false);
  private static final String REQUIRED_CAPABILITY_ELEMENT = "required";
  private static final String REPOSITORY_ELEMENT = "repository";
  String repositoryType;
  private CompositeRepositoryState theState;
  
  protected class ChildrenHandler
    extends XMLParser.AbstractHandler
  {
    private ArrayList<URI> children;
    
    public ChildrenHandler(XMLParser.AbstractHandler parentHandler, Attributes attributes)
    {
      super(parentHandler, "children");
      String size = parseOptionalAttribute(attributes, "size");
      children = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList(4));
    }
    
    public URI[] getChildren()
    {
      return (URI[])children.toArray(new URI[children.size()]);
    }
    
    public void startElement(String name, Attributes attributes)
    {
      if (name.equals("child")) {
        new CompositeParser.ChildHandler(CompositeParser.this, this, attributes, children);
      } else {
        invalidElement(name, attributes);
      }
    }
  }
  
  protected class ChildHandler
    extends XMLParser.AbstractHandler
  {
    private final String[] required = { "location" };
    private final String[] optional = new String[0];
    URI currentRepo = null;
    private List<URI> repos;
    
    public ChildHandler(Attributes parentHandler, List<URI> attributes)
    {
      super(parentHandler, "child");
      String[] values = parseAttributes(attributes, required, optional);
      this.repos = repos;
      if (values[0] == null) {
        return;
      }
      currentRepo = checkURI("required", "uri", values[0]);
    }
    
    public void startElement(String name, Attributes attributes)
    {
      checkCancel();
    }
    
    protected void finished()
    {
      if (currentRepo != null) {
        repos.add(currentRepo);
      }
    }
  }
  
  private final class RepositoryDocHandler
    extends XMLParser.DocHandler
  {
    public RepositoryDocHandler(String rootName, XMLParser.RootHandler rootHandler)
    {
      super(rootName, rootHandler);
    }
    
    public void processingInstruction(String target, String data)
      throws SAXException
    {
      if (repositoryType.equals(target))
      {
        Version repositoryVersion = extractPIVersion(target, data);
        if (!CompositeParser.XML_TOLERANCE.isIncluded(repositoryVersion)) {
          throw new SAXException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, CompositeParser.XML_TOLERANCE));
        }
      }
    }
  }
  
  private final class RepositoryHandler
    extends XMLParser.RootHandler
  {
    private final String[] required = { "name", "type", "version" };
    private final String[] optional = { "description", "provider" };
    private XMLParser.PropertiesHandler propertiesHandler = null;
    private CompositeParser.ChildrenHandler childrenHandler = null;
    private CompositeRepositoryState state;
    private String[] attrValues = new String[required.length + optional.length];
    
    public RepositoryHandler()
    {
      super();
    }
    
    public CompositeRepositoryState getRepository()
    {
      return state;
    }
    
    protected void handleRootAttributes(Attributes attributes)
    {
      attrValues = parseAttributes(attributes, required, optional);
      attrValues[2] = checkVersion("repository", "version", attrValues[2]).toString();
    }
    
    public void startElement(String name, Attributes attributes)
    {
      if ("properties".equals(name))
      {
        if (propertiesHandler == null) {
          propertiesHandler = new XMLParser.PropertiesHandler(CompositeParser.this, this, attributes);
        } else {
          duplicateElement(this, name, attributes);
        }
      }
      else if ("children".equals(name))
      {
        if (childrenHandler == null) {
          childrenHandler = new CompositeParser.ChildrenHandler(CompositeParser.this, this, attributes);
        } else {
          duplicateElement(this, name, attributes);
        }
      }
      else {
        invalidElement(name, attributes);
      }
    }
    
    protected void finished()
    {
      if (isValidXML())
      {
        state = new CompositeRepositoryState();
        state.setName(attrValues[0]);
        state.setType(attrValues[1]);
        state.setVersion(attrValues[2]);
        state.setDescription(attrValues[3]);
        state.setProvider(attrValues[4]);
        state.setProperties(propertiesHandler == null ? new OrderedProperties(0) : 
          propertiesHandler.getProperties());
        state.setChildren(childrenHandler == null ? new URI[0] : 
          childrenHandler.getChildren());
      }
    }
  }
  
  public CompositeParser(BundleContext context, String bundleId, String type)
  {
    super(context, bundleId);
    repositoryType = type;
  }
  
  public void parse(File file)
    throws IOException
  {
    if (errorContext == null) {
      setErrorContext(file.getAbsolutePath());
    }
    parse(new FileInputStream(file));
  }
  
  /* Error */
  public synchronized void parse(java.io.InputStream stream)
    throws IOException
  {
    // Byte code:
    //   0: aload_0
    //   1: aconst_null
    //   2: putfield 134	org/eclipse/equinox/internal/p2/persistence/CompositeParser:status	Lorg/eclipse/core/runtime/MultiStatus;
    //   5: aload_0
    //   6: invokevirtual 148	org/eclipse/equinox/internal/p2/persistence/CompositeParser:getParser	()Ljavax/xml/parsers/SAXParser;
    //   9: pop
    //   10: new 68	org/eclipse/equinox/internal/p2/persistence/CompositeParser$RepositoryHandler
    //   13: dup
    //   14: aload_0
    //   15: invokespecial 150	org/eclipse/equinox/internal/p2/persistence/CompositeParser$RepositoryHandler:<init>	(Lorg/eclipse/equinox/internal/p2/persistence/CompositeParser;)V
    //   18: astore_2
    //   19: aload_0
    //   20: getfield 138	org/eclipse/equinox/internal/p2/persistence/CompositeParser:xmlReader	Lorg/xml/sax/XMLReader;
    //   23: new 67	org/eclipse/equinox/internal/p2/persistence/CompositeParser$RepositoryDocHandler
    //   26: dup
    //   27: aload_0
    //   28: ldc 1
    //   30: aload_2
    //   31: invokespecial 149	org/eclipse/equinox/internal/p2/persistence/CompositeParser$RepositoryDocHandler:<init>	(Lorg/eclipse/equinox/internal/p2/persistence/CompositeParser;Ljava/lang/String;Lorg/eclipse/equinox/internal/p2/persistence/XMLParser$RootHandler;)V
    //   34: invokeinterface 157 2 0
    //   39: aload_0
    //   40: getfield 138	org/eclipse/equinox/internal/p2/persistence/CompositeParser:xmlReader	Lorg/xml/sax/XMLReader;
    //   43: new 75	org/xml/sax/InputSource
    //   46: dup
    //   47: aload_1
    //   48: invokespecial 155	org/xml/sax/InputSource:<init>	(Ljava/io/InputStream;)V
    //   51: invokeinterface 158 2 0
    //   56: aload_0
    //   57: invokevirtual 145	org/eclipse/equinox/internal/p2/persistence/CompositeParser:isValidXML	()Z
    //   60: ifeq +47 -> 107
    //   63: aload_0
    //   64: aload_2
    //   65: invokevirtual 151	org/eclipse/equinox/internal/p2/persistence/CompositeParser$RepositoryHandler:getRepository	()Lorg/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState;
    //   68: putfield 135	org/eclipse/equinox/internal/p2/persistence/CompositeParser:theState	Lorg/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState;
    //   71: goto +36 -> 107
    //   74: astore_2
    //   75: new 61	java/io/IOException
    //   78: dup
    //   79: aload_2
    //   80: invokevirtual 156	org/xml/sax/SAXException:getMessage	()Ljava/lang/String;
    //   83: invokespecial 142	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   86: athrow
    //   87: astore_2
    //   88: new 61	java/io/IOException
    //   91: dup
    //   92: aload_2
    //   93: invokevirtual 144	javax/xml/parsers/ParserConfigurationException:getMessage	()Ljava/lang/String;
    //   96: invokespecial 142	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   99: athrow
    //   100: astore_3
    //   101: aload_1
    //   102: invokevirtual 143	java/io/InputStream:close	()V
    //   105: aload_3
    //   106: athrow
    //   107: aload_1
    //   108: invokevirtual 143	java/io/InputStream:close	()V
    //   111: return
    // Line number table:
    //   Java source line #179	-> byte code offset #0
    //   Java source line #183	-> byte code offset #5
    //   Java source line #184	-> byte code offset #10
    //   Java source line #185	-> byte code offset #19
    //   Java source line #186	-> byte code offset #39
    //   Java source line #187	-> byte code offset #56
    //   Java source line #188	-> byte code offset #63
    //   Java source line #190	-> byte code offset #74
    //   Java source line #191	-> byte code offset #75
    //   Java source line #192	-> byte code offset #87
    //   Java source line #193	-> byte code offset #88
    //   Java source line #194	-> byte code offset #100
    //   Java source line #195	-> byte code offset #101
    //   Java source line #196	-> byte code offset #105
    //   Java source line #195	-> byte code offset #107
    //   Java source line #197	-> byte code offset #111
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	112	0	this	CompositeParser
    //   0	112	1	stream	java.io.InputStream
    //   18	47	2	repositoryHandler	RepositoryHandler
    //   74	6	2	e	SAXException
    //   87	6	2	e	javax.xml.parsers.ParserConfigurationException
    //   100	6	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   5	71	74	org/xml/sax/SAXException
    //   5	71	87	javax/xml/parsers/ParserConfigurationException
    //   5	100	100	finally
  }
  
  public CompositeRepositoryState getRepositoryState()
  {
    return theState;
  }
  
  protected Object getRootObject()
  {
    return null;
  }
  
  protected String getErrorMessage()
  {
    return Messages.io_parseError;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeParser
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

public class CompositeRepositoryIO
{
  /* Error */
  public void write(CompositeRepositoryState repository, java.io.OutputStream output, String type)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore 4
    //   3: new 54	java/io/BufferedOutputStream
    //   6: dup
    //   7: aload_2
    //   8: invokespecial 122	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   11: astore 4
    //   13: new 66	org/eclipse/equinox/internal/p2/persistence/CompositeWriter
    //   16: dup
    //   17: aload 4
    //   19: aload_3
    //   20: invokespecial 137	org/eclipse/equinox/internal/p2/persistence/CompositeWriter:<init>	(Ljava/io/OutputStream;Ljava/lang/String;)V
    //   23: astore 5
    //   25: aload 5
    //   27: aload_1
    //   28: invokevirtual 136	org/eclipse/equinox/internal/p2/persistence/CompositeWriter:write	(Lorg/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState;)V
    //   31: goto +18 -> 49
    //   34: astore 6
    //   36: aload 4
    //   38: ifnull +8 -> 46
    //   41: aload 4
    //   43: invokevirtual 124	java/io/OutputStream:close	()V
    //   46: aload 6
    //   48: athrow
    //   49: aload 4
    //   51: ifnull +18 -> 69
    //   54: aload 4
    //   56: invokevirtual 124	java/io/OutputStream:close	()V
    //   59: goto +10 -> 69
    //   62: astore 5
    //   64: aload 5
    //   66: invokevirtual 123	java/io/IOException:printStackTrace	()V
    //   69: return
    // Line number table:
    //   Java source line #34	-> byte code offset #0
    //   Java source line #37	-> byte code offset #3
    //   Java source line #38	-> byte code offset #13
    //   Java source line #39	-> byte code offset #25
    //   Java source line #40	-> byte code offset #34
    //   Java source line #41	-> byte code offset #36
    //   Java source line #42	-> byte code offset #41
    //   Java source line #44	-> byte code offset #46
    //   Java source line #41	-> byte code offset #49
    //   Java source line #42	-> byte code offset #54
    //   Java source line #45	-> byte code offset #62
    //   Java source line #47	-> byte code offset #64
    //   Java source line #49	-> byte code offset #69
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	70	0	this	CompositeRepositoryIO
    //   0	70	1	repository	CompositeRepositoryState
    //   0	70	2	output	java.io.OutputStream
    //   0	70	3	type	String
    //   1	54	4	bufferedOutput	java.io.OutputStream
    //   23	3	5	repositoryWriter	CompositeWriter
    //   62	3	5	ioe	java.io.IOException
    //   34	13	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   3	34	34	finally
    //   3	59	62	java/io/IOException
  }
  
  /* Error */
  public CompositeRepositoryState read(java.net.URL location, java.io.InputStream input, String type, org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.equinox.p2.core.ProvisionException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore 5
    //   3: new 53	java/io/BufferedInputStream
    //   6: dup
    //   7: aload_2
    //   8: invokespecial 121	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   11: astore 5
    //   13: new 64	org/eclipse/equinox/internal/p2/persistence/CompositeParser
    //   16: dup
    //   17: invokestatic 129	org/eclipse/equinox/internal/p2/core/Activator:getContext	()Lorg/osgi/framework/BundleContext;
    //   20: ldc 1
    //   22: aload_3
    //   23: invokespecial 135	org/eclipse/equinox/internal/p2/persistence/CompositeParser:<init>	(Lorg/osgi/framework/BundleContext;Ljava/lang/String;Ljava/lang/String;)V
    //   26: astore 6
    //   28: aload 6
    //   30: aload_1
    //   31: invokevirtual 126	java/net/URL:toExternalForm	()Ljava/lang/String;
    //   34: invokevirtual 132	org/eclipse/equinox/internal/p2/persistence/CompositeParser:setErrorContext	(Ljava/lang/String;)V
    //   37: aload 6
    //   39: aload_2
    //   40: invokevirtual 131	org/eclipse/equinox/internal/p2/persistence/CompositeParser:parse	(Ljava/io/InputStream;)V
    //   43: aload 6
    //   45: invokevirtual 133	org/eclipse/equinox/internal/p2/persistence/CompositeParser:getStatus	()Lorg/eclipse/core/runtime/IStatus;
    //   48: astore 7
    //   50: aload 7
    //   52: invokeinterface 140 1 0
    //   57: tableswitch	default:+70->127, 1:+65->122, 2:+65->122, 3:+70->127, 4:+55->112, 5:+70->127, 6:+70->127, 7:+70->127, 8:+47->104
    //   104: new 60	org/eclipse/core/runtime/OperationCanceledException
    //   107: dup
    //   108: invokespecial 127	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
    //   111: athrow
    //   112: new 68	org/eclipse/equinox/p2/core/ProvisionException
    //   115: dup
    //   116: aload 7
    //   118: invokespecial 138	org/eclipse/equinox/p2/core/ProvisionException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   121: athrow
    //   122: aload 7
    //   124: invokestatic 130	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   127: aload 6
    //   129: invokevirtual 134	org/eclipse/equinox/internal/p2/persistence/CompositeParser:getRepositoryState	()Lorg/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState;
    //   132: astore 8
    //   134: aload 8
    //   136: ifnonnull +28 -> 164
    //   139: new 68	org/eclipse/equinox/p2/core/ProvisionException
    //   142: dup
    //   143: new 61	org/eclipse/core/runtime/Status
    //   146: dup
    //   147: iconst_4
    //   148: ldc 1
    //   150: sipush 1002
    //   153: getstatic 119	org/eclipse/equinox/internal/p2/persistence/Messages:io_parseError	Ljava/lang/String;
    //   156: aconst_null
    //   157: invokespecial 128	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   160: invokespecial 138	org/eclipse/equinox/p2/core/ProvisionException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   163: athrow
    //   164: aload 8
    //   166: astore 10
    //   168: aload 5
    //   170: ifnull +8 -> 178
    //   173: aload 5
    //   175: invokevirtual 120	java/io/BufferedInputStream:close	()V
    //   178: aload 10
    //   180: areturn
    //   181: astore 9
    //   183: aload 5
    //   185: ifnull +8 -> 193
    //   188: aload 5
    //   190: invokevirtual 120	java/io/BufferedInputStream:close	()V
    //   193: aload 9
    //   195: athrow
    //   196: astore 6
    //   198: getstatic 118	org/eclipse/equinox/internal/p2/persistence/Messages:io_failedRead	Ljava/lang/String;
    //   201: aload_1
    //   202: invokestatic 139	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   205: astore 7
    //   207: new 68	org/eclipse/equinox/p2/core/ProvisionException
    //   210: dup
    //   211: new 61	org/eclipse/core/runtime/Status
    //   214: dup
    //   215: iconst_4
    //   216: ldc 1
    //   218: sipush 1002
    //   221: aload 7
    //   223: aload 6
    //   225: invokespecial 128	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   228: invokespecial 138	org/eclipse/equinox/p2/core/ProvisionException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   231: athrow
    // Line number table:
    //   Java source line #58	-> byte code offset #0
    //   Java source line #61	-> byte code offset #3
    //   Java source line #62	-> byte code offset #13
    //   Java source line #63	-> byte code offset #28
    //   Java source line #64	-> byte code offset #37
    //   Java source line #65	-> byte code offset #43
    //   Java source line #66	-> byte code offset #50
    //   Java source line #68	-> byte code offset #104
    //   Java source line #70	-> byte code offset #112
    //   Java source line #73	-> byte code offset #122
    //   Java source line #75	-> byte code offset #127
    //   Java source line #76	-> byte code offset #134
    //   Java source line #77	-> byte code offset #139
    //   Java source line #78	-> byte code offset #164
    //   Java source line #80	-> byte code offset #168
    //   Java source line #81	-> byte code offset #173
    //   Java source line #78	-> byte code offset #178
    //   Java source line #79	-> byte code offset #181
    //   Java source line #80	-> byte code offset #183
    //   Java source line #81	-> byte code offset #188
    //   Java source line #82	-> byte code offset #193
    //   Java source line #83	-> byte code offset #196
    //   Java source line #84	-> byte code offset #198
    //   Java source line #85	-> byte code offset #207
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	232	0	this	CompositeRepositoryIO
    //   0	232	1	location	java.net.URL
    //   0	232	2	input	java.io.InputStream
    //   0	232	3	type	String
    //   0	232	4	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   1	188	5	bufferedInput	java.io.BufferedInputStream
    //   26	102	6	repositoryParser	CompositeParser
    //   196	28	6	ioe	java.io.IOException
    //   48	75	7	result	org.eclipse.core.runtime.IStatus
    //   205	17	7	msg	String
    //   132	33	8	repositoryState	CompositeRepositoryState
    //   181	13	9	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   3	168	181	finally
    //   3	178	196	java/io/IOException
    //   181	196	196	java/io/IOException
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryIO
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import java.net.URI;
import java.util.Map;

public class CompositeRepositoryState
{
  private String name;
  private String type;
  private String version;
  private String provider;
  private String description;
  private URI location;
  private Map<String, String> properties;
  private URI[] children;
  
  public void setName(String value)
  {
    name = value;
  }
  
  public String getName()
  {
    return name;
  }
  
  public void setType(String value)
  {
    type = value;
  }
  
  public String getType()
  {
    return type;
  }
  
  public void setVersion(String value)
  {
    version = value;
  }
  
  public String getVersion()
  {
    return version;
  }
  
  public void setProvider(String value)
  {
    provider = value;
  }
  
  public String getProvider()
  {
    return provider;
  }
  
  public void setDescription(String value)
  {
    description = value;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public void setLocation(URI value)
  {
    location = value;
  }
  
  public URI getLocation()
  {
    return location;
  }
  
  public void setProperties(Map<String, String> value)
  {
    properties = value;
  }
  
  public Map<String, String> getProperties()
  {
    return properties;
  }
  
  public void setChildren(URI[] value)
  {
    children = value;
  }
  
  public URI[] getChildren()
  {
    return children;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.p2.metadata.Version;

public class CompositeWriter
  extends XMLWriter
  implements XMLConstants
{
  private static final String REPOSITORY_ELEMENT = "repository";
  private static final Version CURRENT_VERSION = Version.createOSGi(1, 0, 0);
  
  public CompositeWriter(OutputStream output, String type)
    throws UnsupportedEncodingException
  {
    super(output, new XMLWriter.ProcessingInstruction[] { XMLWriter.ProcessingInstruction.makeTargetVersionInstruction(type, CURRENT_VERSION) });
  }
  
  protected void writeChildren(URI[] children)
  {
    if ((children == null) || (children.length == 0)) {
      return;
    }
    start("children");
    attribute("size", children.length);
    for (int i = 0; i < children.length; i++) {
      writeChild(children[i]);
    }
    end("children");
  }
  
  protected void writeChild(URI encodedURI)
  {
    String unencodedString = URIUtil.toUnencodedString(encodedURI);
    start("child");
    attribute("location", unencodedString);
    end("child");
  }
  
  public void write(CompositeRepositoryState repository)
  {
    start("repository");
    attribute("name", repository.getName());
    attribute("type", repository.getType());
    attribute("version", repository.getVersion());
    attributeOptional("provider", repository.getProvider());
    attributeOptional("description", repository.getDescription());
    writeProperties(repository.getProperties());
    writeChildren(repository.getChildren());
    end("repository");
    flush();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.CompositeWriter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.persistence.messages";
  public static String XMLParser_No_SAX_Parser;
  public static String XMLParser_Error_At_Line;
  public static String XMLParser_Error_At_Line_Column;
  public static String XMLParser_Error_At_Name_Line;
  public static String XMLParser_Error_At_Name_Line_Column;
  public static String XMLParser_Missing_Required_Attribute;
  public static String XMLParser_Illegal_Value_For_Attribute;
  public static String XMLParser_Duplicate_Element;
  public static String io_failedRead;
  public static String io_IncompatibleVersion;
  public static String io_parseError;
  
  static
  {
    NLS.initializeMessages("org.eclipse.equinox.internal.p2.persistence.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.Messages
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

public abstract interface XMLConstants
{
  public static final String PI_CLASS_ATTRIBUTE = "class";
  public static final String PI_VERSION_ATTRIBUTE = "version";
  public static final String PROPERTIES_ELEMENT = "properties";
  public static final String PROPERTY_ELEMENT = "property";
  public static final String PROPERTY_NAME_ATTRIBUTE = "name";
  public static final String PROPERTY_VALUE_ATTRIBUTE = "value";
  public static final String[] PROPERTY_ATTRIBUTES = { "name", "value" };
  public static final String ID_ATTRIBUTE = "id";
  public static final String PARENT_ID_ATTRIBUTE = "parentId";
  public static final String TYPE_ATTRIBUTE = "type";
  public static final String NAME_ATTRIBUTE = "name";
  public static final String VERSION_ATTRIBUTE = "version";
  public static final String VERSION_RANGE_ATTRIBUTE = "range";
  public static final String NAMESPACE_ATTRIBUTE = "namespace";
  public static final String MATCH_ATTRIBUTE = "match";
  public static final String MATCH_PARAMETERS_ATTRIBUTE = "matchParameters";
  public static final String MIN_ATTRIBUTE = "min";
  public static final String MAX_ATTRIBUTE = "max";
  public static final String CLASSIFIER_ATTRIBUTE = "classifier";
  public static final String DESCRIPTION_ATTRIBUTE = "description";
  public static final String PROVIDER_ATTRIBUTE = "provider";
  public static final String URL_ATTRIBUTE = "url";
  public static final String URI_ATTRIBUTE = "uri";
  public static final String LICENSES_ELEMENT = "licenses";
  public static final String LICENSE_ELEMENT = "license";
  public static final String COPYRIGHT_ELEMENT = "copyright";
  public static final String COLLECTION_SIZE_ATTRIBUTE = "size";
  public static final String[] noAttributes = new String[0];
  public static final String CHILDREN_ELEMENT = "children";
  public static final String CHILD_ELEMENT = "child";
  public static final String LOCATION_ELEMENT = "location";
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.XMLConstants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import org.eclipse.core.runtime.URIUtil;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;

public abstract class XMLParser$AbstractHandler
  extends DefaultHandler
{
  protected ContentHandler parentHandler = null;
  protected String elementHandled = null;
  protected StringBuffer characters = null;
  final XMLParser this$0;
  
  public XMLParser$AbstractHandler(XMLParser paramXMLParser) {}
  
  public XMLParser$AbstractHandler(XMLParser paramXMLParser, ContentHandler parentHandler)
  {
    this.parentHandler = parentHandler;
    xmlReader.setContentHandler(this);
  }
  
  public XMLParser$AbstractHandler(XMLParser paramXMLParser, ContentHandler parentHandler, String elementHandled)
  {
    this.parentHandler = parentHandler;
    xmlReader.setContentHandler(this);
    this.elementHandled = elementHandled;
  }
  
  public void setDocumentLocator(Locator docLocator)
  {
    this$0.locator = docLocator;
  }
  
  public void startElement(String uri, String localName, String qName, Attributes attributes)
    throws SAXException
  {
    finishCharacters();
    String name = XMLParser.makeSimpleName(localName, qName);
    this$0.trace(name, attributes);
    startElement(name, attributes);
  }
  
  public abstract void startElement(String paramString, Attributes paramAttributes)
    throws SAXException;
  
  public void invalidElement(String name, Attributes attributes)
  {
    this$0.unexpectedElement(this, name, attributes);
    new XMLParser.IgnoringHandler(this$0, this);
  }
  
  public void endElement(String namespaceURI, String localName, String qName)
  {
    finishCharacters();
    finished();
    
    this$0.xmlReader.setContentHandler(parentHandler);
  }
  
  protected void noSubElements(String name, Attributes attributes)
  {
    this$0.unexpectedElement(this, name, attributes);
    
    new XMLParser.IgnoringHandler(this$0, this);
  }
  
  public void characters(char[] chars, int start, int length)
  {
    if (characters == null) {
      characters = new StringBuffer();
    }
    characters.append(chars, start, length);
  }
  
  private String finishCharacters()
  {
    if ((characters == null) || (characters.length() == 0)) {
      return null;
    }
    if (allWhiteSpace(characters))
    {
      characters.setLength(0);
      return null;
    }
    try
    {
      String trimmedChars = characters.toString().trim();
      if (trimmedChars.length() == 0)
      {
        System.err.println("Unexpected non-whitespace characters: " + 
          trimmedChars);
        return null;
      }
      processCharacters(trimmedChars);
      return trimmedChars;
    }
    finally
    {
      characters.setLength(0);
    }
  }
  
  protected void processCharacters(String data)
  {
    if (data.length() > 0) {
      this$0.unexpectedCharacterData(this, data);
    }
  }
  
  private boolean allWhiteSpace(StringBuffer sb)
  {
    int length = sb.length();
    for (int i = 0; i < length; i++) {
      if (!Character.isWhitespace(sb.charAt(i))) {
        return false;
      }
    }
    return true;
  }
  
  protected void finished() {}
  
  public String getName()
  {
    return elementHandled != null ? elementHandled : "NoName";
  }
  
  protected URI parseURIAttribute(Attributes attributes, boolean required)
  {
    String location = parseOptionalAttribute(attributes, "uri");
    try
    {
      if (location != null) {
        return new URI(location);
      }
      if (required) {
        location = parseRequiredAttributes(attributes, new String[] { "url" })[0];
      } else {
        location = parseOptionalAttribute(attributes, "url");
      }
      if (location == null) {
        return null;
      }
      return URIUtil.toURI(new URL(location));
    }
    catch (MalformedURLException e)
    {
      this$0.invalidAttributeValue(elementHandled, "url", location, e);
    }
    catch (URISyntaxException e)
    {
      this$0.invalidAttributeValue(elementHandled, "url", location, e);
    }
    return null;
  }
  
  protected String[] parseRequiredAttributes(Attributes attributes, String[] required)
  {
    return parseAttributes(attributes, required, XMLParser.noAttributes);
  }
  
  protected String parseOptionalAttribute(Attributes attributes, String name)
  {
    return parseAttributes(attributes, XMLParser.noAttributes, new String[] { name })[0];
  }
  
  protected String[] parseAttributes(Attributes attributes, String[] required, String[] optional)
  {
    String[] result = new String[required.length + optional.length];
    for (int i = 0; i < attributes.getLength(); i++)
    {
      String name = attributes.getLocalName(i);
      String value = attributes.getValue(i).trim().intern();
      int j;
      if ((j = XMLParser.indexOf(required, name)) >= 0) {
        result[j] = value;
      } else if ((j = XMLParser.indexOf(optional, name)) >= 0) {
        result[(required.length + j)] = value;
      } else {
        this$0.unexpectedAttribute(elementHandled, name, value);
      }
    }
    for (int i = 0; i < required.length; i++) {
      this$0.checkRequiredAttribute(elementHandled, required[i], result[i]);
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.XMLParser.AbstractHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import org.xml.sax.Attributes;
import org.xml.sax.XMLReader;

public class XMLParser$DocHandler
  extends XMLParser.AbstractHandler
{
  XMLParser.RootHandler rootHandler;
  final XMLParser this$0;
  
  public XMLParser$DocHandler(XMLParser paramXMLParser, String rootName, XMLParser.RootHandler rootHandler)
  {
    super(paramXMLParser, null, rootName);
    this.rootHandler = rootHandler;
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if (name.equals(elementHandled))
    {
      rootHandler.initialize(this, name, attributes);
      this$0.xmlReader.setContentHandler(rootHandler);
    }
    else
    {
      noSubElements(name, attributes);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.persistence.XMLParser.DocHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.persistence;

import org.xml.sax.Attributes;

public class XMLParser$IgnoringHandler
  extends XMLParser.AbstractHandle
1 2 3 4 5 6 7 8

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