Skip to content

Commit

Permalink
getClass
Browse files Browse the repository at this point in the history
  • Loading branch information
n9Mtq4 committed Jun 22, 2015
1 parent f8fad9f commit 442e209
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/com/n9mtq4/reflection/ReflectionHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2346,6 +2346,18 @@ public static Class getClassByFullName(String className) {
}
}

/**
* Tries to get a class by its full name. If that fails, then
* it will try to get the class by its simple name.
*
* @param name The name of the Class.
* @return The class, or null if no class is found
* */
public static Class getClass(String name) {
Class c = getClassByFullName(name);
if (c != null) return c;
return getClassBySimpleName(name);
}

/**
* This fixes the issue in java of getDeclaredFields not searching
Expand Down

0 comments on commit 442e209

Please sign in to comment.