public class NamesUtil extends Object
Modifier and Type | Field and Description |
---|---|
private static String[] |
emptyArray |
static String |
ImplClassSuffix |
private static Set<String> |
javaLangClasses |
private static Set<String> |
javaUtilClasses |
private static Map<String,String> |
primitiveToWrapperMap |
private static Set<String> |
reservedWordsSet |
Modifier | Constructor and Description |
---|---|
private |
NamesUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
createNewClassNameFromInterfaceName(String interfaceName)
Create a class name from an interface name by removing package, adding a implementation suffix and removing I/Interface from name while retaining any generic part.
|
static String |
ensureQualifedName(String name,
String defaultPackage) |
static String |
getGenericQualifier(String className) |
static String[] |
getGenericQualifierNames(String className) |
static String |
getPackageFromQualifiedName(String name) |
static String |
getUnqualifiedName(String name) |
static String |
getWrapperTypeName(String typeName) |
static boolean |
hasGenericQualifier(String name) |
static boolean |
hasPackage(String qualifiedName,
String packageName) |
static boolean |
hasWilcard(String wildcardSpecifier) |
static boolean |
isGetterMethod(String methodName,
String[] getterPrefixes) |
static boolean |
isJavaLangClassName(String identifier) |
static boolean |
isJavaUtilClassName(String identifier) |
static boolean |
isQualifiedName(String name) |
private static boolean |
isReserved(String identifier) |
static boolean |
isSetterMethod(String methodName,
String[] setterPrefixes) |
static String |
makeSafeJavaIdentifier(String identifier) |
static boolean |
matchingOverloads(String overloadNamesSpecifier1,
String overloadNamesSpecifier2,
boolean ignoreAllPackages)
Check if two overload names wtih optional * wildcards except of method name or a type paramter match.
|
static String |
stripArrrayQualifier(String className) |
static String |
stripGenericQualifier(String className) |
public static final String ImplClassSuffix
private static final String[] emptyArray
private static boolean isReserved(String identifier)
public static boolean isJavaLangClassName(String identifier)
public static boolean isJavaUtilClassName(String identifier)
public static String createNewClassNameFromInterfaceName(String interfaceName)
interfaceName
- The name of the interface that the class name should be generated from.public static boolean hasGenericQualifier(String name)
public static boolean isQualifiedName(String name)
public static boolean hasWilcard(String wildcardSpecifier)
public static boolean matchingOverloads(String overloadNamesSpecifier1, String overloadNamesSpecifier2, boolean ignoreAllPackages)
Method.getOverloadName()
overloadNamesSpecifier1
- First name specifieroverloadNamesSpecifier2
- Second name specifierignoreAllPackages
- True all if packages should be ignored in comparison, false if only java.lang packages should be ignored.
Version 2.0.0 generated on 2014-11-22 at 09:45 - (C) 41concepts Aps. Refer to project homepage valjogen.41concepts.com for more information.