/** * Returns the string representation. */ public String toString() { return Descriptor.toClassName(Character.toString(descriptor)); }
/** * Returns the string representation. */ @Override public String toString() { return Descriptor.toClassName(Character.toString(descriptor)); }
/** * Obtains the enum type name. * * @return a fully-qualified type name. */ public String getType() { return Descriptor.toClassName(cp.getUtf8Info(typeIndex)); }
/** * Obtains the name of the annotation type. * * @return the type name */ public String getTypeName() { return Descriptor.toClassName(pool.getUtf8Info(typeIndex)); }
/** * Obtains the name of the annotation type. * * @return the type name */ public String getTypeName() { return Descriptor.toClassName(pool.getUtf8Info(typeIndex)); }
/** * Obtains the enum type name. * * @return a fully-qualified type name. */ public String getType() { return Descriptor.toClassName(cp.getUtf8Info(typeIndex)); }
/** * Creates a CtClass object representing the specified class. * It first examines whether or not the corresponding class * file exists. If yes, it creates a CtClass object. * * @return null if the class file could not be found. */ protected CtClass createCtClass(String classname, boolean useCache) { // accept "[L<class name>;" as a class name. if (classname.charAt(0) == '[') classname = Descriptor.toClassName(classname); if (classname.endsWith("[]")) { String base = classname.substring(0, classname.indexOf('[')); if ((!useCache || getCached(base) == null) && find(base) == null) return null; else return new CtArray(classname, this); } else if (find(classname) == null) return null; else return new CtClassType(classname, this); }
/** * Returns the class name of the target object, * which the method is called on. */ public String getClassName() { String cname; ConstPool cp = getConstPool(); int pos = currentPos; int c = iterator.byteAt(pos); int index = iterator.u16bitAt(pos + 1); if (c == INVOKEINTERFACE) cname = cp.getInterfaceMethodrefClassName(index); else cname = cp.getMethodrefClassName(index); if (cname.charAt(0) == '[') cname = Descriptor.toClassName(cname); return cname; }
/** * Creates a CtClass object representing the specified class. * It first examines whether or not the corresponding class * file exists. If yes, it creates a CtClass object. * * @return null if the class file could not be found. */ protected CtClass createCtClass(String classname, boolean useCache) { // accept "[L<class name>;" as a class name. if (classname.charAt(0) == '[') classname = Descriptor.toClassName(classname); if (classname.endsWith("[]")) { String base = classname.substring(0, classname.indexOf('[')); if ((!useCache || getCached(base) == null) && find(base) == null) return null; else return new CtArray(classname, this); } else if (find(classname) == null) return null; else return new CtClassType(classname, this); }
/** * Returns the class name of the target object, * which the method is called on. */ public String getClassName() { String cname; ConstPool cp = getConstPool(); int pos = currentPos; int c = iterator.byteAt(pos); int index = iterator.u16bitAt(pos + 1); if (c == INVOKEINTERFACE) cname = cp.getInterfaceMethodrefClassName(index); else cname = cp.getMethodrefClassName(index); if (cname.charAt(0) == '[') cname = Descriptor.toClassName(cname); return cname; }
/** * Returns the string representation. */ public String toString() { return Descriptor.toClassName(Character.toString(descriptor)); }
/** * Returns the string representation. */ public String toString() { return Descriptor.toClassName(Character.toString(descriptor)); } }
public static String stripArrayFromClassName(String classname) { if (classname.charAt(0) == '[') { return Descriptor.toClassName(classname); } if (classname.endsWith("[]")) { return classname.substring(0, classname.indexOf("[]")); } return classname; }
public static String stripArrayFromClassName(String classname) { if (classname.charAt(0) == '[') { return Descriptor.toClassName(classname); } if (classname.endsWith("[]")) { return classname.substring(0, classname.indexOf("[]")); } return classname; }
/** * Obtains the name of the annotation type. * * @return the type name */ public String getTypeName() { return Descriptor.toClassName(pool.getUtf8Info(typeIndex)); }
/** * Obtains the enum type name. * * @return a fully-qualified type name. */ public String getType() { return Descriptor.toClassName(cp.getUtf8Info(typeIndex)); }
/** * Obtains the enum type name. * * @return a fully-qualified type name. */ public String getType() { return Descriptor.toClassName(cp.getUtf8Info(typeIndex)); }
/** * Obtains the enum type name. * * @return a fully-qualified type name. */ public String getType() { return Descriptor.toClassName(cp.getUtf8Info(typeIndex)); }
/** * Obtains the name of the annotation type. * * @return the type name */ public String getTypeName() { return Descriptor.toClassName(pool.getUtf8Info(typeIndex)); }
/** * Obtains the value of the member. * * @return fully-qualified class name. */ public String getValue() { String v = cp.getUtf8Info(valueIndex); return Descriptor.toClassName(v); }