org.eclipse.cdt.codan.core_2.0.0.201202111925

16:41:35.925 INFO  jd.cli.Main - Decompiling org.eclipse.cdt.codan.core_2.0.0.201202111925.jar
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface INodeFactory
{
  public abstract IPlainNode createPlainNode();
  
  public abstract IJumpNode createJumpNode();
  
  public abstract IDecisionNode createDecisionNode();
  
  public abstract IConnectorNode createConnectorNode();
  
  public abstract IBranchNode createBranchNode(String paramString);
  
  public abstract IStartNode createStartNode();
  
  public abstract IExitNode createExitNode();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.INodeFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IBasicBlock
{
  public abstract IBasicBlock[] getIncomingNodes();
  
  public abstract IBasicBlock[] getOutgoingNodes();
  
  public abstract int getIncomingSize();
  
  public abstract int getOutgoingSize();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IBasicBlock
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IDecisionNode
  extends IBasicBlock, ISingleIncoming
{
  public abstract IConnectorNode getMergeNode();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IDecisionNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface ISingleIncoming
{
  public abstract IBasicBlock getIncoming();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.ISingleIncoming
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

import java.util.Collection;
import java.util.Iterator;

public abstract interface IControlFlowGraph
{
  public abstract IStartNode getStartNode();
  
  public abstract Iterator<IExitNode> getExitNodeIterator();
  
  public abstract int getExitNodeSize();
  
  public abstract Iterator<IBasicBlock> getUnconnectedNodeIterator();
  
  public abstract int getUnconnectedNodeSize();
  
  public abstract Collection<IBasicBlock> getNodes();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IControlFlowGraph
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface ISingleOutgoing
{
  public abstract IBasicBlock getOutgoing();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.ISingleOutgoing
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IConnectorNode
  extends IBasicBlock, ISingleOutgoing
{
  public abstract boolean hasBackwardIncoming();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IConnectorNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IExitNode
  extends IBasicBlock, ISingleIncoming
{
  public abstract IStartNode getStartNode();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IExitNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IStartNode
  extends IBasicBlock, ISingleOutgoing
{}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IStartNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IPlainNode
  extends IBasicBlock, ISingleOutgoing, ISingleIncoming
{}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IPlainNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IBranchNode
  extends IBasicBlock, ISingleIncoming, ISingleOutgoing
{
  public static final String THEN = "then";
  public static final String ELSE = "else";
  public static final String DEFAULT = "default";
  
  public abstract String getLabel();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IBranchNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface ICfgData
{
  public abstract Object getData();
  
  public abstract void setData(Object paramObject);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.ICfgData
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model.cfg;

public abstract interface IJumpNode
  extends IBasicBlock, ISingleOutgoing
{
  public abstract boolean isBackwardArc();
  
  public abstract IConnectorNode getJumpNode();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.cfg.IJumpNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.internal.core.CheckersRegistry;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.OperationCanceledException;

public abstract class AbstractChecker
  implements IChecker
{
  private ICheckerInvocationContext context;
  private IProblemReporter problemReporter;
  
  public boolean enabledInContext(IResource res)
  {
    return res instanceof IFile;
  }
  
  public void reportProblem(String id, IFile file, int lineNumber, Object... args)
  {
    getProblemReporter().reportProblem(id, createProblemLocation(file, lineNumber), args);
  }
  
  public IProblem getProblemById(String id, IResource file)
  {
    IProblem problem = CheckersRegistry.getInstance().getResourceProfile(file).findProblem(id);
    if (problem == null) {
      throw new IllegalArgumentException("Id is not registered");
    }
    return problem;
  }
  
  public List<IProblem> getProblemsByMainId(String id, IResource file)
  {
    ArrayList<IProblem> list = new ArrayList();
    IProblemProfile resourceProfile = CheckersRegistry.getInstance().getResourceProfile(file);
    IProblem[] problems = resourceProfile.getProblems();
    for (int i = 0; i < problems.length; i++)
    {
      IProblem p = problems[i];
      if (p.getId().equals(id)) {
        list.add(p);
      } else if (p.getId().startsWith(id + ".COPY")) {
        list.add(p);
      }
    }
    return list;
  }
  
  public void reportProblem(String id, IFile file, int lineNumber)
  {
    getProblemReporter().reportProblem(id, createProblemLocation(file, lineNumber), new Object[0]);
  }
  
  public IProblemReporter getProblemReporter()
  {
    return problemReporter;
  }
  
  protected CodanRuntime getRuntime()
  {
    return CodanRuntime.getInstance();
  }
  
  protected IProblemLocation createProblemLocation(IFile file, int line)
  {
    return getRuntime().getProblemLocationFactory().createProblemLocation(file, line);
  }
  
  protected IProblemLocation createProblemLocation(IFile file, int startChar, int endChar)
  {
    return getRuntime().getProblemLocationFactory().createProblemLocation(file, startChar, endChar);
  }
  
  public boolean runInEditor()
  {
    return this instanceof IRunnableInEditorChecker;
  }
  
  public void reportProblem(String problemId, IProblemLocation loc, Object... args)
  {
    getProblemReporter().reportProblem(problemId, loc, args);
  }
  
  protected ICheckerInvocationContext getContext()
  {
    return context;
  }
  
  protected void setContext(ICheckerInvocationContext context)
  {
    this.context = context;
  }
  
  public void before(IResource resource)
  {
    IProblemReporter problemReporter = CodanRuntime.getInstance().getProblemReporter();
    this.problemReporter = problemReporter;
    if ((problemReporter instanceof IProblemReporterSessionPersistent))
    {
      this.problemReporter = ((IProblemReporterSessionPersistent)problemReporter).createReporter(resource, this);
      ((IProblemReporterSessionPersistent)this.problemReporter).start();
    }
    else if ((problemReporter instanceof IProblemReporterPersistent))
    {
      ((IProblemReporterPersistent)problemReporter).deleteProblems(resource, this);
    }
  }
  
  public void after(IResource resource)
  {
    if ((problemReporter instanceof IProblemReporterSessionPersistent)) {
      ((IProblemReporterSessionPersistent)problemReporter).done();
    }
    problemReporter = null;
  }
  
  public abstract boolean processResource(IResource paramIResource)
    throws OperationCanceledException;
  
  public synchronized boolean processResource(IResource resource, ICheckerInvocationContext context)
    throws OperationCanceledException
  {
    setContext(context);
    try
    {
      return processResource(resource);
    }
    finally
    {
      setContext(null);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.AbstractChecker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IProblemMultiple
{
  public abstract boolean isMultiple();
  
  public abstract boolean isOriginal();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemMultiple
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IRunnableInEditorChecker
{
  public abstract void processModel(Object paramObject, ICheckerInvocationContext paramICheckerInvocationContext);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IRunnableInEditorChecker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface ICodanDisposable
{
  public abstract void dispose();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ICodanDisposable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import java.util.Collection;
import java.util.Iterator;
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.param.BasicProblemPreference;
import org.eclipse.cdt.codan.core.param.FileScopeProblemPreference;
import org.eclipse.cdt.codan.core.param.IProblemPreference;
import org.eclipse.cdt.codan.core.param.IProblemPreferenceDescriptor.PreferenceType;
import org.eclipse.cdt.codan.core.param.LaunchModeProblemPreference;
import org.eclipse.cdt.codan.core.param.ListProblemPreference;
import org.eclipse.cdt.codan.core.param.MapProblemPreference;
import org.eclipse.cdt.codan.core.param.RootProblemPreference;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;

public abstract class AbstractCheckerWithProblemPreferences
  extends AbstractChecker
  implements ICheckerWithPreferences
{
  public void initPreferences(IProblemWorkingCopy problem)
  {
    getTopLevelPreference(problem);
  }
  
  public FileScopeProblemPreference getScopePreference(IProblem problem)
  {
    return getTopLevelPreference(problem).getScopePreference();
  }
  
  public LaunchModeProblemPreference getLaunchModePreference(IProblem problem)
  {
    return getTopLevelPreference(problem).getLaunchModePreference();
  }
  
  public boolean shouldProduceProblems(IResource res)
  {
    Collection<IProblem> refProblems = getRuntime().getCheckersRegistry().getRefProblems(this);
    for (Iterator<IProblem> iterator = refProblems.iterator(); iterator.hasNext();)
    {
      IProblem checkerProblem = (IProblem)iterator.next();
      if (shouldProduceProblem(getProblemById(checkerProblem.getId(), res), res.getLocation())) {
        return true;
      }
    }
    return false;
  }
  
  public boolean shouldProduceProblem(IProblem problem, IPath resource)
  {
    FileScopeProblemPreference scope = getScopePreference(problem);
    if (scope == null) {
      return true;
    }
    return scope.isInScope(resource);
  }
  
  public void reportProblem(String problemId, IProblemLocation loc, Object... args)
  {
    if (shouldProduceProblem(getProblemById(problemId, loc.getFile()), 
      loc.getFile().getLocation())) {
      super.reportProblem(problemId, loc, args);
    }
  }
  
  public void reportProblem(IProblem pr, IProblemLocation loc, Object... args)
  {
    if (shouldProduceProblem(pr, loc.getFile().getLocation())) {
      super.reportProblem(pr.getId(), loc, args);
    }
  }
  
  public IProblemPreference addPreference(IProblemWorkingCopy problem, String key, String label, Object defaultValue)
  {
    MapProblemPreference map = getTopLevelPreference(problem);
    BasicProblemPreference info = new BasicProblemPreference(key, label, 
      IProblemPreferenceDescriptor.PreferenceType.typeOf(defaultValue));
    map.addChildDescriptor(info);
    setDefaultPreferenceValue(problem, key, defaultValue);
    return info;
  }
  
  public ListProblemPreference addListPreference(IProblemWorkingCopy problem, String key, String label, String itemLabel)
  {
    MapProblemPreference map = getTopLevelPreference(problem);
    ListProblemPreference list = new ListProblemPreference(key, label);
    list.setChildDescriptor(new BasicProblemPreference("#", 
      itemLabel, IProblemPreferenceDescriptor.PreferenceType.TYPE_STRING));
    return (ListProblemPreference)map.addChildDescriptor(list);
  }
  
  public IProblemPreference addPreference(IProblemWorkingCopy problem, IProblemPreference pref, Object defaultValue)
  {
    MapProblemPreference map = getTopLevelPreference(problem);
    String key = pref.getKey();
    pref = map.addChildDescriptor(pref);
    setDefaultPreferenceValue(problem, key, defaultValue);
    return pref;
  }
  
  protected void setDefaultPreferenceValue(IProblemWorkingCopy problem, String key, Object defaultValue)
  {
    MapProblemPreference map = getTopLevelPreference(problem);
    if (map.getChildValue(key) == null) {
      map.setChildValue(key, defaultValue);
    }
  }
  
  public RootProblemPreference getTopLevelPreference(IProblem problem)
  {
    RootProblemPreference map = (RootProblemPreference)problem.getPreference();
    if (map == null)
    {
      map = new RootProblemPreference();
      if ((problem instanceof IProblemWorkingCopy)) {
        ((IProblemWorkingCopy)problem).setPreference(map);
      }
    }
    return map;
  }
  
  public Object getPreference(IProblem problem, String key)
  {
    return ((MapProblemPreference)problem.getPreference()).getChildValue(key);
  }
  
  public boolean isFilteredArg(String arg, IProblem problem, String exceptionListParamId)
  {
    Object[] arr = (Object[])getPreference(problem, exceptionListParamId);
    for (int i = 0; i < arr.length; i++)
    {
      String str = (String)arr[i];
      if (arg.equals(str)) {
        return true;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.AbstractCheckerWithProblemPreferences
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IResource;

public abstract interface ICheckerInvocationContext
  extends ICodanDisposable
{
  public abstract IResource getResource();
  
  public abstract <T> T get(Class<T> paramClass);
  
  public abstract <T extends ICodanDisposable> void add(T paramT);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ICheckerInvocationContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.cdt.codan.core.param.IProblemPreference;

public abstract interface IProblem
  extends IProblemElement
{
  public abstract String getName();
  
  public abstract String getId();
  
  public abstract boolean isEnabled();
  
  public abstract CodanSeverity getSeverity();
  
  public abstract String getMessagePattern();
  
  public abstract IProblemPreference getPreference();
  
  public abstract String getDescription();
  
  public abstract String getMarkerType();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblem
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;

public abstract interface ICodanProblemMarker
{
  public static final String ID = "id";
  public static final String CATEGORY = "category";
  
  public abstract IProblemLocation getLocation();
  
  public abstract IProblem getProblem();
  
  public abstract IResource getResource();
  
  public abstract IMarker createMarker()
    throws CoreException;
  
  public abstract String createMessage();
  
  public abstract Object[] getArgs();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ICodanProblemMarker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IProblemReporter
{
  public static final String GENERIC_CODE_ANALYSIS_MARKER_TYPE = "org.eclipse.cdt.codan.core.codanProblem";
  
  public abstract void reportProblem(String paramString, IProblemLocation paramIProblemLocation, Object... paramVarArgs);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemReporter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IProblemElement
  extends Cloneable
{
  public abstract Object clone();
  
  public abstract IProblemProfile getProfile();
  
  public abstract IProblemCategory getParentCategory();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

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

public abstract class AbstractProblemLocation
  implements IProblemLocation
{
  protected IResource file;
  protected int line;
  protected int posStart;
  protected int posEnd;
  protected Object extra;
  
  protected AbstractProblemLocation(IFile file, int line)
  {
    this(file, line);
  }
  
  protected AbstractProblemLocation(IResource file, int line)
  {
    this.file = file;
    this.line = line;
    posStart = -1;
    posEnd = -1;
  }
  
  protected AbstractProblemLocation(IFile file, int startChar, int endChar)
  {
    this(file, startChar, endChar);
  }
  
  protected AbstractProblemLocation(IResource file, int startChar, int endChar)
  {
    this.file = file;
    line = -1;
    posStart = startChar;
    posEnd = endChar;
  }
  
  public Object getData()
  {
    return extra;
  }
  
  public void setData(Object data)
  {
    extra = data;
  }
  
  public IResource getFile()
  {
    return file;
  }
  
  public IResource getResource()
  {
    return file;
  }
  
  public int getLineNumber()
  {
    return getStartingLineNumber();
  }
  
  public int getStartingLineNumber()
  {
    return line;
  }
  
  public int getStartingChar()
  {
    return posStart;
  }
  
  public int getEndingChar()
  {
    return posEnd;
  }
  
  public int hashCode()
  {
    int result = 1;
    result = 31 * result + (extra == null ? 0 : extra.hashCode());
    result = 31 * result + (file == null ? 0 : file.hashCode());
    result = 31 * result + line;
    result = 31 * result + posEnd;
    result = 31 * result + posStart;
    return result;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof AbstractProblemLocation)) {
      return false;
    }
    AbstractProblemLocation other = (AbstractProblemLocation)obj;
    if (line != line) {
      return false;
    }
    if (posEnd != posEnd) {
      return false;
    }
    if (posStart != posStart) {
      return false;
    }
    if (extra == null)
    {
      if (extra != null) {
        return false;
      }
    }
    else if (!extra.equals(extra)) {
      return false;
    }
    if (file == null)
    {
      if (file != null) {
        return false;
      }
    }
    else if (!file.equals(file)) {
      return false;
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.AbstractProblemLocation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

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

public abstract interface IChecker
{
  public abstract boolean processResource(IResource paramIResource, ICheckerInvocationContext paramICheckerInvocationContext)
    throws OperationCanceledException;
  
  public abstract void before(IResource paramIResource);
  
  public abstract void after(IResource paramIResource);
  
  public abstract IProblemReporter getProblemReporter();
  
  public abstract boolean enabledInContext(IResource paramIResource);
  
  public abstract boolean runInEditor();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IChecker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface ICheckerWithPreferences
{
  public abstract void initPreferences(IProblemWorkingCopy paramIProblemWorkingCopy);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ICheckerWithPreferences
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.cdt.codan.core.Messages;

public enum CodanSeverity
{
  Info(
  
    0),  Warning(
  
    1),  Error(
  
    2);
  
  private int value;
  
  private CodanSeverity(int value)
  {
    this.value = value;
  }
  
  public int intValue()
  {
    return value;
  }
  
  public static String[] stringValues()
  {
    CodanSeverity[] values = values();
    String[] svalues = new String[values.length];
    for (int i = 0; i < values.length; i++)
    {
      CodanSeverity sev = values[i];
      svalues[i] = sev.toTranslatableString();
    }
    return svalues;
  }
  
  public static CodanSeverity valueOf(int intValue)
  {
    if (intValue == 0) {
      return Info;
    }
    if (intValue == 1) {
      return Warning;
    }
    if (intValue == 2) {
      return Error;
    }
    return null;
  }
  
  public String toTranslatableString()
  {
    switch (this)
    {
    case Error: 
      return Messages.CodanSeverity_Info;
    case Info: 
      return Messages.CodanSeverity_Warning;
    }
    return Messages.CodanSeverity_Error;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.CodanSeverity
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IProblemProfileChangeListener
{
  public abstract void profileChange(ProblemProfileChangeEvent paramProblemProfileChangeEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemProfileChangeListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IProblemCategory
  extends IProblemElement
{
  public abstract String getName();
  
  public abstract String getId();
  
  public abstract IProblemElement[] getChildren();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemCategory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public abstract interface IProblemProfile
  extends IProblemElement
{
  public abstract IProblemCategory getRoot();
  
  public abstract IProblem findProblem(String paramString);
  
  public abstract IProblemCategory findCategory(String paramString);
  
  public abstract IProblem[] getProblems();
  
  public abstract void addProfileChangeListener(IProblemProfileChangeListener paramIProblemProfileChangeListener);
  
  public abstract void removeProfileChangeListener(IProblemProfileChangeListener paramIProblemProfileChangeListener);
  
  public abstract Object getResource();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemProfile
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IResource;

public abstract interface IProblemReporterSessionPersistent
  extends IProblemReporter
{
  public abstract void deleteProblems(boolean paramBoolean);
  
  public abstract void start();
  
  public abstract void done();
  
  public abstract IChecker getChecker();
  
  public abstract IResource getResource();
  
  public abstract IProblemReporterSessionPersistent createReporter(IResource paramIResource, IChecker paramIChecker);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemReporterSessionPersistent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import java.util.Collection;
import java.util.Iterator;
import org.eclipse.core.resources.IResource;

public abstract interface ICheckersRegistry
  extends Iterable<IChecker>
{
  public abstract Iterator<IChecker> iterator();
  
  public abstract void addChecker(IChecker paramIChecker);
  
  public abstract void addProblem(IProblem paramIProblem, String paramString);
  
  public abstract void addCategory(IProblemCategory paramIProblemCategory, String paramString);
  
  public abstract void addRefProblem(IChecker paramIChecker, IProblem paramIProblem);
  
  public abstract Collection<IProblem> getRefProblems(IChecker paramIChecker);
  
  public abstract IProblemProfile getDefaultProfile();
  
  public abstract IProblemProfile getWorkspaceProfile();
  
  public abstract IProblemProfile getResourceProfile(IResource paramIResource);
  
  public abstract IProblemProfile getResourceProfileWorkingCopy(IResource paramIResource);
  
  public abstract void updateProfile(IResource paramIResource, IProblemProfile paramIProblemProfile);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ICheckersRegistry
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IResource;

public abstract interface IProblemReporterPersistent
  extends IProblemReporter
{
  public abstract void deleteProblems(IResource paramIResource, IChecker paramIChecker);
  
  public abstract void deleteProblems(IResource paramIResource);
  
  public abstract void deleteAllProblems();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemReporterPersistent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

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

public abstract interface ICodanBuilder
{
  public abstract void processResource(IResource paramIResource, IProgressMonitor paramIProgressMonitor);
  
  public abstract void processResource(IResource paramIResource, IProgressMonitor paramIProgressMonitor, CheckerLaunchMode paramCheckerLaunchMode);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ICodanBuilder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public enum CheckerLaunchMode
{
  RUN_ON_FULL_BUILD,  RUN_ON_INC_BUILD,  RUN_AS_YOU_TYPE,  RUN_ON_DEMAND;
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.CheckerLaunchMode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

public final class Checkers
{
  public static boolean canCheckerRunAsYouType(IChecker checker)
  {
    return (checker.runInEditor()) && ((checker instanceof IRunnableInEditorChecker));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.Checkers
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.cdt.codan.internal.core.CheckersRegistry;
import org.eclipse.cdt.codan.internal.core.model.CodanProblemMarker;
import org.eclipse.core.resources.IResource;

public abstract class AbstractProblemReporter
  implements IProblemReporter
{
  public void reportProblem(String id, IProblemLocation loc, Object... args)
  {
    IResource file = loc.getFile();
    if (file == null) {
      throw new NullPointerException("file");
    }
    if (id == null) {
      throw new NullPointerException("id");
    }
    IProblem problem = CheckersRegistry.getInstance().getResourceProfile(file).findProblem(id);
    if (problem == null) {
      throw new IllegalArgumentException("Id is not registered:" + id);
    }
    if (!problem.isEnabled()) {
      return;
    }
    ICodanProblemMarker codanProblemMarker = new CodanProblemMarker(problem, loc, args);
    reportProblem(codanProblemMarker);
  }
  
  protected abstract void reportProblem(ICodanProblemMarker paramICodanProblemMarker);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.AbstractProblemReporter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import java.util.EventObject;

public final class ProblemProfileChangeEvent
  extends EventObject
{
  private static final long serialVersionUID = 1L;
  private String key;
  private Object newValue;
  private Object oldValue;
  private Object resource;
  private IProblemProfile profile;
  public static final String PROBLEM_KEY = "problem";
  public static final String PROBLEM_PREF_KEY = "problem_params";
  
  public ProblemProfileChangeEvent(IProblemProfile profile, Object resource, String key, Object oldValue, Object newValue)
  {
    super(resource);
    this.key = key;
    this.newValue = newValue;
    this.oldValue = oldValue;
    this.profile = profile;
    this.resource = resource;
  }
  
  public Object getResource()
  {
    return resource;
  }
  
  public IProblemProfile getProfile()
  {
    return profile;
  }
  
  public String getKey()
  {
    return key;
  }
  
  public Object getNewValue()
  {
    return newValue;
  }
  
  public Object getOldValue()
  {
    return oldValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.ProblemProfileChangeEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IResource;

public abstract interface IProblemLocation
{
  public abstract IResource getFile();
  
  public abstract int getLineNumber();
  
  public abstract int getStartingChar();
  
  public abstract int getEndingChar();
  
  public abstract Object getData();
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemLocation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.cdt.codan.core.param.IProblemPreference;

public abstract interface IProblemWorkingCopy
  extends IProblem
{
  public abstract void setSeverity(CodanSeverity paramCodanSeverity);
  
  public abstract void setEnabled(boolean paramBoolean);
  
  public abstract void setMessagePattern(String paramString);
  
  public abstract void setPreference(IProblemPreference paramIProblemPreference);
  
  public abstract void setDescription(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemWorkingCopy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.model;

import org.eclipse.core.resources.IFile;

public abstract interface IProblemLocationFactory
{
  public abstract IProblemLocation createProblemLocation(IFile paramIFile, int paramInt);
  
  public abstract IProblemLocation createProblemLocation(IFile paramIFile, int paramInt1, int paramInt2);
  
  public abstract IProblemLocation createProblemLocation(IFile paramIFile, int paramInt1, int paramInt2, int paramInt3);
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.model.IProblemLocationFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.param;

import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class MapProblemPreference
  extends AbstractProblemPreference
  implements IProblemPreferenceCompositeValue, IProblemPreferenceCompositeDescriptor
{
  protected LinkedHashMap<String, IProblemPreference> hash = new LinkedHashMap();
  
  public MapProblemPreference() {}
  
  public MapProblemPreference(String key, String label)
  {
    setKey(key);
    setLabel(label);
  }
  
  public IProblemPreferenceDescriptor.PreferenceType getType()
  {
    return IProblemPreferenceDescriptor.PreferenceType.TYPE_MAP;
  }
  
  public IProblemPreference getChildDescriptor(String key)
  {
    return (IProblemPreference)hash.get(key);
  }
  
  public IProblemPreference addChildDescriptor(IProblemPreference desc)
  {
    ((AbstractProblemPreference)desc).setParent(this);
    hash.put(desc.getKey(), desc);
    return desc;
  }
  
  public IProblemPreference[] getChildDescriptors()
  {
    return (IProblemPreference[])hash.values().toArray(new IProblemPreference[hash.values().size()]);
  }
  
  public Object getChildValue(String key)
  {
    IProblemPreference childInfo = getChildDescriptor(key);
    return childInfo.getValue();
  }
  
  public void setChildValue(String key, Object value)
  {
    IProblemPreference pref = getChildDescriptor(key);
    if (pref == null) {
      throw new IllegalArgumentException("Preference for " + key + 
        " must exists before setting its value");
    }
    pref.setValue(value);
    hash.put(key, pref);
  }
  
  public void removeChildValue(String key)
  {
    hash.remove(key);
  }
  
  public Object clone()
  {
    MapProblemPreference map = (MapProblemPreference)super.clone();
    hash = new LinkedHashMap();
    for (Iterator<String> iterator = hash.keySet().iterator(); iterator.hasNext();)
    {
      String key = (String)iterator.next();
      hash.put(key, (IProblemPreference)((IProblemPreference)hash.get(key)).clone());
    }
    return map;
  }
  
  public String exportValue()
  {
    StringBuffer buf = new StringBuffer("{");
    for (Iterator<String> iterator = hash.keySet().iterator(); iterator.hasNext();)
    {
      String key = (String)iterator.next();
      IProblemPreference d = (IProblemPreference)hash.get(key);
      if ((!(d instanceof AbstractProblemPreference)) || 
        (!((AbstractProblemPreference)d).isDefault()))
      {
        buf.append(key + "=>" + d.exportValue());
        if (iterator.hasNext()) {
          buf.append(",");
        }
      }
    }
    return buf.toString() + "}";
  }
  
  public void importValue(String str)
  {
    StreamTokenizer tokenizer = getImportTokenizer(str);
    try
    {
      importValue(tokenizer);
    }
    catch (IllegalArgumentException e)
    {
      throw new IllegalArgumentException(str + ":" + e.toString(), e);
    }
  }
  
  public void importValue(StreamTokenizer tokenizer)
  {
    try
    {
      int token = tokenizer.nextToken();
      if (token != 123) {
        throw new IllegalArgumentException(String.valueOf((char)token));
      }
      do
      {
        token = tokenizer.nextToken();
        if (token == 125) {
          break;
        }
        String key = sval;
        token = tokenizer.nextToken();
        if (token != 61) {
          throw new IllegalArgumentException(String.valueOf((char)token));
        }
        token = tokenizer.nextToken();
        if (token != 62) {
          throw new IllegalArgumentException(String.valueOf((char)token));
        }
        importChildValue(key, tokenizer);
        token = tokenizer.nextToken();
        if (token == 125) {
          break;
        }
      } while (token == 44);
      throw new IllegalArgumentException(String.valueOf((char)token));
    }
    catch (IOException e)
    {
      throw new IllegalArgumentException(e);
    }
    int token;
  }
  
  protected IProblemPreference importChildValue(String key, StreamTokenizer tokenizer)
    throws IOException
  {
    IProblemPreference desc = getChildDescriptor(key);
    if ((desc != null) && ((desc instanceof AbstractProblemPreference)))
    {
      ((AbstractProblemPreference)desc).importValue(tokenizer);
      setChildValue(key, desc.getValue());
    }
    return desc;
  }
  
  public void removeChildDescriptor(IProblemPreference info)
  {
    hash.remove(info.getKey());
  }
  
  public int size()
  {
    return hash.size();
  }
  
  public void clear()
  {
    hash.clear();
  }
  
  public String toString()
  {
    return hash.values().toString();
  }
  
  public Object getValue()
  {
    LinkedHashMap<String, Object> map = new LinkedHashMap();
    for (Iterator<IProblemPreference> iterator = hash.values().iterator(); iterator.hasNext();)
    {
      IProblemPreference pref = (IProblemPreference)iterator.next();
      map.put(pref.getKey(), pref.getValue());
    }
    return map;
  }
  
  public void setValue(Object value)
  {
    Map<String, Object> map = (Map)value;
    LinkedHashMap<String, IProblemPreference> hash2 = (LinkedHashMap)hash.clone();
    hash.clear();
    for (Iterator<String> iterator = map.keySet().iterator(); iterator.hasNext();)
    {
      String key = (String)iterator.next();
      Object value2 = map.get(key);
      if ((value2 instanceof IProblemPreference))
      {
        hash.put(key, (IProblemPreference)value2);
      }
      else
      {
        IProblemPreference pref = (IProblemPreference)hash2.get(key);
        addChildDescriptor(pref);
        
        pref.setValue(value2);
        hash.put(key, pref);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.cdt.codan.core.param.MapProblemPreference
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.cdt.codan.core.param;

import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.cdt.codan.core.Messages;
import org.eclipse.cdt.codan.internal.core.CharOperation;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;

public class FileScopeProblemPreference
  extends AbstractProblemPreference
{
  public static final String KEY = "fileScope";
  public static final String EXCLUSION = "exclusion";
  public static final String INCLUSION = "inclusion";
  private IResource resource;
  private IPath[] inclusion = new IPath[0];
  private IPath[] exclusion = new IPath[0];
  
  public FileScopeProblemPreference()
  {
    setKey("fileScope");
    setLabel(Messages.FileScopeProblemPreference_Label);
  }
  
  public IProblemPreferenceDescriptor.PreferenceType getType()
  {
    return IProblemPreferenceDescriptor.PreferenceType.TYPE_CUSTOM;
  }
  
  public IPath[] getAttribute(String key)
  {
    if (key == "exclusion") {
      return exclusion;
    }
    if (key == "inclusion") {
      return inclusion;
    }
    return null;
  }
  
  public void setAttribute(String key, IPath[] value)
  {
    if (key == "exclusion") {
      exclusion = ((IPath[])value.clone());
    }
    if (key == "inclu
1 2 3 4 5 6

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd