org.eclipse.wst.xml.core_1.1.602.v201201091944

16:49:32.343 INFO  jd.cli.Main - Decompiling org.eclipse.wst.xml.core_1.1.602.v201201091944.jar
package org.eclipse.wst.xml.core.contentmodel.modelquery;

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

public abstract interface IExternalSchemaLocationProvider
  extends org.eclipse.wst.xml.core.internal.contentmodel.modelquery.IExternalSchemaLocationProvider
{
  public static final String SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-schemaLocation";
  public static final String NO_NAMESPACE_SCHEMA_LOCATION = "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";
  
  public abstract Map getExternalSchemaLocation(URI paramURI);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.contentmodel.modelquery.IExternalSchemaLocationProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import java.util.ArrayList;
import org.eclipse.wst.sse.core.internal.PropagatingAdapterFactory;
import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;

public class DebugAdapterFactory
  extends AbstractAdapterFactory
  implements PropagatingAdapterFactory
{
  public DebugAdapterFactory()
  {
    this(IDebugAdapter.class, true);
  }
  
  private DebugAdapterFactory(Object adapterKey, boolean registerAdapters)
  {
    super(adapterKey, registerAdapters);
  }
  
  public void addContributedFactories(INodeAdapterFactory factory) {}
  
  public INodeAdapterFactory copy()
  {
    return new DebugAdapterFactory(getAdapterKey(), isShouldRegisterAdapter());
  }
  
  protected INodeAdapter createAdapter(INodeNotifier target)
  {
    EveryNodeDebugAdapter result = null;
    result = EveryNodeDebugAdapter.getInstance();
    return result;
  }
  
  public boolean isFactoryForType(Object type)
  {
    return IDebugAdapter.class == type;
  }
  
  public void setContributedFactories(ArrayList list) {}
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.DebugAdapterFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.wst.sse.core.internal.util.Debug;

class EveryNodeDebugAdapter$InternalDocumentListener
  implements IDocumentListener
{
  public void documentAboutToBeChanged(DocumentEvent event)
  {
    Debug.println("IdocumentAboutToBeChanged: " + event);
  }
  
  public void documentChanged(DocumentEvent event)
  {
    Debug.println("IdocumentChanged: " + event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.EveryNodeDebugAdapter.InternalDocumentListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.util.Debug;

class EveryNodeDebugAdapter$InternalModelStateListener
  implements IModelStateListener
{
  public void modelAboutToBeChanged(IStructuredModel model)
  {
    Debug.println("modelAboutToBeChanged: " + model);
  }
  
  public void modelChanged(IStructuredModel model)
  {
    Debug.println("modelChanged: " + model);
  }
  
  public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty)
  {
    Debug.println("modelDirtyStateChanged: " + model);
  }
  
  public void modelResourceDeleted(IStructuredModel model)
  {
    Debug.println("modelResourceDeleted: " + model);
  }
  
  public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel)
  {
    Debug.println("modelResourceMoved: oldModel: " + oldModel + "newModel: " + newModel);
  }
  
  public void modelAboutToBeReinitialized(IStructuredModel structuredModel)
  {
    Debug.println("modelAboutToBeReinitialized: structuredModel: " + structuredModel);
  }
  
  public void modelReinitialized(IStructuredModel structuredModel)
  {
    Debug.println("modelReinitialized: structuredModel: " + structuredModel);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.EveryNodeDebugAdapter.InternalModelStateListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
import org.eclipse.wst.sse.core.internal.util.Debug;

class EveryNodeDebugAdapter$InternalStructuredDocumentAboutToChange
  implements IModelAboutToBeChangedListener
{
  public void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent)
  {
    Debug.println("structuredDocumentAboutToBeChanged: " + structuredDocumentEvent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.EveryNodeDebugAdapter.InternalStructuredDocumentAboutToChange
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
import org.eclipse.wst.sse.core.internal.util.Debug;

class EveryNodeDebugAdapter$InternalStructuredDocumentListener
  implements IStructuredDocumentListener
{
  public void newModel(NewDocumentEvent structuredDocumentEvent)
  {
    Debug.println("structuredDocumentChanged - newModel: " + structuredDocumentEvent);
  }
  
  public void noChange(NoChangeEvent structuredDocumentEvent)
  {
    Debug.println("structuredDocumentChanged - noChange: " + structuredDocumentEvent);
  }
  
  public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent)
  {
    Debug.println("structuredDocumentChanged - nodesReplaced: " + structuredDocumentEvent);
  }
  
  public void regionChanged(RegionChangedEvent structuredDocumentEvent)
  {
    Debug.println("structuredDocumentChanged - regionChanged: " + structuredDocumentEvent);
  }
  
  public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent)
  {
    Debug.println("structuredDocumentChanged - regionsReplaced: " + structuredDocumentEvent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.EveryNodeDebugAdapter.InternalStructuredDocumentListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.events.AboutToBeChangedEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener;
import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.util.Debug;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;

public class EveryNodeDebugAdapter
  implements IDebugAdapter
{
  private static EveryNodeDebugAdapter singletonInstance;
  InternalDocumentListener fInternalDocumentListener;
  InternalModelStateListener fInternalModelStateListener;
  InternalStructuredDocumentAboutToChange fInternalStructuredDocumentAboutToChange;
  InternalStructuredDocumentListener fInternalStructuredDocumentListener;
  IStructuredModel fModel;
  
  static class InternalDocumentListener
    implements IDocumentListener
  {
    public void documentAboutToBeChanged(DocumentEvent event)
    {
      Debug.println("IdocumentAboutToBeChanged: " + event);
    }
    
    public void documentChanged(DocumentEvent event)
    {
      Debug.println("IdocumentChanged: " + event);
    }
  }
  
  static class InternalModelStateListener
    implements IModelStateListener
  {
    public void modelAboutToBeChanged(IStructuredModel model)
    {
      Debug.println("modelAboutToBeChanged: " + model);
    }
    
    public void modelChanged(IStructuredModel model)
    {
      Debug.println("modelChanged: " + model);
    }
    
    public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty)
    {
      Debug.println("modelDirtyStateChanged: " + model);
    }
    
    public void modelResourceDeleted(IStructuredModel model)
    {
      Debug.println("modelResourceDeleted: " + model);
    }
    
    public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel)
    {
      Debug.println("modelResourceMoved: oldModel: " + oldModel + "newModel: " + newModel);
    }
    
    public void modelAboutToBeReinitialized(IStructuredModel structuredModel)
    {
      Debug.println("modelAboutToBeReinitialized: structuredModel: " + structuredModel);
    }
    
    public void modelReinitialized(IStructuredModel structuredModel)
    {
      Debug.println("modelReinitialized: structuredModel: " + structuredModel);
    }
  }
  
  static class InternalStructuredDocumentAboutToChange
    implements IModelAboutToBeChangedListener
  {
    public void modelAboutToBeChanged(AboutToBeChangedEvent structuredDocumentEvent)
    {
      Debug.println("structuredDocumentAboutToBeChanged: " + structuredDocumentEvent);
    }
  }
  
  static class InternalStructuredDocumentListener
    implements IStructuredDocumentListener
  {
    public void newModel(NewDocumentEvent structuredDocumentEvent)
    {
      Debug.println("structuredDocumentChanged - newModel: " + structuredDocumentEvent);
    }
    
    public void noChange(NoChangeEvent structuredDocumentEvent)
    {
      Debug.println("structuredDocumentChanged - noChange: " + structuredDocumentEvent);
    }
    
    public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent)
    {
      Debug.println("structuredDocumentChanged - nodesReplaced: " + structuredDocumentEvent);
    }
    
    public void regionChanged(RegionChangedEvent structuredDocumentEvent)
    {
      Debug.println("structuredDocumentChanged - regionChanged: " + structuredDocumentEvent);
    }
    
    public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent)
    {
      Debug.println("structuredDocumentChanged - regionsReplaced: " + structuredDocumentEvent);
    }
  }
  
  public static EveryNodeDebugAdapter getInstance()
  {
    if (singletonInstance == null) {
      singletonInstance = new EveryNodeDebugAdapter();
    }
    return singletonInstance;
  }
  
  public EveryNodeDebugAdapter()
  {
    fInternalDocumentListener = new InternalDocumentListener();
    fInternalStructuredDocumentAboutToChange = new InternalStructuredDocumentAboutToChange();
    fInternalStructuredDocumentListener = new InternalStructuredDocumentListener();
    fInternalModelStateListener = new InternalModelStateListener();
  }
  
  public EveryNodeDebugAdapter(INodeNotifier target)
  {
    this();
  }
  
  public boolean isAdapterForType(Object type)
  {
    return type == IDebugAdapter.class;
  }
  
  public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
  {
    if ((notifier instanceof IDOMNode)) {
      setModel(((IDOMNode)notifier).getModel());
    }
    Debug.println("notifier: " + notifier + " " + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " changedFeature: " + changedFeature + " oldValue: " + oldValue + " newValue: " + newValue + " pos: " + pos);
  }
  
  private void setModel(IStructuredModel structuredModel)
  {
    if (fModel == structuredModel) {
      return;
    }
    if (fModel != null)
    {
      fModel.removeModelStateListener(fInternalModelStateListener);
      
      IStructuredDocument structuredDocument = fModel.getStructuredDocument();
      if (structuredDocument != null)
      {
        structuredDocument.removeDocumentListener(fInternalDocumentListener);
        structuredDocument.removeDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange);
        structuredDocument.removeDocumentChangedListener(fInternalStructuredDocumentListener);
      }
    }
    fModel = structuredModel;
    if (fModel != null)
    {
      fModel.addModelStateListener(fInternalModelStateListener);
      
      IStructuredDocument structuredDocument = fModel.getStructuredDocument();
      if (structuredDocument != null)
      {
        structuredDocument.addDocumentListener(fInternalDocumentListener);
        structuredDocument.addDocumentAboutToChangeListener(fInternalStructuredDocumentAboutToChange);
        structuredDocument.addDocumentChangedListener(fInternalStructuredDocumentListener);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.EveryNodeDebugAdapter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;

public abstract interface IDebugAdapter
  extends INodeAdapter
{}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.IDebugAdapter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import com.ibm.icu.util.StringTokenizer;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Bundle;

public class Logger
{
  private static final String PLUGIN_ID = "org.eclipse.wst.xml.core";
  public static final int ERROR = 4;
  public static final int ERROR_DEBUG = 204;
  public static final int INFO = 1;
  public static final int INFO_DEBUG = 201;
  public static final int OK = 0;
  public static final int OK_DEBUG = 200;
  private static final String TRACEFILTER_LOCATION = "/debug/tracefilter";
  public static final int WARNING = 2;
  public static final int WARNING_DEBUG = 202;
  
  protected static void _log(int level, String message, Throwable exception)
  {
    if (((level == 200) || (level == 201) || (level == 202) || (level == 204)) && 
      (!isDebugging())) {
      return;
    }
    int severity = 0;
    switch (level)
    {
    case 1: 
    case 201: 
      severity = 1;
      break;
    case 2: 
    case 202: 
      severity = 2;
      break;
    case 4: 
    case 204: 
      severity = 4;
    }
    message = message != null ? message : "null";
    Status statusObj = new Status(severity, "org.eclipse.wst.xml.core", severity, message, exception);
    Bundle bundle = Platform.getBundle("org.eclipse.wst.xml.core");
    if (bundle != null) {
      Platform.getLog(bundle).log(statusObj);
    }
  }
  
  protected static void _trace(String category, String message, Throwable exception)
  {
    if (isTracing(category))
    {
      message = message != null ? message : "null";
      Status statusObj = new Status(0, "org.eclipse.wst.xml.core", 0, message, exception);
      Bundle bundle = Platform.getBundle("org.eclipse.wst.xml.core");
      if (bundle != null) {
        Platform.getLog(bundle).log(statusObj);
      }
    }
  }
  
  public static boolean isDebugging()
  {
    return Platform.inDebugMode();
  }
  
  public static boolean isTracing(String category)
  {
    if (!isDebugging()) {
      return false;
    }
    String traceFilter = Platform.getDebugOption("org.eclipse.wst.xml.core/debug/tracefilter");
    if (traceFilter != null)
    {
      StringTokenizer tokenizer = new StringTokenizer(traceFilter, ",");
      while (tokenizer.hasMoreTokens())
      {
        String cat = tokenizer.nextToken().trim();
        if (category.equals(cat)) {
          return true;
        }
      }
    }
    return false;
  }
  
  public static void log(int level, String message)
  {
    _log(level, message, null);
  }
  
  public static void log(int level, String message, Throwable exception)
  {
    _log(level, message, exception);
  }
  
  public static void logException(String message, Throwable exception)
  {
    _log(4, message, exception);
  }
  
  public static void logException(Throwable exception)
  {
    _log(4, exception.getMessage(), exception);
  }
  
  public static void trace(String category, String message)
  {
    _trace(category, message, null);
  }
  
  public static void traceException(String category, String message, Throwable exception)
  {
    _trace(category, message, exception);
  }
  
  public static void traceException(String category, Throwable exception)
  {
    _trace(category, exception.getMessage(), exception);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.Logger
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.osgi.util.NLS;

public class XMLCoreMessages
{
  private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.XMLCorePluginResources";
  public static String Invalid_character_lt_fo_ERROR_;
  public static String Invalid_character_gt_fo_ERROR_;
  public static String Invalid_character_amp_fo_ERROR_;
  public static String Invalid_character__f_EXC_;
  public static String loading;
  public static String Catalog_entry_key_not_set;
  public static String Catalog_entry_uri_not_set;
  public static String Catalog_rewrite_startString_not_set;
  public static String Catalog_rewrite_prefix_not_set;
  public static String Catalog_suffix_string_not_set;
  public static String Catalog_suffix_uri_not_set;
  public static String Catalog_delegate_prefix_not_set;
  public static String Catalog_delegate_catalog_not_set;
  public static String Catalog_next_catalog_location_uri_not_set;
  public static String Catalog_resolution_null_catalog;
  public static String Catalog_resolution_malformed_url;
  public static String Catalog_resolution_io_exception;
  public static String CMDocument_load_exception;
  public static String End_tag_has_attributes;
  public static String Attribute__is_missing_a_value;
  public static String Attribute__has_no_value;
  public static String Missing_end_tag_;
  public static String Missing_start_tag_;
  public static String ReconcileStepForMarkup_0;
  public static String ReconcileStepForMarkup_1;
  public static String ReconcileStepForMarkup_2;
  public static String ReconcileStepForMarkup_3;
  public static String ReconcileStepForMarkup_4;
  public static String ReconcileStepForMarkup_5;
  public static String ReconcileStepForMarkup_6;
  public static String Indicate_no_grammar_specified_severities_error;
  
  static
  {
    NLS.initializeMessages("org.eclipse.wst.xml.core.internal.XMLCorePluginResources", XMLCoreMessages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.XMLCoreMessages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.wst.xml.core.internal.catalog.CatalogSet;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;

public class XMLCorePlugin
  extends Plugin
{
  private static XMLCorePlugin plugin;
  public static final String USER_CATALOG_ID = "user_catalog";
  public static final String DEFAULT_CATALOG_ID = "default_catalog";
  public static final String SYSTEM_CATALOG_ID = "system_catalog";
  private CatalogSet catalogSet = null;
  private String defaultCatalogFileStateLocation;
  
  public static XMLCorePlugin getDefault()
  {
    return plugin;
  }
  
  /**
   * @deprecated
   */
  public static IWorkspace getWorkspace()
  {
    return ResourcesPlugin.getWorkspace();
  }
  
  public XMLCorePlugin()
  {
    plugin = this;
  }
  
  private String getPluginStateLocation(String fileName)
  {
    String location = getStateLocation().append(fileName).toString();
    String file_protocol = "file:";
    if ((location != null) && (!location.startsWith(file_protocol))) {
      location = file_protocol + location;
    }
    return location;
  }
  
  public ICatalog getDefaultXMLCatalog()
  {
    if (catalogSet == null)
    {
      catalogSet = new CatalogSet();
      
      defaultCatalogFileStateLocation = getPluginStateLocation("default_catalog.xml");
      
      catalogSet.putCatalogPersistenceLocation("default_catalog", defaultCatalogFileStateLocation);
      catalogSet.putCatalogPersistenceLocation("system_catalog", getPluginStateLocation("system_catalog.xml"));
      catalogSet.putCatalogPersistenceLocation("user_catalog", getPluginStateLocation("user_catalog.xml"));
    }
    return catalogSet.lookupOrCreateCatalog("default_catalog", defaultCatalogFileStateLocation);
  }
  
  public void clearCatalogCache()
  {
    if (catalogSet != null) {
      catalogSet.clearResourceCache();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.XMLCorePlugin
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import java.util.Comparator;
import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;

class Catalog$1
  implements Comparator
{
  public int compare(Object entry1, Object entry2)
  {
    String start1 = ((IRewriteEntry)entry1).getStartString();
    String start2 = ((IRewriteEntry)entry2).getStartString();
    
    return start2.length() - start1.length();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import java.util.Comparator;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;

class Catalog$2
  implements Comparator
{
  public int compare(Object entry1, Object entry2)
  {
    String suffix1 = ((ISuffixEntry)entry1).getSuffix();
    String suffix2 = ((ISuffixEntry)entry2).getSuffix();
    
    return suffix2.length() - suffix1.length();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import java.util.Comparator;
import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;

class Catalog$3
  implements Comparator
{
  public int compare(Object entry1, Object entry2)
  {
    String prefix1 = ((IDelegateCatalog)entry1).getStartString();
    String prefix2 = ((IDelegateCatalog)entry2).getStartString();
    
    return prefix2.length() - prefix1.length();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import org.eclipse.wst.xml.core.internal.Logger;

class Catalog$CatalogLS
{
  final Catalog this$0;
  
  Catalog$CatalogLS(Catalog paramCatalog)
  {
    this$0 = paramCatalog;
  }
  
  public void load() {}
  
  public synchronized void save()
  {
    try
    {
      new CatalogWriter().write(this$0, this$0.location);
    }
    catch (Exception e)
    {
      Logger.logException(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.CatalogLS
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

class Catalog$DefaultCatalogLS
  extends Catalog.CatalogLS
{
  final Catalog this$0;
  
  Catalog$DefaultCatalogLS(Catalog paramCatalog)
  {
    super(paramCatalog);this$0 = paramCatalog;
  }
  
  public void load()
  {
    NextCatalog userCatalogReference = new NextCatalog();
    userCatalogReference.setId("user_catalog");
    userCatalogReference.setCatalogLocation("user_catalog.xml");
    this$0.addCatalogElement(userCatalogReference);
    
    NextCatalog systemCatalogReference = new NextCatalog();
    systemCatalogReference.setId("system_catalog");
    systemCatalogReference.setCatalogLocation("system_catalog.xml");
    this$0.addCatalogElement(systemCatalogReference);
    
    save();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.DefaultCatalogLS
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;

class Catalog$InternalResolver
{
  protected Map publicMap;
  protected Map systemMap;
  protected Map uriMap;
  protected List rewriteSystemList;
  protected List rewriteUriList;
  protected List suffixSystemList;
  protected List suffixUriList;
  protected List delegatePublicList;
  protected List delegateSystemList;
  protected List delegateUriList;
  final Catalog this$0;
  
  Catalog$InternalResolver(Catalog arg1)
  {
    this$0 = ???;publicMap = new HashMap();systemMap = new HashMap();uriMap = new HashMap();rewriteSystemList = new LinkedList();rewriteUriList = new LinkedList();suffixSystemList = new LinkedList();suffixUriList = new LinkedList();delegatePublicList = new LinkedList();delegateSystemList = new LinkedList();delegateUriList = new LinkedList();
    synchronized (catalogElements)
    {
      for (Iterator i = catalogElements.iterator(); i.hasNext();)
      {
        ICatalogElement catalogElement = (ICatalogElement)i.next();
        if (catalogElement.getType() == 1)
        {
          ICatalogEntry entry = (ICatalogEntry)catalogElement;
          Map map = getEntryMap(entry.getEntryType());
          map.put(entry.getKey(), entry);
        }
        else if (catalogElement.getType() == 20)
        {
          IRewriteEntry entry = (IRewriteEntry)catalogElement;
          if (entry.getEntryType() == 21) {
            rewriteSystemList.add(entry);
          } else {
            rewriteUriList.add(entry);
          }
        }
        else if (catalogElement.getType() == 40)
        {
          ISuffixEntry entry = (ISuffixEntry)catalogElement;
          if (entry.getEntryType() == 41) {
            suffixSystemList.add(entry);
          } else {
            suffixUriList.add(entry);
          }
        }
        else if (catalogElement.getType() == 30)
        {
          IDelegateCatalog delegate = (IDelegateCatalog)catalogElement;
          if (delegate.getEntryType() == 31) {
            delegatePublicList.add(delegate);
          } else if (delegate.getEntryType() == 32) {
            delegateSystemList.add(delegate);
          } else {
            delegateUriList.add(delegate);
          }
        }
      }
    }
    Collections.sort(rewriteSystemList, Catalog.access$0());
    Collections.sort(rewriteUriList, Catalog.access$0());
    
    Collections.sort(suffixSystemList, Catalog.access$1());
    Collections.sort(suffixUriList, Catalog.access$1());
    
    Collections.sort(delegatePublicList, Catalog.access$2());
    Collections.sort(delegateSystemList, Catalog.access$2());
    Collections.sort(delegateUriList, Catalog.access$2());
  }
  
  private Map getEntryMap(int entryType)
  {
    Map map = systemMap;
    switch (entryType)
    {
    case 2: 
      map = publicMap;
      break;
    case 4: 
      map = uriMap;
      break;
    }
    return map;
  }
  
  protected String getMappedURI(Map map, String key)
  {
    CatalogEntry entry = (CatalogEntry)map.get(key);
    if (entry == null) {
      return null;
    }
    String uri = entry.getURI();
    try
    {
      String FILE_SCHEME;
      if (uri.startsWith("platform:"))
      {
        URL entryURL = new URL(entry.getAbsolutePath(uri));
        uri = Platform.resolve(entryURL).toString();
        
        FILE_SCHEME = "file:";
        if ((!uri.startsWith(FILE_SCHEME)) || (uri.startsWith(FILE_SCHEME + "/"))) {}
      }
      return FILE_SCHEME + "///" + uri.substring(FILE_SCHEME.length());
    }
    catch (IOException localIOException) {}
    return null;
  }
  
  public String resolvePublic(String publicId, String systemId)
    throws MalformedURLException, IOException
  {
    String result = getMappedURI(publicMap, publicId);
    if (result == null) {
      result = getMappedURI(systemMap, systemId);
    }
    if (result == null) {
      result = getMappedURI(uriMap, publicId);
    }
    if (result == null) {
      result = resolveDelegateCatalogs(delegatePublicList, publicId, systemId);
    }
    if (result == null) {
      result = this$0.resolveSubordinateCatalogs(
        2, publicId, systemId);
    }
    return result;
  }
  
  public String resolveSystem(String systemId)
    throws MalformedURLException, IOException
  {
    String result = getMappedURI(systemMap, systemId);
    if (result == null) {
      result = resolveRewrite(rewriteSystemList, systemId);
    }
    if (result == null) {
      result = resolveSuffix(suffixSystemList, systemId);
    }
    if (result == null) {
      result = resolveDelegateCatalogs(delegateSystemList, systemId, systemId);
    }
    if (result == null) {
      result = this$0.resolveSubordinateCatalogs(
        3, null, systemId);
    }
    return result;
  }
  
  private String resolveRewrite(List rewriteList, String searchString)
  {
    for (Iterator it = rewriteList.iterator(); it.hasNext();)
    {
      IRewriteEntry entry = (IRewriteEntry)it.next();
      String startString = entry.getStartString();
      if (searchString.startsWith(startString)) {
        return entry.getRewritePrefix() + searchString.substring(startString.length());
      }
    }
    return null;
  }
  
  private String resolveSuffix(List suffixList, String searchString)
  {
    for (Iterator it = suffixList.iterator(); it.hasNext();)
    {
      ISuffixEntry entry = (ISuffixEntry)it.next();
      if (searchString.endsWith(entry.getSuffix())) {
        return entry.getURI();
      }
    }
    return null;
  }
  
  protected String resolveDelegateCatalogs(List delegateCatalogs, String key, String systemId)
    throws MalformedURLException, IOException
  {
    String result = null;
    for (Iterator iterator = delegateCatalogs.iterator(); iterator
          .hasNext();)
    {
      IDelegateCatalog delegate = (IDelegateCatalog)iterator.next();
      if (key.startsWith(delegate.getStartString()))
      {
        ICatalog catalog = delegate.getReferencedCatalog();
        if (catalog != null)
        {
          switch (delegate.getEntryType())
          {
          case 31: 
            result = catalog.resolvePublic(key, systemId);
            break;
          case 32: 
            result = catalog.resolveSystem(systemId);
            break;
          case 33: 
            result = catalog.resolveURI(systemId);
            break;
          }
          if (result != null) {
            return result;
          }
        }
      }
    }
    return null;
  }
  
  public String resolveURI(String uri)
    throws MalformedURLException, IOException
  {
    String result = getMappedURI(uriMap, uri);
    if (result == null) {
      result = resolveRewrite(rewriteUriList, uri);
    }
    if (result == null) {
      result = resolveSuffix(suffixUriList, uri);
    }
    if (result == null) {
      result = resolveDelegateCatalogs(delegateUriList, uri, uri);
    }
    if (result == null) {
      result = this$0.resolveSubordinateCatalogs(
        4, null, uri);
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.InternalResolver
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

class Catalog$SystemCatalogLS
  extends Catalog.CatalogLS
{
  final Catalog this$0;
  
  Catalog$SystemCatalogLS(Catalog paramCatalog)
  {
    super(paramCatalog);this$0 = paramCatalog;
  }
  
  public void load()
  {
    new CatalogContributorRegistryReader(this$0).readRegistry();
    
    save();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.SystemCatalogLS
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import java.io.InputStream;
import java.net.URL;

class Catalog$UserCatalogLS
  extends Catalog.CatalogLS
{
  final Catalog this$0;
  
  Catalog$UserCatalogLS(Catalog paramCatalog)
  {
    super(paramCatalog);this$0 = paramCatalog;
  }
  
  public void load()
  {
    InputStream inputStream = null;
    try
    {
      if ((this$0.location != null) && (this$0.location.length() > 0))
      {
        URL url = new URL(this$0.location);
        inputStream = url.openStream();
        boolean oldNotificationEnabled = this$0.isNotificationEnabled();
        this$0.setNotificationEnabled(false);
        this$0.clear();
        try
        {
          CatalogReader.read(this$0, inputStream);
        }
        finally
        {
          this$0.setNotificationEnabled(oldNotificationEnabled);
        }
      }
      else
      {
        this$0.clear();
      }
      this$0.notifyChanged();
    }
    catch (Exception localException1) {}finally
    {
      if (inputStream != null) {
        try
        {
          inputStream.close();
        }
        catch (Exception localException2) {}
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.xml.core.internal.catalog.Catalog.UserCatalogLS
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.xml.core.internal.catalog;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.xml.core.internal.Logger;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogElement;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEvent;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogListener;
import org.eclipse.wst.xml.core.internal.catalog.provisional.IDelegateCatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
import org.eclipse.wst.xml.core.internal.catalog.provisional.IRewriteEntry;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ISuffixEntry;

public class Catalog
  implements ICatalog
{
  class CatalogLS
  {
    CatalogLS() {}
    
    public void load() {}
    
    public synchronized void save()
    {
      try
      {
        new CatalogWriter().write(Catalog.this, location);
      }
      catch (Exception e)
      {
        Logger.logException(e);
      }
    }
  }
  
  class DefaultCatalogLS
    extends Catalog.CatalogLS
  {
    DefaultCatalogLS()
    {
      super();
    }
    
    public void load()
    {
      NextCatalog userCatalogReference = new NextCatalog();
      userCatalogReference.setId("user_catalog");
      userCatalogReference.setCatalogLocation("user_catalog.xml");
      addCatalogElement(userCatalogReference);
      
      NextCatalog systemCatalogReference = new NextCatalog();
      systemCatalogReference.setId("system_catalog");
      systemCatalogReference.setCatalogLocation("system_catalog.xml");
      addCatalogElement(systemCatalogReference);
      
      save();
    }
  }
  
  private static Comparator LONGEST_REWRITE_FIRST = new Comparator()
  {
    public int compare(Object entry1, Object entry2)
    {
      String start1 = ((IRewriteEntry)entry1).getStartString();
      String start2 = ((IRewriteEntry)entry2).getStartString();
      
      return start2.length() - start1.length();
    }
  };
  private static Comparator LONGEST_SUFFIX_FIRST = new Comparator()
  {
    public int compare(Object entry1, Object entry2)
    {
      String suffix1 = ((ISuffixEntry)entry1).getSuffix();
      String suffix2 = ((ISuffixEntry)entry2).getSuffix();
      
      return suffix2.length() - suffix1.length();
    }
  };
  private static Comparator LONGEST_DELEGATE_PREFIX_FIRST = new Comparator()
  {
    public int compare(Object entry1, Object entry2)
    {
      String prefix1 = ((IDelegateCatalog)entry1).getStartString();
      String prefix2 = ((IDelegateCatalog)entry2).getStartString();
      
      return prefix2.length() - prefix1.length();
    }
  };
  public static final String DEFAULT_CATALOG_FILE = "default_catalog.xml";
  public static final String SYSTEM_CATALOG_FILE = "system_catalog.xml";
  public static final String USER_CATALOG_FILE = "user_catalog.xml";
  protected String base;
  
  class InternalResolver
  {
    protected Map publicMap = new HashMap();
    protected Map systemMap = new HashMap();
    protected Map uriMap = new HashMap();
    protected List rewriteSystemList = new LinkedList();
    protected List rewriteUriList = new LinkedList();
    protected List suffixSystemList = new LinkedList();
    protected List suffixUriList = new LinkedList();
    protected List delegatePublicList = new LinkedList();
    protected List delegateSystemList = new LinkedList();
    protected List delegateUriList = new LinkedList();
    
    InternalResolver()
    {
      synchronized (catalogElements)
      {
        for (Iterator i = catalogElements.iterator(); i.hasNext();)
        {
          ICatalogElement catalogElement = (ICatalogElement)i.next();
          if (catalogElement.getType() == 1)
          {
            ICatalogEntry entry = (ICatalogEntry)catalogElement;
            Map map = getEntryMap(entry.getEntryType());
            map.put(entry.getKey(), entry);
          }
          else if (catalogElement.getType() == 20)
          {
            IRewriteEntry entry = (IRewriteEntry)catalogElement;
            if (entry.getEntryType() == 21) {
              rewriteSystemList.add(entry);
            } else {
              rewriteUriList.add(entry);
            }
          }
       
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

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