src/share/classes/jdk/internal/org/objectweb/asm/Type.java

Print this page




 568         switch (sort) {
 569         case VOID:
 570             return "void";
 571         case BOOLEAN:
 572             return "boolean";
 573         case CHAR:
 574             return "char";
 575         case BYTE:
 576             return "byte";
 577         case SHORT:
 578             return "short";
 579         case INT:
 580             return "int";
 581         case FLOAT:
 582             return "float";
 583         case LONG:
 584             return "long";
 585         case DOUBLE:
 586             return "double";
 587         case ARRAY:
 588             StringBuffer b = new StringBuffer(getElementType().getClassName());
 589             for (int i = getDimensions(); i > 0; --i) {
 590                 b.append("[]");
 591             }
 592             return b.toString();
 593         case OBJECT:
 594             return new String(buf, off, len).replace('/', '.');
 595         default:
 596             return null;
 597         }
 598     }
 599 
 600     /**
 601      * Returns the internal name of the class corresponding to this object or
 602      * array type. The internal name of a class is its fully qualified name (as
 603      * returned by Class.getName(), where '.' are replaced by '/'. This method
 604      * should only be used for an object or array type.
 605      *
 606      * @return the internal name of the class corresponding to this object type.
 607      */
 608     public String getInternalName() {
 609         return new String(buf, off, len);
 610     }
 611 
 612     /**




 568         switch (sort) {
 569         case VOID:
 570             return "void";
 571         case BOOLEAN:
 572             return "boolean";
 573         case CHAR:
 574             return "char";
 575         case BYTE:
 576             return "byte";
 577         case SHORT:
 578             return "short";
 579         case INT:
 580             return "int";
 581         case FLOAT:
 582             return "float";
 583         case LONG:
 584             return "long";
 585         case DOUBLE:
 586             return "double";
 587         case ARRAY:
 588             StringBuilder sb = new StringBuilder(getElementType().getClassName());
 589             for (int i = getDimensions(); i > 0; --i) {
 590                 sb.append("[]");
 591             }
 592             return sb.toString();
 593         case OBJECT:
 594             return new String(buf, off, len).replace('/', '.');
 595         default:
 596             return null;
 597         }
 598     }
 599 
 600     /**
 601      * Returns the internal name of the class corresponding to this object or
 602      * array type. The internal name of a class is its fully qualified name (as
 603      * returned by Class.getName(), where '.' are replaced by '/'. This method
 604      * should only be used for an object or array type.
 605      *
 606      * @return the internal name of the class corresponding to this object type.
 607      */
 608     public String getInternalName() {
 609         return new String(buf, off, len);
 610     }
 611 
 612     /**