Java Doc for Descriptor.java in  » Byte-Code » Javassist » javassist » bytecode » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Byte Code » Javassist » javassist.bytecode 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javassist.bytecode.Descriptor

Descriptor
public class Descriptor (Code)
A support class for dealing with descriptors.

See chapter 4.3 in "The Java Virtual Machine Specification (2nd ed.)"


Inner Class :public static class Iterator



Method Summary
public static  StringappendParameter(String classname, String desc)
     Appends a parameter type to the parameter list represented by the given descriptor.
public static  intarrayDimension(String desc)
     Computes the dimension of the array represented by the given descriptor.
public static  StringchangeReturnType(String classname, String desc)
     Changes the return type included in the given descriptor.
public static  intdataSize(String desc)
     Computes the data size specified by the given descriptor. For example, if the descriptor is "D", this method returns 2.

If the descriptor represents a method type, this method returns (the size of the returned value) - (the sum of the data sizes of all the parameters).

public static  booleaneqParamTypes(String desc1, String desc2)
     Returns true if the list of the parameter types of desc1 is equal to that of desc2.
public static  StringgetParamDescriptor(String decl)
     Returns the signature of the given descriptor.
public static  CtClass[]getParameterTypes(String desc, ClassPool cp)
     Returns the CtClass objects representing the parameter types specified by the given descriptor.
public static  CtClassgetReturnType(String desc, ClassPool cp)
     Returns the CtClass object representing the return type specified by the given descriptor.
public static  StringinsertParameter(String classname, String desc)
     Inserts a parameter type at the beginning of the parameter list represented by the given descriptor.
public static  intnumOfParameters(String desc)
     Returns the number of the prameters included in the given descriptor.
public static  Stringof(String classname)
    
public static  Stringof(CtClass type)
     Returns the descriptor representing the given type.
public static  StringofConstructor(CtClass[] paramTypes)
     Returns the descriptor representing a constructor receiving the given parameter types.
public static  StringofMethod(CtClass returnType, CtClass[] paramTypes)
     Returns the descriptor representing a method that receives the given parameter types and returns the given type.
public static  StringofParameters(CtClass[] paramTypes)
     Returns the descriptor representing a list of parameter types.
public static  intparamSize(String desc)
     Computes the data size of parameters. If one of the parameters is double type, the size of that parameter is 2 words.
public static  Stringrename(String desc, String oldname, String newname)
     Substitutes a class name in the given descriptor string.
public static  Stringrename(String desc, Map map)
     Substitutes class names in the given descriptor string according to the given map.
public static  StringtoArrayComponent(String desc, int dim)
     Returns the descriptor of the type of the array component.
public static  StringtoClassName(String descriptor)
     Converts to a Java class name from a descriptor.
public static  CtClasstoCtClass(String desc, ClassPool cp)
     Returns a CtClass object representing the type specified by the given descriptor.

This method works even if the package-class separator is not / but . (period).

public static  StringtoJavaName(String classname)
     Converts a class name from the internal representation used in the JVM to the normal one used in Java.
public static  StringtoJvmName(String classname)
     Converts a class name into the internal representation used in the JVM.
public static  StringtoJvmName(CtClass clazz)
     Returns the internal representation of the class name in the JVM.



Method Detail
appendParameter
public static String appendParameter(String classname, String desc)(Code)
Appends a parameter type to the parameter list represented by the given descriptor.

classname must not be an array type.
Parameters:
  classname - parameter type (not primitive type)
Parameters:
  desc - descriptor




arrayDimension
public static int arrayDimension(String desc)(Code)
Computes the dimension of the array represented by the given descriptor. For example, if the descriptor is "[[I", then this method returns 2.
Parameters:
  desc - the descriptor. 0 if the descriptor does not represent an array type.



changeReturnType
public static String changeReturnType(String classname, String desc)(Code)
Changes the return type included in the given descriptor.

classname must not be an array type.
Parameters:
  classname - return type
Parameters:
  desc - descriptor




dataSize
public static int dataSize(String desc)(Code)
Computes the data size specified by the given descriptor. For example, if the descriptor is "D", this method returns 2.

If the descriptor represents a method type, this method returns (the size of the returned value) - (the sum of the data sizes of all the parameters). For example, if the descriptor is "(I)D", then this method returns 1 (= 2 - 1).
Parameters:
  desc - descriptor




eqParamTypes
public static boolean eqParamTypes(String desc1, String desc2)(Code)
Returns true if the list of the parameter types of desc1 is equal to that of desc2. For example, "(II)V" and "(II)I" are equal.



getParamDescriptor
public static String getParamDescriptor(String decl)(Code)
Returns the signature of the given descriptor. The signature does not include the return type. For example, the signature of "(I)V" is "(I)".



getParameterTypes
public static CtClass[] getParameterTypes(String desc, ClassPool cp) throws NotFoundException(Code)
Returns the CtClass objects representing the parameter types specified by the given descriptor.
Parameters:
  desc - descriptor
Parameters:
  cp - the class pool used for obtaininga CtClass object.



getReturnType
public static CtClass getReturnType(String desc, ClassPool cp) throws NotFoundException(Code)
Returns the CtClass object representing the return type specified by the given descriptor.
Parameters:
  desc - descriptor
Parameters:
  cp - the class pool used for obtaininga CtClass object.



insertParameter
public static String insertParameter(String classname, String desc)(Code)
Inserts a parameter type at the beginning of the parameter list represented by the given descriptor.

classname must not be an array type.
Parameters:
  classname - parameter type (not primitive type)
Parameters:
  desc - descriptor




numOfParameters
public static int numOfParameters(String desc)(Code)
Returns the number of the prameters included in the given descriptor.
Parameters:
  desc - descriptor



of
public static String of(String classname)(Code)
Converts to a descriptor from a Java class name



of
public static String of(CtClass type)(Code)
Returns the descriptor representing the given type.



ofConstructor
public static String ofConstructor(CtClass[] paramTypes)(Code)
Returns the descriptor representing a constructor receiving the given parameter types.
Parameters:
  paramTypes - parameter types



ofMethod
public static String ofMethod(CtClass returnType, CtClass[] paramTypes)(Code)
Returns the descriptor representing a method that receives the given parameter types and returns the given type.
Parameters:
  returnType - return type
Parameters:
  paramTypes - parameter types



ofParameters
public static String ofParameters(CtClass[] paramTypes)(Code)
Returns the descriptor representing a list of parameter types. For example, if the given parameter types are two int, then this method returns "(II)".
Parameters:
  paramTypes - parameter types



paramSize
public static int paramSize(String desc)(Code)
Computes the data size of parameters. If one of the parameters is double type, the size of that parameter is 2 words. For example, if the given descriptor is "(IJ)D", then this method returns 3. The size of the return type is not computed.
Parameters:
  desc - a method descriptor.



rename
public static String rename(String desc, String oldname, String newname)(Code)
Substitutes a class name in the given descriptor string.
Parameters:
  desc - descriptor string
Parameters:
  oldname - replaced JVM class name
Parameters:
  newname - substituted JVM class name
See Also:   Descriptor.toJvmName(String)



rename
public static String rename(String desc, Map map)(Code)
Substitutes class names in the given descriptor string according to the given map.
Parameters:
  map - a map between replaced and substitutedJVM class names.
See Also:   Descriptor.toJvmName(String)



toArrayComponent
public static String toArrayComponent(String desc, int dim)(Code)
Returns the descriptor of the type of the array component. For example, if the given descriptor is "[[Ljava/lang/String;" and the given dimension is 2, then this method returns "Ljava/lang/String;".
Parameters:
  desc - the descriptor.
Parameters:
  dim - the array dimension.



toClassName
public static String toClassName(String descriptor)(Code)
Converts to a Java class name from a descriptor.
Parameters:
  descriptor - type descriptor.



toCtClass
public static CtClass toCtClass(String desc, ClassPool cp) throws NotFoundException(Code)
Returns a CtClass object representing the type specified by the given descriptor.

This method works even if the package-class separator is not / but . (period). For example, it accepts Ljava.lang.Object; as well as Ljava/lang/Object;.
Parameters:
  desc - descriptor
Parameters:
  cp - the class pool used for obtaininga CtClass object.




toJavaName
public static String toJavaName(String classname)(Code)
Converts a class name from the internal representation used in the JVM to the normal one used in Java.



toJvmName
public static String toJvmName(String classname)(Code)
Converts a class name into the internal representation used in the JVM.

Note that toJvmName(toJvmName(s)) is equivalent to toJvmName(s).




toJvmName
public static String toJvmName(CtClass clazz)(Code)
Returns the internal representation of the class name in the JVM.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.