org.eclipse.wst.validation_1.2.303.v201202090300

16:49:29.794 INFO  jd.cli.Main - Decompiling org.eclipse.wst.validation_1.2.303.v201202090300.jar
package org.eclipse.wst.validation;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract class AbstractValidator
{
  private Validator.V2 _parent;
  
  public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor)
  {
    return null;
  }
  
  public ValidationResult validate(ValidationEvent event, ValidationState state, IProgressMonitor monitor)
  {
    return null;
  }
  
  public void clean(IProject project, ValidationState state, IProgressMonitor monitor) {}
  
  public void validationStarting(IProject project, ValidationState state, IProgressMonitor monitor) {}
  
  public void validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor) {}
  
  public boolean shouldClearMarkers(ValidationEvent event)
  {
    return true;
  }
  
  public Validator.V2 getParent()
  {
    return _parent;
  }
  
  void setParent(Validator.V2 parent)
  {
    _parent = parent;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.AbstractValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.core.resources.IResource;

public class DependentResource
{
  private IResource _resource;
  private Validator _validator;
  
  public DependentResource(IResource resource, Validator validator)
  {
    _resource = resource;
    _validator = validator;
  }
  
  public IResource getResource()
  {
    return _resource;
  }
  
  public Validator getValidator()
  {
    return _validator;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.DependentResource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.Map;
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.validation.internal.ContentTypeWrapper;
import org.eclipse.wst.validation.internal.ValType;

public class Friend
{
  public static void setMessages(Validator validator, Map<String, MessageSeveritySetting> map)
  {
    validator.setMessages(map);
  }
  
  public static boolean isLoaded(Validator validator)
  {
    return validator.isLoaded();
  }
  
  public static boolean shouldValidate(Validator validator, IResource resource, boolean isManual, boolean isBuild, ContentTypeWrapper contentTypeWrapper)
  {
    return validator.shouldValidate(resource, isManual, isBuild, contentTypeWrapper);
  }
  
  public static boolean shouldValidate(Validator validator, IResource resource, ValType valType, ContentTypeWrapper contentTypeWrapper)
  {
    return validator.shouldValidate(resource, valType, contentTypeWrapper);
  }
  
  public static void setMigrated(Validator validator, boolean migrated)
  {
    validator.setMigrated(migrated);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.Friend
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;

public abstract interface IDependencyIndex
{
  public abstract void add(String paramString, IResource paramIResource1, IResource paramIResource2);
  
  public abstract void clear(IProject paramIProject);
  
  public abstract List<DependentResource> get(IResource paramIResource);
  
  public abstract IResource[] get(String paramString, IResource paramIResource);
  
  public abstract boolean isDependedOn(IResource paramIResource);
  
  public abstract void set(String paramString, IResource paramIResource, IResource[] paramArrayOfIResource);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.IDependencyIndex
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

public abstract interface IMutableValidator
{
  public abstract String getId();
  
  public abstract String getName();
  
  public abstract String getValidatorClassname();
  
  public abstract boolean isBuildValidation();
  
  public abstract boolean isManualValidation();
  
  public abstract void setBuildValidation(boolean paramBoolean);
  
  public abstract void setManualValidation(boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.IMutableValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

public enum IPerformanceMonitor$CollectionLevel
{
  None,  Default;
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.IPerformanceMonitor.CollectionLevel
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.List;

public abstract interface IPerformanceMonitor
{
  public abstract void add(PerformanceCounters paramPerformanceCounters);
  
  public abstract boolean isCollecting();
  
  public abstract boolean isSummaryOnly();
  
  public abstract void setCollectionLevel(CollectionLevel paramCollectionLevel);
  
  public abstract CollectionLevel getCollectionLevel();
  
  public abstract List<PerformanceCounters> getPerformanceCounters(boolean paramBoolean);
  
  public abstract void resetPerformanceCounters();
  
  public static enum CollectionLevel
  {
    None,  Default;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.IPerformanceMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract interface IValidatorGroupListener
{
  public abstract void validationStarting(IResource paramIResource, IProgressMonitor paramIProgressMonitor, ValidationState paramValidationState);
  
  public abstract void validationFinishing(IResource paramIResource, IProgressMonitor paramIProgressMonitor, ValidationState paramValidationState);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.IValidatorGroupListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.wst.validation.internal.ValMessages;

public enum MessageSeveritySetting$Severity
{
  Error(ValMessages.SevError, 2),  Warning(ValMessages.SevWarning, 1),  Ignore(ValMessages.SevIgnore, 0);
  
  private String _severityLabel;
  private int _markerSeverity;
  
  private MessageSeveritySetting$Severity(String label, int markerSeverity)
  {
    _severityLabel = label;
    _markerSeverity = markerSeverity;
  }
  
  public String toString()
  {
    return _severityLabel;
  }
  
  public int getMarkerSeverity()
  {
    return _markerSeverity;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.MessageSeveritySetting.Severity
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.wst.validation.internal.ValMessages;

public class MessageSeveritySetting
{
  private String _id;
  private String _label;
  private Severity _default;
  private Severity _current;
  
  public static enum Severity
  {
    Error(ValMessages.SevError, 2),  Warning(ValMessages.SevWarning, 1),  Ignore(ValMessages.SevIgnore, 0);
    
    private String _severityLabel;
    private int _markerSeverity;
    
    private Severity(String label, int markerSeverity)
    {
      _severityLabel = label;
      _markerSeverity = markerSeverity;
    }
    
    public String toString()
    {
      return _severityLabel;
    }
    
    public int getMarkerSeverity()
    {
      return _markerSeverity;
    }
  }
  
  public MessageSeveritySetting(String id, String label, Severity defaultSeverity)
  {
    _id = id;
    _label = label;
    _default = defaultSeverity;
  }
  
  public int hashCode()
  {
    int h = 0;
    if (_current != null) {
      h += _current.getMarkerSeverity() * 1000;
    }
    if (_id != null) {
      h += _id.hashCode();
    }
    return h;
  }
  
  public String getLabel()
  {
    return _label;
  }
  
  public Severity getDefault()
  {
    return _default;
  }
  
  public Severity getCurrent()
  {
    if (_current != null) {
      return _current;
    }
    return _default;
  }
  
  public String getId()
  {
    return _id;
  }
  
  public boolean setCurrent(Severity severity)
  {
    if (_current == severity) {
      return false;
    }
    _current = severity;
    return true;
  }
  
  public String toString()
  {
    return _id + " " + getCurrent().toString();
  }
  
  public MessageSeveritySetting copy()
  {
    MessageSeveritySetting ms = new MessageSeveritySetting(_id, _label, _default);
    _current = _current;
    return ms;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.MessageSeveritySetting
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.core.resources.IProject;

public final class MutableProjectSettings
{
  private final IProject _project;
  private boolean _override;
  private boolean _suspend;
  private final IMutableValidator[] _validators;
  
  public IMutableValidator[] getValidators()
  {
    return _validators;
  }
  
  public MutableProjectSettings(IProject project, IMutableValidator[] validators)
  {
    _project = project;
    _validators = validators;
  }
  
  public boolean getOverride()
  {
    return _override;
  }
  
  public void setOverride(boolean override)
  {
    _override = override;
  }
  
  public boolean getSuspend()
  {
    return _suspend;
  }
  
  public void setSuspend(boolean suspend)
  {
    _suspend = suspend;
  }
  
  public IProject getProject()
  {
    return _project;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.MutableProjectSettings
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.wst.validation.internal.model.GlobalPreferencesValues;

public final class MutableWorkspaceSettings
{
  private final GlobalPreferencesValues _values;
  private final IMutableValidator[] _validators;
  
  public IMutableValidator[] getValidators()
  {
    return _validators;
  }
  
  public MutableWorkspaceSettings(IMutableValidator[] validators, GlobalPreferencesValues values)
  {
    _validators = validators;
    _values = values;
  }
  
  public GlobalPreferencesValues getGlobalPreferencesValues()
  {
    return _values;
  }
  
  public boolean getAutoSave()
  {
    return _values.saveAutomatically;
  }
  
  public void setAutoSave(boolean autoSave)
  {
    _values.saveAutomatically = autoSave;
  }
  
  public boolean getOverride()
  {
    return _values.override;
  }
  
  public void setOverride(boolean override)
  {
    _values.override = override;
  }
  
  public boolean getSuspend()
  {
    return _values.disableAllValidation;
  }
  
  public void setSuspend(boolean suspend)
  {
    _values.disableAllValidation = suspend;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.MutableWorkspaceSettings
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.validation.internal.Misc;
import org.eclipse.wst.validation.internal.ValMessages;

public class PerformanceCounters
{
  private long _when;
  private String _validatorId;
  private String _validatorName;
  private String _resourceName;
  private int _numberInvocations;
  private long _elapsedTime;
  private long _cpuTime;
  
  public PerformanceCounters(String validatorId, String validatorName, String resourceName, int numberInvocations, long elapsedTime, long cpuTime)
  {
    _when = System.currentTimeMillis();
    _validatorId = validatorId;
    _validatorName = validatorName;
    _resourceName = resourceName;
    _numberInvocations = numberInvocations;
    _elapsedTime = elapsedTime;
    _cpuTime = cpuTime;
  }
  
  public String getValidatorId()
  {
    return _validatorId;
  }
  
  public int getNumberInvocations()
  {
    return _numberInvocations;
  }
  
  public long getElapsedTime()
  {
    return _elapsedTime;
  }
  
  public long getCpuTime()
  {
    return _cpuTime;
  }
  
  public String toString()
  {
    return NLS.bind(ValMessages.LogValEndTime, 
      new Object[] { _validatorName, _validatorId, _resourceName, Misc.getTimeMS(_elapsedTime) });
  }
  
  public String toString(boolean asSummary)
  {
    if (asSummary)
    {
      if (_cpuTime != -1L) {
        return NLS.bind(ValMessages.LogValSummary2, 
          new Object[] { _validatorName, _validatorId, Integer.valueOf(_numberInvocations), 
          Misc.getTimeMS(_elapsedTime), Misc.getTimeNano(_cpuTime) });
      }
      return NLS.bind(ValMessages.LogValSummary, 
        new Object[] { _validatorName, _validatorId, Integer.valueOf(_numberInvocations), Misc.getTimeMS(_elapsedTime) });
    }
    return toString();
  }
  
  public String getValidatorName()
  {
    return _validatorName;
  }
  
  public long getWhen()
  {
    return _when;
  }
  
  public String getResourceName()
  {
    return _resourceName;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.PerformanceCounters
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.LinkedList;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.validation.internal.MarkerManager;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidator;

public class ReporterHelper
  implements IReporter
{
  private IProgressMonitor _monitor;
  private List<IMessage> _list = new LinkedList();
  
  public ReporterHelper(IProgressMonitor monitor)
  {
    _monitor = monitor;
  }
  
  public void addMessage(IValidator origin, IMessage message)
  {
    _list.add(message);
  }
  
  public void displaySubtask(IValidator validator, IMessage message)
  {
    _monitor.subTask(message.getText(validator.getClass().getClassLoader()));
  }
  
  public List<IMessage> getMessages()
  {
    return _list;
  }
  
  public boolean isCancelled()
  {
    return _monitor.isCanceled();
  }
  
  public void removeAllMessages(IValidator origin)
  {
    _list.clear();
  }
  
  public void removeAllMessages(IValidator origin, Object object)
  {
    _list.clear();
  }
  
  public void removeMessageSubset(IValidator validator, Object obj, String groupName)
  {
    _list.clear();
  }
  
  public void makeMarkers()
  {
    MarkerManager.getDefault().makeMarkers(_list);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ReporterHelper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;

public final class ValidationEvent
{
  private IResource _resource;
  private int _kind;
  private IResourceDelta _dependsOn;
  
  public ValidationEvent(IResource resource, int kind, IResourceDelta dependsOn)
  {
    _resource = resource;
    _kind = kind;
    _dependsOn = dependsOn;
  }
  
  public IResource getResource()
  {
    return _resource;
  }
  
  public int getKind()
  {
    return _kind;
  }
  
  public IResourceDelta getDependsOn()
  {
    return _dependsOn;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;

public class ValidationFramework$ResourceAdder
  implements IResourceVisitor
{
  private Set<IResource> _set;
  
  public ValidationFramework$ResourceAdder(Set<IResource> set)
  {
    _set = set;
  }
  
  public boolean visit(IResource resource)
    throws CoreException
  {
    int type = resource.getType();
    if ((type == 1) || (type == 2)) {
      _set.add(resource);
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationFramework.ResourceAdder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

class ValidationFramework$Singleton
{
  static ValidationFramework vf = new ValidationFramework(null);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationFramework.Singleton
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.wst.validation.internal.ConfigurationManager;
import org.eclipse.wst.validation.internal.ContentTypeWrapper;
import org.eclipse.wst.validation.internal.DependencyIndex;
import org.eclipse.wst.validation.internal.DisabledResourceManager;
import org.eclipse.wst.validation.internal.DisabledValidatorManager;
import org.eclipse.wst.validation.internal.GlobalConfiguration;
import org.eclipse.wst.validation.internal.MarkerManager;
import org.eclipse.wst.validation.internal.Misc;
import org.eclipse.wst.validation.internal.PerformanceMonitor;
import org.eclipse.wst.validation.internal.ProjectUnavailableError;
import org.eclipse.wst.validation.internal.ValManager;
import org.eclipse.wst.validation.internal.ValManager.UseProjectPreferences;
import org.eclipse.wst.validation.internal.ValOperation;
import org.eclipse.wst.validation.internal.ValPrefManagerGlobal;
import org.eclipse.wst.validation.internal.ValPrefManagerProject;
import org.eclipse.wst.validation.internal.ValType;
import org.eclipse.wst.validation.internal.ValidationRunner;
import org.eclipse.wst.validation.internal.ValidatorMetaData;
import org.eclipse.wst.validation.internal.ValidatorMutable;
import org.eclipse.wst.validation.internal.model.GlobalPreferences;
import org.eclipse.wst.validation.internal.model.GlobalPreferencesValues;
import org.eclipse.wst.validation.internal.model.ProjectPreferences;
import org.eclipse.wst.validation.internal.operations.ValidationBuilder;
import org.eclipse.wst.validation.internal.operations.ValidatorManager;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;

public final class ValidationFramework
{
  private volatile IDependencyIndex _dependencyIndex;
  private IPerformanceMonitor _performanceMonitor;
  private Set<IProject> _suspendedProjects;
  private boolean _suspendAllValidation;
  
  public static ValidationFramework getDefault()
  {
    return Singleton.vf;
  }
  
  public void addValidationBuilder(IProject project)
  {
    ValidatorManager.addProjectBuildValidationSupport(project);
  }
  
  public void clearMessages(IResource resource, String validatorId)
    throws CoreException
  {
    Validator v = getValidator(validatorId, null);
    if (v != null) {
      MarkerManager.getDefault().clearMarker(resource, v);
    }
  }
  
  public void disableValidation(IResource resource)
  {
    assert (resource != null);
    DisabledResourceManager.getDefault().disableValidation(resource);
  }
  
  public void enableValidation(IResource resource)
  {
    DisabledResourceManager.getDefault().enableValidation(resource);
  }
  
  public IDependencyIndex getDependencyIndex()
  {
    if (_dependencyIndex == null) {
      synchronized (this)
      {
        if (_dependencyIndex == null) {
          _dependencyIndex = new DependencyIndex();
        }
      }
    }
    return _dependencyIndex;
  }
  
  public synchronized IPerformanceMonitor getPerformanceMonitor()
  {
    if (_performanceMonitor == null)
    {
      boolean traceTimes = Misc.debugOptionAsBoolean("org.eclipse.wst.validation/timings");
      String traceFile = Platform.getDebugOption("org.eclipse.wst.validation/timings/tracefile");
      boolean useDoubles = Misc.debugOptionAsBoolean("org.eclipse.wst.validation/timings/useDoubles");
      
      _performanceMonitor = PerformanceMonitor.create(traceTimes, traceFile, useDoubles);
    }
    return _performanceMonitor;
  }
  
  public IEclipsePreferences getPreferenceStore()
  {
    return new InstanceScope().getNode("org.eclipse.wst.validation");
  }
  
  public IReporter getReporter(IProject project, IProgressMonitor monitor)
  {
    return new WorkbenchReporter(project, monitor);
  }
  
  public Validator[] getValidatorsFor(IResource resource, boolean isManual, boolean isBuild)
  {
    IProject project = resource.getProject();
    List<Validator> list = new LinkedList();
    ContentTypeWrapper ctw = new ContentTypeWrapper();
    Validator[] arrayOfValidator1;
    int j = (arrayOfValidator1 = ValManager.getDefault().getValidators(project)).length;
    for (int i = 0; i < j; i++)
    {
      Validator val = arrayOfValidator1[i];
      if (val.shouldValidate(resource, isManual, isBuild, ctw)) {
        list.add(val);
      }
    }
    Validator[] result = new Validator[list.size()];
    list.toArray(result);
    return result;
  }
  
  public Set<Validator> getDisabledValidatorsFor(IResource resource)
  {
    return DisabledValidatorManager.getDefault().getDisabledValidatorsFor(resource);
  }
  
  /**
   * @deprecated
   */
  public Validator getValidator(String id)
  {
    return ValManager.getDefault().getValidatorWithId(id, null);
  }
  
  public Validator getValidator(String id, IProject project)
  {
    return ValManager.getDefault().getValidatorWithId(id, project);
  }
  
  public Validator[] getValidators()
  {
    return ValManager.getDefault().getValidatorsCopy();
  }
  
  public MutableProjectSettings getProjectSettings(IProject project)
  {
    ProjectPreferences pp = ValManager.getDefault().getProjectPreferences(project);
    Validator[] vals = pp.getValidators();
    ValidatorMutable[] vms = new ValidatorMutable[vals.length];
    for (int i = 0; i < vals.length; i++) {
      vms[i] = new ValidatorMutable(vals[i]);
    }
    MutableProjectSettings mps = new MutableProjectSettings(project, vms);
    mps.setOverride(pp.getOverride());
    mps.setSuspend(pp.getSuspend());
    return mps;
  }
  
  public MutableWorkspaceSettings getWorkspaceSettings()
    throws InvocationTargetException
  {
    ValManager vm = ValManager.getDefault();
    GlobalPreferences gp = vm.getGlobalPreferences();
    
    Validator[] vals = vm.getValidators();
    ValidatorMutable[] vms = new ValidatorMutable[vals.length];
    for (int i = 0; i < vals.length; i++) {
      vms[i] = new ValidatorMutable(vals[i]);
    }
    MutableWorkspaceSettings mws = new MutableWorkspaceSettings(vms, gp.asValues());
    return mws;
  }
  
  public void applyChanges(MutableProjectSettings settings, boolean persist)
  {
    ValPrefManagerProject vpm = new ValPrefManagerProject(settings.getProject());
    vpm.savePreferences(settings, Boolean.valueOf(persist));
  }
  
  public void applyChanges(MutableWorkspaceSettings settings, boolean persist)
  {
    ValManager vm = ValManager.getDefault();
    GlobalPreferencesValues gpv = settings.getGlobalPreferencesValues();
    vm.replace(gpv);
    
    IMutableValidator[] mvs = settings.getValidators();
    ValidatorMutable[] vals = new ValidatorMutable[mvs.length];
    for (int i = 0; i < mvs.length; i++) {
      vals[i] = ((ValidatorMutable)mvs[i]);
    }
    ValPrefManagerGlobal.getDefault().savePreferences(vm.getGlobalPreferences(), vals, Boolean.valueOf(persist));
    ValPrefManagerGlobal.saveV1Preferences(vals, Boolean.valueOf(persist));
  }
  
  public Validator[] getValidatorsConfiguredForProject(IProject project)
    throws ProjectUnavailableError
  {
    Validator[] orig = ValManager.getDefault().getValidatorsConfiguredForProject(project, ValManager.UseProjectPreferences.Normal);
    Validator[] copy = new Validator[orig.length];
    for (int i = 0; i < orig.length; i++) {
      copy[i] = orig[i].copy();
    }
    return copy;
  }
  
  public Validator[] getValidatorsFor(IResource resource)
  {
    List<Validator> list = new LinkedList();
    Validator[] arrayOfValidator1;
    int j = (arrayOfValidator1 = getValidatorsFor(resource, false, false)).length;
    for (int i = 0; i < j; i++)
    {
      Validator v = arrayOfValidator1[i];
      if ((v.isBuildValidation()) || (v.isManualValidation())) {
        list.add(v);
      }
    }
    Validator[] vals = new Validator[list.size()];
    return (Validator[])list.toArray(vals);
  }
  
  public boolean hasValidators(IResource resource, boolean isManual, boolean isBuild)
  {
    return ValManager.getDefault().hasValidators(resource, isManual, isBuild);
  }
  
  public boolean isLoaded(Validator validator)
  {
    return validator.isLoaded();
  }
  
  public void join(IProgressMonitor monitor)
    throws InterruptedException, OperationCanceledException
  {
    Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, monitor);
    Job.getJobManager().join(ValidationBuilder.FAMILY_VALIDATION_JOB, monitor);
  }
  
  public void joinValidationOnly(IProgressMonitor monitor)
    throws InterruptedException, OperationCanceledException
  {
    Job.getJobManager().join(ValidationBuilder.FAMILY_VALIDATION_JOB, monitor);
  }
  
  public void suspendValidation(IProject project, boolean suspend)
  {
    if (project == null) {
      return;
    }
    if (suspend) {
      getSuspendedProjects().add(project);
    } else {
      getSuspendedProjects().remove(project);
    }
  }
  
  private synchronized Set<IProject> getSuspendedProjects()
  {
    if (_suspendedProjects == null) {
      _suspendedProjects = Collections.synchronizedSet(new HashSet(20));
    }
    return _suspendedProjects;
  }
  
  public void saveValidators(Validator[] validators)
    throws InvocationTargetException
  {
    ValPrefManagerGlobal gp = ValPrefManagerGlobal.getDefault();
    gp.saveAsPrefs(validators);
    
    GlobalConfiguration gc = ConfigurationManager.getManager().getGlobalConfiguration();
    
    List<ValidatorMetaData> manual = new LinkedList();
    List<ValidatorMetaData> build = new LinkedList();
    Validator[] arrayOfValidator;
    int j = (arrayOfValidator = validators).length;
    for (int i = 0; i < j; i++)
    {
      Validator v = arrayOfValidator[i];
      Validator.V1 v1 = v.asV1Validator();
      if (v1 != null)
      {
        if (v1.isManualValidation()) {
          manual.add(v1.getVmd());
        }
        if (v1.isBuildValidation()) {
          build.add(v1.getVmd());
        }
      }
    }
    ValidatorMetaData[] array = new ValidatorMetaData[manual.size()];
    gc.setEnabledManualValidators((ValidatorMetaData[])manual.toArray(array));
    
    array = new ValidatorMetaData[build.size()];
    gc.setEnabledBuildValidators((ValidatorMetaData[])build.toArray(array));
    
    gc.passivate();
    gc.store();
  }
  
  public void suspendAllValidation(boolean suspend)
  {
    _suspendAllValidation = suspend;
  }
  
  public boolean isSuspended()
  {
    return _suspendAllValidation;
  }
  
  public boolean isSuspended(IProject project)
  {
    if (_suspendAllValidation) {
      return true;
    }
    if (project == null) {
      return false;
    }
    return getSuspendedProjects().contains(project);
  }
  
  public boolean isProjectSuspended(IProject project)
  {
    if (project == null) {
      return false;
    }
    return getSuspendedProjects().contains(project);
  }
  
  public ValidationResults validate(IProject[] projects, boolean isManual, boolean isBuild, IProgressMonitor monitor)
    throws CoreException
  {
    ValType type = ValType.Build;
    if (isManual) {
      type = ValType.Manual;
    }
    ValOperation vo = ValidationRunner.validate(createMap(projects), type, monitor, true);
    return vo.getResults();
  }
  
  public ValidationResults validate(IFile file, IProgressMonitor monitor)
    throws CoreException
  {
    ValOperation vo = ValidationRunner.validate(file, ValType.Manual, monitor, true);
    return vo.getResults();
  }
  
  private Map<IProject, Set<IResource>> createMap(IProject[] projects)
    throws CoreException
  {
    HashMap<IProject, Set<IResource>> map = new HashMap(1000);
    IProject[] arrayOfIProject;
    int j = (arrayOfIProject = projects).length;
    for (int i = 0; i < j; i++)
    {
      IProject p = arrayOfIProject[i];
      Set<IResource> set = new HashSet(1000);
      ResourceAdder ra = new ResourceAdder(set);
      p.accept(ra);
      map.put(p, set);
    }
    return map;
  }
  
  public static class ResourceAdder
    implements IResourceVisitor
  {
    private Set<IResource> _set;
    
    public ResourceAdder(Set<IResource> set)
    {
      _set = set;
    }
    
    public boolean visit(IResource resource)
      throws CoreException
    {
      int type = resource.getType();
      if ((type == 1) || (type == 2)) {
        _set.add(resource);
      }
      return true;
    }
  }
  
  private static class Singleton
  {
    static ValidationFramework vf = new ValidationFramework(null);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationFramework
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;

public final class ValidationResult
{
  private final List<ValidatorMessage> _messages = new LinkedList();
  private static final ValidatorMessage[] _noMessages = new ValidatorMessage[0];
  private boolean _canceled;
  private IResource[] _dependsOn;
  private IResource[] _validated;
  private int _severityError;
  private int _severityWarning;
  private int _severityInfo;
  private IProject _suspendValidation;
  private int _numberOfValidatedResources = 1;
  private ReporterHelper _reporter;
  private ValidationException _validationException;
  
  public void add(ValidatorMessage message)
  {
    _messages.add(message);
  }
  
  public IReporter getReporter(IProgressMonitor monitor)
  {
    if (_reporter == null) {
      _reporter = new ReporterHelper(monitor);
    }
    return _reporter;
  }
  
  ReporterHelper getReporterHelper()
  {
    return _reporter;
  }
  
  public void mergeResults(ValidationResult result)
  {
    if (result == null) {
      return;
    }
    ValidatorMessage[] msgs = result.getMessages();
    ValidatorMessage[] arrayOfValidatorMessage1;
    int j = (arrayOfValidatorMessage1 = msgs).length;
    for (int i = 0; i < j; i++)
    {
      ValidatorMessage m = arrayOfValidatorMessage1[i];
      add(m);
      int severity = m.getAttribute("severity", 0);
      switch (severity)
      {
      case 2: 
        incrementError(1);
        break;
      case 1: 
        incrementWarning(1);
        break;
      case 0: 
        incrementInfo(1);
      }
    }
    incrementError(result.getSeverityError());
    incrementWarning(result.getSeverityWarning());
    incrementInfo(result.getSeverityInfo());
    
    _numberOfValidatedResources += result.getNumberOfValidatedResources();
  }
  
  public IResource[] getDependsOn()
  {
    return _dependsOn;
  }
  
  public ValidatorMessage[] getMessages()
  {
    if (_messages == null) {
      return _noMessages;
    }
    ValidatorMessage[] msgs = new ValidatorMessage[_messages.size()];
    _messages.toArray(msgs);
    return msgs;
  }
  
  public synchronized ValidatorMessage[] getMessagesAsCopy()
  {
    if (_messages == null) {
      return _noMessages;
    }
    ValidatorMessage[] msgs = new ValidatorMessage[_messages.size()];
    int i = 0;
    ValidatorMessage msg;
    for (Iterator localIterator = _messages.iterator(); localIterator.hasNext(); msgs[(i++)] = msg.asCopy()) {
      msg = (ValidatorMessage)localIterator.next();
    }
    return msgs;
  }
  
  public void setDependsOn(IResource[] dependsOn)
  {
    _dependsOn = dependsOn;
  }
  
  public IResource[] getValidated()
  {
    return _validated;
  }
  
  public void setValidated(IResource[] validated)
  {
    _validated = validated;
  }
  
  public int getSeverityError()
  {
    return _severityError;
  }
  
  public void setSeverityError(int severityError)
  {
    _severityError = severityError;
  }
  
  public int incrementError(int errors)
  {
    _severityError += errors;
    return _severityError;
  }
  
  public int getSeverityWarning()
  {
    return _severityWarning;
  }
  
  public void setSeverityWarning(int severityWarning)
  {
    _severityWarning = severityWarning;
  }
  
  public int incrementWarning(int warnings)
  {
    _severityWarning += warnings;
    return _severityWarning;
  }
  
  public int getSeverityInfo()
  {
    return _severityInfo;
  }
  
  public void setSeverityInfo(int severityInfo)
  {
    _severityInfo = severityInfo;
  }
  
  public int incrementInfo(int info)
  {
    _severityInfo += info;
    return _severityInfo;
  }
  
  public boolean isCanceled()
  {
    return _canceled;
  }
  
  public void setCanceled(boolean canceled)
  {
    _canceled = canceled;
  }
  
  public int getNumberOfValidatedResources()
  {
    if (_validated == null) {
      return _numberOfValidatedResources;
    }
    return _numberOfValidatedResources + _validated.length;
  }
  
  public ValidationException getValidationException()
  {
    return _validationException;
  }
  
  public void setValidationException(ValidationException validationException)
  {
    _validationException = validationException;
  }
  
  public IProject getSuspendValidation()
  {
    return _suspendValidation;
  }
  
  public void setSuspendValidation(IProject project)
  {
    _suspendValidation = project;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationResult
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

public final class ValidationResults
{
  private final ValidatorMessage[] _messages;
  private final int _error;
  private final int _warn;
  private final int _info;
  
  public ValidationResults(ValidationResult result)
  {
    if (result == null)
    {
      _messages = new ValidatorMessage[0];
      _error = 0;
      _warn = 0;
      _info = 0;
    }
    else
    {
      _messages = result.getMessagesAsCopy();
      _error = result.getSeverityError();
      _warn = result.getSeverityWarning();
      _info = result.getSeverityInfo();
    }
  }
  
  public ValidatorMessage[] getMessages()
  {
    return _messages;
  }
  
  public int getSeverityError()
  {
    return _error;
  }
  
  public int getSeverityInfo()
  {
    return _info;
  }
  
  public int getSeverityWarning()
  {
    return _warn;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationResults
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.HashMap;
import java.util.Map;

public final class ValidationState
{
  /**
   * @deprecated
   */
  public static final String TriggerResource = "org.eclipse.wst.validation.Trigger";
  private final Map<String, Object> _map = new HashMap(50);
  
  public synchronized void put(String id, Object value)
  {
    _map.put(id, value);
  }
  
  public synchronized Object get(String id)
  {
    return _map.get(id);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.ValidationState
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

public enum Validator$Level
{
  Extension,  Global,  Project;
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.Validator.Level
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import org.eclipse.core.resources.IProject;
import org.eclipse.wst.validation.internal.ValidationConfiguration;
import org.eclipse.wst.validation.internal.ValidatorMetaData;

public final class Validator$V1$V1Copy
  extends Validator.V1
{
  public Validator$V1$V1Copy(ValidatorMetaData vmd, ValidationConfiguration vc, IProject project)
  {
    super(vmd, vc, project);
  }
  
  public boolean setManualValidation(boolean bool)
  {
    return setManualValidation2(bool);
  }
  
  public boolean setBuildValidation(boolean bool)
  {
    return setBuildValidation2(bool);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.validation.Validator.V1.V1Copy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.validation;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.validation.internal.ContentTypeWrapper;
import org.eclipse.wst.validation.internal.SummaryReporter;
import org.eclipse.wst.validation.internal.ValOperation;
import org.eclipse.wst.validation.internal.ValidationConfiguration;
import org.eclipse.wst.validation.internal.ValidatorMetaData;
import org.eclipse.wst.validation.internal.core.ValidatorLauncher;
import org.eclipse.wst.validation.internal.delegates.ValidatorDelegatesRegistry;
import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
import org.eclipse.wst.validation.internal.plugin.ValidationPlugin;
import org.eclipse.wst.validation.internal.provisional.core.IValidator;
import org.eclipse.wst.validation.internal.provisional.core.IValidatorExtender;

public class Validator$V1
  extends Validator
{
  private ValidatorMetaData _vmd;
  private static final String VALIDATE_PROJECT_ONCE = "ValidateProjectOnce";
  
  public Validator$V1(ValidatorMetaData vmd, ValidationConfiguration config, IProject project)
  {
    super(project);
    _vmd = vmd;
    if (config != null)
    {
      setBuildValidation(config.isBuildEnabled(vmd));
      setManualValidation(config.isManualEnabled(vmd));
    }
    setDelegatingId(ValidatorDelegatesRegistry.getInstance().getDefaultDelegate(_vmd.getValidatorUniqueName()));
    if ((_vmd.getMarkerIds() != null) && (_vmd.getMarkerIds().length > 0)) {
      setMarkerId(_vmd.getMarkerIds()[0]);
    }
    resetChangeCounters();
  }
  
  public void validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor)
  {
    if (project != null)
    {
      IValidator v = asIValidator();
      if ((v instanceof IValidatorExtender))
      {
        IValidatorExtender vExt = (IValidatorExtender)v;
        vExt.validationFinishing(project, state, monitor);
      }
    }
  }
  
  public IValidator asIValidator()
  {
    IValidator v = null;
    try
    {
      v = _vmd.getValid
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

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