A hash table associating class names with different names.
This hashtable is used for replacing class names in a class
definition or a method body. Define a subclass of this class
if a more complex mapping algorithm is needed. For example,
class MyClassMap extends ClassMap {
public Object get(Object jvmClassName) {
String name = toJavaName((String)jvmClassName);
if (name.startsWith("java."))
return toJvmName("java2." + name.substring(5));
else
return super.get(jvmClassName);
}
}
This subclass maps java.lang.String to
java2.lang.String . Note that get()
receives and returns the internal representation of a class name.
For example, the internal representation of java.lang.String
is java/lang/String .
See Also: ClassMap.get(Object) See Also: CtClass.replaceClassName(ClassMap) See Also: CtNewMethod.copy(CtMethodStringCtClassClassMap) |