Package org.fest.reflect.innerclass
Class StaticInnerClassName
- java.lang.Object
-
- org.fest.reflect.innerclass.StaticInnerClassName
-
public final class StaticInnerClassName extends java.lang.Object
Understands the name of a static inner class.Let's assume we have the class
Jedi
, which contains two static inner classes:Master
andPadawan
.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Invoker
in(java.lang.Class<?> declaringClass)
Specifies the declaring class of the static inner class to obtain.static StaticInnerClassName
startStaticInnerClassAccess(java.lang.String name)
Creates a newStaticInnerClassName
.
-
-
-
Method Detail
-
startStaticInnerClassAccess
public static StaticInnerClassName startStaticInnerClassAccess(java.lang.String name)
Creates a newStaticInnerClassName
.- Parameters:
name
- the name of the static inner class to obtain.- Returns:
- the created
StaticInnerClassName
. - Throws:
java.lang.NullPointerException
- if the given name isnull
.java.lang.IllegalArgumentException
- if the given name is empty.
-
in
public Invoker in(java.lang.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:
java.lang.NullPointerException
- if the given declaring class isnull
.
-
-