add code to hundred classes

I
just staring with intellij i'm looking to a way to add to about one hundred classes this code just under the class declaration :


@Override
    public String getUrl() {
        return BASE_URL + "template";
    }

    @Override
    public void isAt() {
        assertThat(title()).isEqualTo("template");
    }



thanks

2 comments
Comment actions Permalink

Looks like a problem made for Structural Search & Replace (Edit > Find > Replace Structurally...)

Use something like this as a Search Template:

class $Class$ {



  $Content$

}



With the Occurrences Count for $Content$ 0 - unlimited (Under the Edit Variables button).

And for the Replace Template something like this:

class $Class$ {
  @Override
  public String getUrl() {
    return BASE_URL + "template";
  }

  @Override
  public void isAt() {
    assertThat(title()).isEqualTo("template");
  }

  $Content$
}




Hope that helps,
Bas
0

Please sign in to leave a comment.