org.eclipse.jdt.core.manipulation_1.4.0.v20110928-1453

16:45:01.596 INFO  jd.cli.Main - Decompiling org.eclipse.jdt.core.manipulation_1.4.0.v20110928-1453.jar
package org.eclipse.jdt.core.manipulation;

public class JavaManipulation
{
  public static final String ID_PLUGIN = "org.eclipse.jdt.core.manipulation";
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.manipulation.JavaManipulation
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.internal.core.manipulation.JavaManipulationPlugin;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.ChangeDescriptor;
import org.eclipse.ltk.core.refactoring.ContentStamp;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.text.edits.UndoEdit;

public class CompilationUnitChange
  extends TextFileChange
{
  private final ICompilationUnit fCUnit;
  private ChangeDescriptor fDescriptor;
  
  public CompilationUnitChange(String name, ICompilationUnit cunit)
  {
    super(name, getFile(cunit));
    Assert.isNotNull(cunit);
    fCUnit = cunit;
    setTextType("java");
  }
  
  private static IFile getFile(ICompilationUnit cunit)
  {
    return (IFile)cunit.getResource();
  }
  
  public Object getModifiedElement()
  {
    return fCUnit;
  }
  
  public ICompilationUnit getCompilationUnit()
  {
    return fCUnit;
  }
  
  protected IDocument acquireDocument(IProgressMonitor pm)
    throws CoreException
  {
    pm.beginTask("", 2);
    fCUnit.becomeWorkingCopy(new SubProgressMonitor(pm, 1));
    return super.acquireDocument(new SubProgressMonitor(pm, 1));
  }
  
  /* Error */
  protected void releaseDocument(IDocument document, IProgressMonitor pm)
    throws CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 155	org/eclipse/jdt/core/refactoring/CompilationUnitChange:isDocumentModified	()Z
    //   4: istore_3
    //   5: aload_0
    //   6: aload_1
    //   7: aload_2
    //   8: invokespecial 163	org/eclipse/ltk/core/refactoring/TextFileChange:releaseDocument	(Lorg/eclipse/jface/text/IDocument;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   11: aload_0
    //   12: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   15: invokeinterface 166 1 0
    //   20: goto +58 -> 78
    //   23: astore 4
    //   25: iload_3
    //   26: ifeq +49 -> 75
    //   29: aload_0
    //   30: invokevirtual 154	org/eclipse/jdt/core/refactoring/CompilationUnitChange:isDocumentAcquired	()Z
    //   33: ifne +42 -> 75
    //   36: aload_0
    //   37: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   40: invokeinterface 167 1 0
    //   45: ifeq +20 -> 65
    //   48: aload_0
    //   49: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   52: iconst_0
    //   53: iconst_0
    //   54: aconst_null
    //   55: aconst_null
    //   56: invokeinterface 171 5 0
    //   61: pop
    //   62: goto +13 -> 75
    //   65: aload_0
    //   66: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   69: aload_2
    //   70: invokeinterface 170 2 0
    //   75: aload 4
    //   77: athrow
    //   78: iload_3
    //   79: ifeq +49 -> 128
    //   82: aload_0
    //   83: invokevirtual 154	org/eclipse/jdt/core/refactoring/CompilationUnitChange:isDocumentAcquired	()Z
    //   86: ifne +42 -> 128
    //   89: aload_0
    //   90: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   93: invokeinterface 167 1 0
    //   98: ifeq +20 -> 118
    //   101: aload_0
    //   102: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   105: iconst_0
    //   106: iconst_0
    //   107: aconst_null
    //   108: aconst_null
    //   109: invokeinterface 171 5 0
    //   114: pop
    //   115: goto +13 -> 128
    //   118: aload_0
    //   119: getfield 145	org/eclipse/jdt/core/refactoring/CompilationUnitChange:fCUnit	Lorg/eclipse/jdt/core/ICompilationUnit;
    //   122: aload_2
    //   123: invokeinterface 170 2 0
    //   128: return
    // Line number table:
    //   Java source line #91	-> byte code offset #0
    //   Java source line #92	-> byte code offset #5
    //   Java source line #94	-> byte code offset #11
    //   Java source line #95	-> byte code offset #23
    //   Java source line #96	-> byte code offset #25
    //   Java source line #97	-> byte code offset #36
    //   Java source line #98	-> byte code offset #48
    //   Java source line #99	-> byte code offset #52
    //   Java source line #100	-> byte code offset #53
    //   Java source line #101	-> byte code offset #54
    //   Java source line #102	-> byte code offset #55
    //   Java source line #98	-> byte code offset #56
    //   Java source line #105	-> byte code offset #65
    //   Java source line #107	-> byte code offset #75
    //   Java source line #96	-> byte code offset #78
    //   Java source line #97	-> byte code offset #89
    //   Java source line #98	-> byte code offset #101
    //   Java source line #99	-> byte code offset #105
    //   Java source line #100	-> byte code offset #106
    //   Java source line #101	-> byte code offset #107
    //   Java source line #102	-> byte code offset #108
    //   Java source line #98	-> byte code offset #109
    //   Java source line #105	-> byte code offset #118
    //   Java source line #108	-> byte code offset #128
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	129	0	this	CompilationUnitChange
    //   0	129	1	document	IDocument
    //   0	129	2	pm	IProgressMonitor
    //   4	75	3	isModified	boolean
    //   23	53	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   11	23	23	finally
  }
  
  protected Change createUndoChange(UndoEdit edit, ContentStamp stampToRestore)
  {
    try
    {
      return new UndoCompilationUnitChange(getName(), fCUnit, edit, stampToRestore, getSaveMode());
    }
    catch (CoreException e)
    {
      JavaManipulationPlugin.log(e);
    }
    return null;
  }
  
  public Object getAdapter(Class adapter)
  {
    if (ICompilationUnit.class.equals(adapter)) {
      return fCUnit;
    }
    return super.getAdapter(adapter);
  }
  
  public void setDescriptor(ChangeDescriptor descriptor)
  {
    fDescriptor = descriptor;
  }
  
  public ChangeDescriptor getDescriptor()
  {
    return fDescriptor;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.CompilationUnitChange
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring;

import org.eclipse.jdt.core.IJavaElement;

public abstract interface IJavaElementMapper
{
  public abstract IJavaElement getRefactoredJavaElement(IJavaElement paramIJavaElement);
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.IJavaElementMapper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring;

public abstract interface IJavaRefactorings
{
  public static final String CHANGE_METHOD_SIGNATURE = "org.eclipse.jdt.ui.change.method.signature";
  public static final String CONVERT_ANONYMOUS = "org.eclipse.jdt.ui.convert.anonymous";
  public static final String CONVERT_LOCAL_VARIABLE = "org.eclipse.jdt.ui.promote.temp";
  public static final String CONVERT_MEMBER_TYPE = "org.eclipse.jdt.ui.move.inner";
  public static final String COPY = "org.eclipse.jdt.ui.copy";
  public static final String DELETE = "org.eclipse.jdt.ui.delete";
  public static final String ENCAPSULATE_FIELD = "org.eclipse.jdt.ui.self.encapsulate";
  public static final String EXTRACT_CLASS = "org.eclipse.jdt.ui.extract.class";
  public static final String EXTRACT_CONSTANT = "org.eclipse.jdt.ui.extract.constant";
  public static final String EXTRACT_INTERFACE = "org.eclipse.jdt.ui.extract.interface";
  public static final String EXTRACT_LOCAL_VARIABLE = "org.eclipse.jdt.ui.extract.temp";
  public static final String EXTRACT_METHOD = "org.eclipse.jdt.ui.extract.method";
  public static final String EXTRACT_SUPERCLASS = "org.eclipse.jdt.ui.extract.superclass";
  public static final String GENERALIZE_TYPE = "org.eclipse.jdt.ui.change.type";
  public static final String INFER_TYPE_ARGUMENTS = "org.eclipse.jdt.ui.infer.typearguments";
  public static final String INLINE_CONSTANT = "org.eclipse.jdt.ui.inline.constant";
  public static final String INLINE_LOCAL_VARIABLE = "org.eclipse.jdt.ui.inline.temp";
  public static final String INLINE_METHOD = "org.eclipse.jdt.ui.inline.method";
  public static final String INTRODUCE_FACTORY = "org.eclipse.jdt.ui.introduce.factory";
  public static final String INTRODUCE_INDIRECTION = "org.eclipse.jdt.ui.introduce.indirection";
  public static final String INTRODUCE_PARAMETER = "org.eclipse.jdt.ui.introduce.parameter";
  public static final String INTRODUCE_PARAMETER_OBJECT = "org.eclipse.jdt.ui.introduce.parameter.object";
  public static final String MOVE = "org.eclipse.jdt.ui.move";
  public static final String MOVE_METHOD = "org.eclipse.jdt.ui.move.method";
  public static final String MOVE_STATIC_MEMBERS = "org.eclipse.jdt.ui.move.static";
  public static final String PULL_UP = "org.eclipse.jdt.ui.pull.up";
  public static final String PUSH_DOWN = "org.eclipse.jdt.ui.push.down";
  public static final String RENAME_COMPILATION_UNIT = "org.eclipse.jdt.ui.rename.compilationunit";
  public static final String RENAME_ENUM_CONSTANT = "org.eclipse.jdt.ui.rename.enum.constant";
  public static final String RENAME_FIELD = "org.eclipse.jdt.ui.rename.field";
  public static final String RENAME_JAVA_PROJECT = "org.eclipse.jdt.ui.rename.java.project";
  public static final String RENAME_LOCAL_VARIABLE = "org.eclipse.jdt.ui.rename.local.variable";
  public static final String RENAME_METHOD = "org.eclipse.jdt.ui.rename.method";
  public static final String RENAME_PACKAGE = "org.eclipse.jdt.ui.rename.package";
  /**
   * @deprecated
   */
  public static final String RENAME_RESOURCE = "org.eclipse.jdt.ui.rename.resource";
  public static final String RENAME_SOURCE_FOLDER = "org.eclipse.jdt.ui.rename.source.folder";
  public static final String RENAME_TYPE = "org.eclipse.jdt.ui.rename.type";
  public static final String RENAME_TYPE_PARAMETER = "org.eclipse.jdt.ui.rename.type.parameter";
  public static final String USE_SUPER_TYPE = "org.eclipse.jdt.ui.use.supertype";
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.IJavaRefactorings
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring;

import org.eclipse.core.runtime.Assert;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.ltk.core.refactoring.participants.RenameArguments;

public class RenameTypeArguments
  extends RenameArguments
{
  private boolean updateSimilarDeclarations;
  private IJavaElement[] similarDeclarations;
  
  public RenameTypeArguments(String newName, boolean updateReferences, boolean updateSimilarDeclarations, IJavaElement[] similarDeclarations)
  {
    super(newName, updateReferences);
    if (updateSimilarDeclarations) {
      Assert.isNotNull(similarDeclarations);
    }
    this.updateSimilarDeclarations = updateSimilarDeclarations;
    this.similarDeclarations = similarDeclarations;
  }
  
  public boolean getUpdateSimilarDeclarations()
  {
    return updateSimilarDeclarations;
  }
  
  public IJavaElement[] getSimilarDeclarations()
  {
    return similarDeclarations;
  }
  
  public String toString()
  {
    return 
      super.toString() + (updateSimilarDeclarations ? " (update derived elements)" : " (don't update derived elements)");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.RenameTypeArguments
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.internal.core.manipulation.JavaManipulationMessages;
import org.eclipse.jdt.internal.core.manipulation.JavaManipulationPlugin;
import org.eclipse.jdt.internal.core.manipulation.Messages;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.ContentStamp;
import org.eclipse.ltk.core.refactoring.UndoTextFileChange;
import org.eclipse.osgi.util.TextProcessor;
import org.eclipse.text.edits.UndoEdit;

class UndoCompilationUnitChange
  extends UndoTextFileChange
{
  private ICompilationUnit fCUnit;
  
  public UndoCompilationUnitChange(String name, ICompilationUnit unit, UndoEdit undo, ContentStamp stampToRestore, int saveMode)
    throws CoreException
  {
    super(name, getFile(unit), undo, stampToRestore, saveMode);
    fCUnit = unit;
  }
  
  private static IFile getFile(ICompilationUnit cunit)
    throws CoreException
  {
    IFile file = (IFile)cunit.getResource();
    if (file == null)
    {
      String message = Messages.format(JavaManipulationMessages.UndoCompilationUnitChange_no_file, TextProcessor.process(cunit.getElementName()));
      throw new CoreException(new Status(4, JavaManipulationPlugin.getPluginId(), message));
    }
    return file;
  }
  
  public Object getModifiedElement()
  {
    return fCUnit;
  }
  
  protected Change createUndoChange(UndoEdit edit, ContentStamp stampToRestore)
    throws CoreException
  {
    return new UndoCompilationUnitChange(getName(), fCUnit, edit, stampToRestore, getSaveMode());
  }
  
  public Change perform(IProgressMonitor pm)
    throws CoreException
  {
    pm.beginTask("", 2);
    fCUnit.becomeWorkingCopy(new SubProgressMonitor(pm, 1));
    try
    {
      return super.perform(new SubProgressMonitor(pm, 1));
    }
    finally
    {
      fCUnit.discardWorkingCopy();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.UndoCompilationUnitChange
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ChangeMethodSignatureDescriptor
  extends JavaRefactoringDescriptor
{
  public ChangeMethodSignatureDescriptor()
  {
    super("org.eclipse.jdt.ui.change.method.signature");
  }
  
  public ChangeMethodSignatureDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.change.method.signature", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ChangeMethodSignatureDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ConvertAnonymousDescriptor
  extends JavaRefactoringDescriptor
{
  public ConvertAnonymousDescriptor()
  {
    super("org.eclipse.jdt.ui.convert.anonymous");
  }
  
  public ConvertAnonymousDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.convert.anonymous", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ConvertAnonymousDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ConvertLocalVariableDescriptor
  extends JavaRefactoringDescriptor
{
  public ConvertLocalVariableDescriptor()
  {
    super("org.eclipse.jdt.ui.promote.temp");
  }
  
  public ConvertLocalVariableDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.promote.temp", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ConvertLocalVariableDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ConvertMemberTypeDescriptor
  extends JavaRefactoringDescriptor
{
  public ConvertMemberTypeDescriptor()
  {
    super("org.eclipse.jdt.ui.move.inner");
  }
  
  public ConvertMemberTypeDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.move.inner", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ConvertMemberTypeDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class CopyDescriptor
  extends JavaRefactoringDescriptor
{
  public CopyDescriptor()
  {
    super("org.eclipse.jdt.ui.copy");
  }
  
  public CopyDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.copy", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.CopyDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class DeleteDescriptor
  extends JavaRefactoringDescriptor
{
  public DeleteDescriptor()
  {
    super("org.eclipse.jdt.ui.delete");
  }
  
  public DeleteDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.delete", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.DeleteDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class EncapsulateFieldDescriptor
  extends JavaRefactoringDescriptor
{
  public EncapsulateFieldDescriptor()
  {
    super("org.eclipse.jdt.ui.self.encapsulate");
  }
  
  public EncapsulateFieldDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.self.encapsulate", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.EncapsulateFieldDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import org.eclipse.core.runtime.Assert;

public class ExtractClassDescriptor$Field
{
  private final String fFieldName;
  private String fNewFieldName;
  private boolean fCreateField = true;
  
  ExtractClassDescriptor$Field(String paramString, Field paramField)
  {
    this(paramString);
  }
  
  private ExtractClassDescriptor$Field(String fieldName)
  {
    Assert.isNotNull(fieldName);
    fFieldName = fieldName;
    fNewFieldName = fieldName;
  }
  
  public String getFieldName()
  {
    return fFieldName;
  }
  
  public String getNewFieldName()
  {
    return fNewFieldName;
  }
  
  public void setNewFieldName(String newFieldName)
  {
    Assert.isNotNull(newFieldName);
    fNewFieldName = newFieldName;
  }
  
  public int hashCode()
  {
    int result = 1;
    result = 31 * result + (fFieldName == null ? 0 : fFieldName.hashCode());
    return result;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    Field other = (Field)obj;
    if (fFieldName == null)
    {
      if (fFieldName != null) {
        return false;
      }
    }
    else if (!fFieldName.equals(fFieldName)) {
      return false;
    }
    return true;
  }
  
  public String toString()
  {
    return "Field:" + fFieldName + " new name:" + fNewFieldName + " create field:" + fCreateField;
  }
  
  public boolean isCreateField()
  {
    return fCreateField;
  }
  
  public void setCreateField(boolean createField)
  {
    fCreateField = createField;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor.Field
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.ArrayList;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.core.refactoring.descriptors.JavaRefactoringDescriptorUtil;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;

public class ExtractClassDescriptor
  extends JavaRefactoringDescriptor
{
  private static final String CREATE_GETTER_SETTER = "createGetterSetter";
  private static final String PACKAGE_NAME = "packageName";
  private static final String CLASS_NAME = "className";
  private static final String FIELD_NAME = "fieldName";
  private static final String CREATE_TOP_LEVEL = "createTopLevel";
  private static final String NEW_FIELD_COUNT = "newFieldCount";
  private static final String CREATE_FIELD_COUNT = "createFieldCount";
  private static final String CREATE_FIELD = "createField";
  private static final String NEW_FIELD_NAME = "newFieldName";
  private static final String OLD_FIELD_NAME = "oldFieldName";
  private static final String OLD_FIELD_COUNT = "oldFieldCount";
  private Field[] fFields;
  
  public static class Field
  {
    private final String fFieldName;
    private String fNewFieldName;
    private boolean fCreateField = true;
    
    Field(String paramString, Field paramField)
    {
      this(paramString);
    }
    
    private Field(String fieldName)
    {
      Assert.isNotNull(fieldName);
      fFieldName = fieldName;
      fNewFieldName = fieldName;
    }
    
    public String getFieldName()
    {
      return fFieldName;
    }
    
    public String getNewFieldName()
    {
      return fNewFieldName;
    }
    
    public void setNewFieldName(String newFieldName)
    {
      Assert.isNotNull(newFieldName);
      fNewFieldName = newFieldName;
    }
    
    public int hashCode()
    {
      int result = 1;
      result = 31 * result + (fFieldName == null ? 0 : fFieldName.hashCode());
      return result;
    }
    
    public boolean equals(Object obj)
    {
      if (this == obj) {
        return true;
      }
      if (obj == null) {
        return false;
      }
      if (getClass() != obj.getClass()) {
        return false;
      }
      Field other = (Field)obj;
      if (fFieldName == null)
      {
        if (fFieldName != null) {
          return false;
        }
      }
      else if (!fFieldName.equals(fFieldName)) {
        return false;
      }
      return true;
    }
    
    public String toString()
    {
      return "Field:" + fFieldName + " new name:" + fNewFieldName + " create field:" + fCreateField;
    }
    
    public boolean isCreateField()
    {
      return fCreateField;
    }
    
    public void setCreateField(boolean createField)
    {
      fCreateField = createField;
    }
  }
  
  public ExtractClassDescriptor()
  {
    super("org.eclipse.jdt.ui.extract.class");
  }
  
  public ExtractClassDescriptor(String project, String description, String comment, Map arguments, int flags)
    throws IllegalArgumentException
  {
    super("org.eclipse.jdt.ui.extract.class", project, description, comment, arguments, flags);
    if (JavaRefactoringDescriptorUtil.getString(arguments, "oldFieldCount", true) != null)
    {
      String[] oldFieldNames = JavaRefactoringDescriptorUtil.getStringArray(arguments, "oldFieldCount", "oldFieldName", 0);
      boolean[] createField = JavaRefactoringDescriptorUtil.getBooleanArray(arguments, "createFieldCount", "createField", 0);
      fFields = new Field[oldFieldNames.length];
      for (int i = 0; i < oldFieldNames.length; i++)
      {
        fFields[i] = new Field(oldFieldNames[i], null);
        fFields[i].setCreateField(createField[i]);
        if (createField[i] != 0) {
          fFields[i].setNewFieldName(JavaRefactoringDescriptorUtil.getString(arguments, JavaRefactoringDescriptorUtil.getAttributeName("newFieldName", i)));
        }
      }
    }
  }
  
  public static Field[] getFields(IType type)
    throws JavaModelException
  {
    IField[] fields = type.getFields();
    ArrayList result = new ArrayList();
    for (int i = 0; i < fields.length; i++)
    {
      IField field = fields[i];
      if ((!Flags.isStatic(field.getFlags())) && (!field.isEnumConstant())) {
        result.add(new Field(field.getElementName(), null));
      }
    }
    return (Field[])result.toArray(new Field[result.size()]);
  }
  
  public void setFields(Field[] fields)
    throws IllegalArgumentException
  {
    for (int i = 0; i < fields.length; i++)
    {
      Field field = fields[i];
      if (field == null) {
        throw new IllegalArgumentException("Field can not be null");
      }
    }
    fFields = fields;
  }
  
  public Field[] getFields()
  {
    return fFields;
  }
  
  public IType getType()
  {
    return (IType)JavaRefactoringDescriptorUtil.getJavaElement(fArguments, "input", getProject());
  }
  
  public void setType(IType type)
  {
    Assert.isNotNull(type);
    String project = type.getJavaProject().getElementName();
    setProject(project);
    JavaRefactoringDescriptorUtil.setJavaElement(fArguments, "input", project, type);
  }
  
  public String getPackage()
  {
    return JavaRefactoringDescriptorUtil.getString(fArguments, "packageName", true);
  }
  
  public void setPackage(String packageName)
  {
    JavaRefactoringDescriptorUtil.setString(fArguments, "packageName", packageName);
  }
  
  public String getClassName()
  {
    return JavaRefactoringDescriptorUtil.getString(fArguments, "className", true);
  }
  
  public void setClassName(String className)
  {
    JavaRefactoringDescriptorUtil.setString(fArguments, "className", className);
  }
  
  public String getFieldName()
  {
    return JavaRefactoringDescriptorUtil.getString(fArguments, "fieldName", true);
  }
  
  public void setFieldName(String fieldName)
  {
    JavaRefactoringDescriptorUtil.setString(fArguments, "fieldName", fieldName);
  }
  
  public boolean isCreateTopLevel()
  {
    return JavaRefactoringDescriptorUtil.getBoolean(fArguments, "createTopLevel", true);
  }
  
  public void setCreateTopLevel(boolean createTopLevel)
  {
    JavaRefactoringDescriptorUtil.setBoolean(fArguments, "createTopLevel", createTopLevel);
  }
  
  public void setCreateGetterSetter(boolean createGetterSetter)
  {
    JavaRefactoringDescriptorUtil.setBoolean(fArguments, "createGetterSetter", createGetterSetter);
  }
  
  public boolean isCreateGetterSetter()
  {
    return JavaRefactoringDescriptorUtil.getBoolean(fArguments, "createGetterSetter", false);
  }
  
  protected void populateArgumentMap()
  {
    super.populateArgumentMap();
    if (fFields != null)
    {
      String[] oldFieldNames = new String[fFields.length];
      String[] newFieldNames = new String[fFields.length];
      boolean[] createField = new boolean[fFields.length];
      for (int i = 0; i < fFields.length; i++)
      {
        Field field = fFields[i];
        Assert.isNotNull(field);
        oldFieldNames[i] = field.getFieldName();
        createField[i] = field.isCreateField();
        if (field.isCreateField()) {
          newFieldNames[i] = field.getNewFieldName();
        }
      }
      JavaRefactoringDescriptorUtil.setStringArray(fArguments, "oldFieldCount", "oldFieldName", oldFieldNames, 0);
      JavaRefactoringDescriptorUtil.setStringArray(fArguments, "newFieldCount", "newFieldName", newFieldNames, 0);
      JavaRefactoringDescriptorUtil.setBooleanArray(fArguments, "createFieldCount", "createField", createField, 0);
    }
  }
  
  public RefactoringStatus validateDescriptor()
  {
    RefactoringStatus status = super.validateDescriptor();
    if (getType() == null) {
      status.addFatalError("The type may not be null");
    }
    return status;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ExtractConstantDescriptor
  extends JavaRefactoringDescriptor
{
  public ExtractConstantDescriptor()
  {
    super("org.eclipse.jdt.ui.extract.constant");
  }
  
  public ExtractConstantDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.extract.constant", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractConstantDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ExtractInterfaceDescriptor
  extends JavaRefactoringDescriptor
{
  public ExtractInterfaceDescriptor()
  {
    super("org.eclipse.jdt.ui.extract.interface");
  }
  
  public ExtractInterfaceDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.extract.interface", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractInterfaceDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ExtractLocalDescriptor
  extends JavaRefactoringDescriptor
{
  public ExtractLocalDescriptor()
  {
    super("org.eclipse.jdt.ui.extract.temp");
  }
  
  public ExtractLocalDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.extract.temp", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractLocalDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ExtractMethodDescriptor
  extends JavaRefactoringDescriptor
{
  public ExtractMethodDescriptor()
  {
    super("org.eclipse.jdt.ui.extract.method");
  }
  
  public ExtractMethodDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.extract.method", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractMethodDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class ExtractSuperclassDescriptor
  extends JavaRefactoringDescriptor
{
  public ExtractSuperclassDescriptor()
  {
    super("org.eclipse.jdt.ui.extract.superclass");
  }
  
  public ExtractSuperclassDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.extract.superclass", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.ExtractSuperclassDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class GeneralizeTypeDescriptor
  extends JavaRefactoringDescriptor
{
  public GeneralizeTypeDescriptor()
  {
    super("org.eclipse.jdt.ui.change.type");
  }
  
  public GeneralizeTypeDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.change.type", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.GeneralizeTypeDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class InferTypeArgumentsDescriptor
  extends JavaRefactoringDescriptor
{
  public InferTypeArgumentsDescriptor()
  {
    super("org.eclipse.jdt.ui.infer.typearguments");
  }
  
  public InferTypeArgumentsDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.infer.typearguments", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.InferTypeArgumentsDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class InlineConstantDescriptor
  extends JavaRefactoringDescriptor
{
  public InlineConstantDescriptor()
  {
    super("org.eclipse.jdt.ui.inline.constant");
  }
  
  public InlineConstantDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.inline.constant", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.InlineConstantDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class InlineLocalVariableDescriptor
  extends JavaRefactoringDescriptor
{
  public InlineLocalVariableDescriptor()
  {
    super("org.eclipse.jdt.ui.inline.temp");
  }
  
  public InlineLocalVariableDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.inline.temp", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.InlineLocalVariableDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class InlineMethodDescriptor
  extends JavaRefactoringDescriptor
{
  public InlineMethodDescriptor()
  {
    super("org.eclipse.jdt.ui.inline.method");
  }
  
  public InlineMethodDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.inline.method", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.InlineMethodDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class IntroduceFactoryDescriptor
  extends JavaRefactoringDescriptor
{
  public IntroduceFactoryDescriptor()
  {
    super("org.eclipse.jdt.ui.introduce.factory");
  }
  
  public IntroduceFactoryDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.introduce.factory", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.IntroduceFactoryDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class IntroduceIndirectionDescriptor
  extends JavaRefactoringDescriptor
{
  public IntroduceIndirectionDescriptor()
  {
    super("org.eclipse.jdt.ui.introduce.indirection");
  }
  
  public IntroduceIndirectionDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.introduce.indirection", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.IntroduceIndirectionDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;

public final class IntroduceParameterDescriptor
  extends JavaRefactoringDescriptor
{
  public IntroduceParameterDescriptor()
  {
    super("org.eclipse.jdt.ui.introduce.parameter");
  }
  
  public IntroduceParameterDescriptor(String project, String description, String comment, Map arguments, int flags)
  {
    super("org.eclipse.jdt.ui.introduce.parameter", project, description, comment, arguments, flags);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

public class IntroduceParameterObjectDescriptor$Parameter
{
  private boolean fCreateField = false;
  private String fFieldName = null;
  private final int fIndex;
  
  public IntroduceParameterObjectDescriptor$Parameter(int index)
  {
    fIndex = index;
  }
  
  public String getFieldName()
  {
    return fFieldName;
  }
  
  public int getIndex()
  {
    return fIndex;
  }
  
  public boolean isCreateField()
  {
    return fCreateField;
  }
  
  public void setCreateField(boolean createField)
  {
    if (fIndex == -1) {
      throw new IllegalArgumentException("You can not set create field for the parameter object");
    }
    fCreateField = createField;
  }
  
  public void setFieldName(String fieldName)
  {
    if (fIndex == -1) {
      throw new IllegalArgumentException("You can not set the field name of the parameter object");
    }
    fFieldName = fieldName;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterObjectDescriptor.Parameter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jdt.core.refactoring.descriptors;

import java.util.Map;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.internal.core.refactoring.descriptors.JavaRefactoringDescriptorUtil;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;

public class IntroduceParameterObjectDescriptor
  extends JavaRefactoringDescriptor
{
  private static final String PARAMETER_COUNT = "PARAMETER_COUNT";
  private static final String PARAMETER_IDX = "PARAMETER_IDX";
  private static final String PARAMETER_CREATE_FIELD = "PARAMETER_CREATE_FIELD";
  private static final String PARAMETER_FIELD_NAME = "PARAMETER_FIELD_NAME";
  private static final String CLASS_NAME = "class_name";
  private static final String DELEGATE = "delegate";
  private static final String DEPRECATE_DELEGATE = "deprecate_delegate";
  private static final String GETTERS = "getters";
  private static final String PACKAGE_NAME = "package_name";
  private static fina
1 2 3 4

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