/** * Compares the typeName to those stored in the typeNameMap. * If the short name of the typeName is unambiguous (only one package for * that short name in the Map), removes the package name and returns the * short name, else returns the whole thing. * * Assumes that typeName contains only a package name (optional) and a short name, * potentially with subtended brackets. * * (e.g. int -> int, java.util.Vector -> Vector, java.lang.Boolean[] -> Boolean[], etc.) */ protected static String adjustTypeName(String typeName, Map typeNameMap) { if (adjustmentNeededForType(typeName, typeNameMap)) { putTypeNameInMap(typeName, typeNameMap); return typeName.substring(packageName(typeName).length() + 1); } else { return typeName; } }
/** * Compares the typeName to those stored in the typeNameMap. * If the short name of the typeName is unambiguous (only one package for * that short name in the Map), removes the package name and returns the * short name, else returns the whole thing. * * Assumes that typeName contains only a package name (optional) and a short name, * potentially with subtended brackets. * * (e.g. int -> int, java.util.Vector -> Vector, java.lang.Boolean[] -> Boolean[], etc.) */ protected static String adjustTypeName(String typeName, Map typeNameMap) { if (adjustmentNeededForType(typeName, typeNameMap)) { putTypeNameInMap(typeName, typeNameMap); return typeName.substring(packageName(typeName).length() + 1); } else { return typeName; } }
/** * Compares the typeName to those stored in the typeNameMap. * If the short name of the typeName is unambiguous (only one package for * that short name in the Map), removes the package name and returns the * short name, else returns the whole thing. * * Assumes that typeName contains only a package name (optional) and a short name, * potentially with subtended brackets. * * (e.g. int -> int, java.util.Vector -> Vector, java.lang.Boolean[] -> Boolean[], etc.) */ protected static String adjustTypeName(String typeName, Map typeNameMap) { if (adjustmentNeededForType(typeName, typeNameMap)) { putTypeNameInMap(typeName, typeNameMap); return typeName.substring(packageName(typeName).length() + 1); } else { return typeName; } }