Lines Matching refs:classname
237 protected CtClass getCached(String classname) {
238 return (CtClass)classes.get(classname);
248 protected void cacheCtClass(String classname, CtClass c, boolean dynamic) {
249 classes.put(classname, c);
259 protected CtClass removeCached(String classname) {
260 return (CtClass)classes.remove(classname);
423 * <p>If <code>classname</code> ends with "[]", then this method
429 * @param classname a fully-qualified class name.
431 public CtClass get(String classname) throws NotFoundException {
433 if (classname == null)
436 clazz = get0(classname, true);
439 throw new NotFoundException(classname);
454 * @param classname a fully-qualified class name.
460 public CtClass getOrNull(String classname) {
462 if (classname == null)
470 clazz = get0(classname, true);
483 classname can be an array-type "descriptor" (an encoded
493 * @param classname a fully-qualified class name or a descriptor
500 public CtClass getCtClass(String classname) throws NotFoundException {
501 if (classname.charAt(0) == '[')
502 return Descriptor.toCtClass(classname, this);
504 return get(classname);
512 protected synchronized CtClass get0(String classname, boolean useCache)
517 clazz = getCached(classname);
523 clazz = parent.get0(classname, useCache);
528 clazz = createCtClass(classname, useCache);
530 // clazz.getName() != classname if classname is "[L<name>;".
538 clazz = parent.get0(classname, useCache);
550 protected CtClass createCtClass(String classname, boolean useCache) {
552 if (classname.charAt(0) == '[')
553 classname = Descriptor.toClassName(classname);
555 if (classname.endsWith("[]")) {
556 String base = classname.substring(0, classname.indexOf('['));
560 return new CtArray(classname, this);
563 if (find(classname) == null)
566 return new CtClassType(classname, this);
571 * specified by classname. It is also used to determine whether
574 * @param classname a fully-qualified class name.
578 public URL find(String classname) {
579 return source.find(classname);
590 void checkNotFrozen(String classname) throws RuntimeException {
591 CtClass clazz = getCached(classname);
595 clazz = parent.get0(classname, true);
599 throw new RuntimeException(classname
605 throw new RuntimeException(classname
615 CtClass checkNotExists(String classname) {
616 CtClass clazz = getCached(classname);
620 clazz = parent.get0(classname, true);
630 InputStream openClassfile(String classname) throws NotFoundException {
631 return source.openClassfile(classname);
634 void writeClassfile(String classname, OutputStream out)
637 source.writeClassfile(classname, out);
666 * @param classname the class name
670 public CtMethod getMethod(String classname, String methodname)
673 CtClass c = get(classname);
719 String classname = clazz.getName();
721 checkNotFrozen(classname);
723 cacheCtClass(classname, clazz, true);
749 String classname = clazz.getName();
750 CtClass found = checkNotExists(classname);
754 cacheCtClass(classname, clazz, true);
772 * @param classname a fully-qualified class name.
775 public CtClass makeClass(String classname) throws RuntimeException {
776 return makeClass(classname, null);
792 * @param classname a fully-qualified class name.
796 public synchronized CtClass makeClass(String classname, CtClass superclass)
799 checkNotFrozen(classname);
800 CtClass clazz = new CtNewClass(classname, this, false, superclass);
801 cacheCtClass(classname, clazz, true);
809 * @param classname a fully-qualified class name.
812 synchronized CtClass makeNestedClass(String classname) {
813 checkNotFrozen(classname);
814 CtClass clazz = new CtNewNestedClass(classname, this, false, null);
815 cacheCtClass(classname, clazz, true);