Class StaticInnerClassName

java.lang.Object
org.fest.reflect.innerclass.StaticInnerClassName

public final class StaticInnerClassName extends Object
Understands the name of a static inner class.

Let's assume we have the class Jedi, which contains two static inner classes: Master and Padawan.

 public class Jedi {

   public static class Master {}

   public static class Padawan {}
 }
 

The following example shows how to get a reference to the inner class Master:

 Class<?> masterClass = staticInnerClass("Master").in(Jedi.class).get();
 

Since:
1.1
Author:
Alex Ruiz
  • Method Details

    • startStaticInnerClassAccess

      public static StaticInnerClassName startStaticInnerClassAccess(String name)
      Creates a new StaticInnerClassName.
      Parameters:
      name - the name of the static inner class to obtain.
      Returns:
      the created StaticInnerClassName.
      Throws:
      NullPointerException - if the given name is null.
      IllegalArgumentException - if the given name is empty.
    • in

      public Invoker in(Class<?> declaringClass)
      Specifies the declaring class of the static inner class to obtain.
      Parameters:
      declaringClass - the declaring class.
      Returns:
      an object responsible for obtaining a reference to a static inner class.
      Throws:
      NullPointerException - if the given declaring class is null.