org.fest.reflect.innerclass
Class StaticInnerClassName

java.lang.Object
  extended by 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 Summary
 Invoker in(Class<?> declaringClass)
          Specifies the declaring class of the static inner class to obtain.
static StaticInnerClassName startStaticInnerClassAccess(String name)
          Creates a new StaticInnerClassName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.


Copyright © 2007-2010 FEST (Fixtures for Easy Software Testing). All Rights Reserved.