IntelliJ Community . AccessorsPlugin

 
AccessorsPlugin 

HOME INDEX SEARCH CHANGES GO  

AccessorsPlugin

Description

The Accessor Plugin provides two intention action which can be used to replace direct accesses of a property of a class with a suitable getter or setter method.

Using

Consider the following two classes:

public class Foo {
  private int bar;
  public int getBar() { return bar; }
  public void setBar(int bar) {this.bar = bar; }
}

public class FooTest {
  public static void main(String[] args) {
    Foo foo = new Foo();
    foo.bar = 42;
    System.out.println(foo.bar);
  }
}
IDEA will highlight the two illegal references to Foo's private bar member. The Accessors plugin will offer to replace these references with a setter or getter method call, respectively. Invoking these two intention actions will turn the second class into the following:
public class FooTest {
  public static void main(String[] args) {
    Foo foo = new Foo();
    foo.setBar(42);
    System.out.println(foo.getBar());
  }
}

Plugin Development

Any feedback is welcome smile

-- JensVoss - 29 Jan 2007

IntelliJPluginWebForm
IntelliJPluginName: Accessors
IntelliJPluginVersion: 0.9.1
IntelliJPluginVendor: Jens Voss
IntelliJPluginBinary:
IntelliJPluginSource: http://www.intellij.org/twiki/pub/Main/AccessorsPlugin/Accessors-0.9.1-src.zip
IntelliJPluginClassification: CodeHelper?
TopicClassification:
TopicShortDescription:
TestedOnOS: OsWinXP
ShouldRunOnOS: AnyOS

Attachment: sort Action: Size: Date: Who: Comment:
Accessors-0.9.1-src.zip action 6994 29 Jan 2007 - 12:05 JensVoss Accessors Plugin version 0.9.1 bundled sources

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.