Java Doc for ClassFile.java in  » Scripting » jacl » org » codehaus » janino » util » 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 » Scripting » jacl » org.codehaus.janino.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.janino.util.ClassFile

ClassFile
public class ClassFile (Code)
An object that represents the JavaTM "class file" format.

ClassFile.ClassFile(InputStream) creates a ClassFile object from the bytecode read from the given InputStream .

ClassFile.store(OutputStream) generates JavaTM bytecode which is suitable for being processed by a JavaTM virtual machine.


Inner Class :abstract public static class ConstantPoolInfo
Inner Class :abstract public static class ConstantValuePoolInfo extends ConstantPoolInfo
Inner Class :public static class ConstantClassInfo extends ConstantPoolInfo
Inner Class :public static class ConstantFieldrefInfo extends ConstantPoolInfo
Inner Class :public static class ConstantMethodrefInfo extends ConstantPoolInfo
Inner Class :public static class ConstantInterfaceMethodrefInfo extends ConstantPoolInfo
Inner Class :static class ConstantStringInfo extends ConstantValuePoolInfo
Inner Class :public static class ConstantNameAndTypeInfo extends ConstantPoolInfo
Inner Class :public static class ConstantUtf8Info extends ConstantPoolInfo
Inner Class :public class MethodInfo
Inner Class :public static class FieldInfo
Inner Class :abstract public static class AttributeInfo
Inner Class :public static class ConstantValueAttribute extends AttributeInfo
Inner Class :public static class ExceptionsAttribute extends AttributeInfo
Inner Class :public static class InnerClassesAttribute extends AttributeInfo
Inner Class :public static class SyntheticAttribute extends AttributeInfo
Inner Class :public static class SourceFileAttribute extends AttributeInfo
Inner Class :public static class LineNumberTableAttribute extends AttributeInfo
Inner Class :public static class LocalVariableTableAttribute extends AttributeInfo
Inner Class :public static class DeprecatedAttribute extends AttributeInfo

Field Summary
final public static  shortMAJOR_VERSION_JDK_1_1
    
final public static  shortMAJOR_VERSION_JDK_1_2
    
final public static  shortMAJOR_VERSION_JDK_1_3
    
final public static  shortMAJOR_VERSION_JDK_1_4
    
final public static  shortMAJOR_VERSION_JDK_1_5
    
final public static  shortMINOR_VERSION_JDK_1_1
    
final public static  shortMINOR_VERSION_JDK_1_2
    
final public static  shortMINOR_VERSION_JDK_1_3
    
final public static  shortMINOR_VERSION_JDK_1_4
    
final public static  shortMINOR_VERSION_JDK_1_5
    
public  shortaccessFlags
    
public  ListconstantPool
    
public  ListfieldInfos
    
public  short[]interfaces
    
public  ListmethodInfos
    
public  shortsuperclass
    
public  shortthisClass
    

Constructor Summary
public  ClassFile(short accessFlags, String thisClassFD, String superclassFD, String[] interfaceFDs)
     Construct from parsed components.
Parameters:
  accessFlags - as defined by org.codehaus.janino.Mod
Parameters:
  thisClassFD - the field descriptor for this class
Parameters:
  superclassFD - the field descriptor for the extended class (e.g.
public  ClassFile(InputStream inputStream)
     Read "class file" data from a InputStream and construct a ClassFile object from it.

If the ClassFile is created with this constructor, then most modifying operations lead to a UnsupportedOperationException ; only fields, methods and attributes can be added.


Method Summary
public  shortaddConstantClassInfo(String typeFD)
     Add a "CONSTANT_Class_info" structure to the class file.
public  shortaddConstantDoubleInfo(double value)
     Add a "CONSTANT_Double_info" structure to the class file.
public  shortaddConstantFieldrefInfo(String classFD, String fieldName, String fieldFD)
     Add a "CONSTANT_Fieldref_info" structure to the class file.
public  shortaddConstantFloatInfo(float value)
     Add a "CONSTANT_Float_info" structure to the class file.
public  shortaddConstantIntegerInfo(int value)
     Add a "CONSTANT_Integer_info" structure to the class file.
public  shortaddConstantInterfaceMethodrefInfo(String classFD, String methodName, String methodMD)
     Add a "CONSTANT_InterfaceMethodref_info" structure to the class file.
public  shortaddConstantLongInfo(long value)
     Add a "CONSTANT_Long_info" structure to the class file.
public  shortaddConstantMethodrefInfo(String classFD, String methodName, String methodMD)
     Add a "CONSTANT_Methodref_info" structure to the class file.
public  shortaddConstantStringInfo(String string)
     Add a "CONSTANT_String_info" structure to the class file.
public  shortaddConstantUtf8Info(String s)
     Add a "CONSTANT_Utf8_info" structure to the class file.
public  voidaddDeprecatedAttribute()
    
public  FieldInfoaddFieldInfo(short accessFlags, String fieldName, String fieldTypeFD, Object optionalConstantValue)
    
public  voidaddInnerClassesAttributeEntry(InnerClassesAttribute.Entry e)
     Create an "InnerClasses" attribute if it does not exist, then add the given entry to the "InnerClasses" attribute.
public  MethodInfoaddMethodInfo(short accessFlags, String methodName, String methodMD)
    
public  voidaddSourceFileAttribute(String sourceFileName)
     Adds a "SourceFile" attribute to this class file.
public static  StringgetClassFileResourceName(String className)
     Construct the name of a resource that could contain the class file of the class with the given name.
Parameters:
  className - Fully qualified class name, e.g.
public  StringgetConstantClassName(short index)
    
public  ConstantPoolInfogetConstantPoolInfo(short index)
    
public  StringgetConstantUtf8(short index)
    
public  InnerClassesAttributegetInnerClassesAttribute()
    
public  shortgetMajorVersion()
     Returns the current major class file version number.
public  shortgetMinorVersion()
     Returns the current minor class file version number.
public static  StringgetSourceResourceName(String className)
     Construct the name of a resource that could contain the source code of the class with the given name.

Notice that member types are declared inside a different type, so the relevant source file is that of the outermost declaring class.
Parameters:
  className - Fully qualified class name, e.g.

public  StringgetThisClassName()
     The fully qualified name of this class, e.g.
public static  booleanisRecognizedVersion(short majorVersion, short minorVersion)
    
public  voidsetVersion(short majorVersion, short minorVersion)
     Sets the major and minor class file version numbers (JVMS 4.1).
public  voidstore(OutputStream os)
     Write ClassFile to an OutputStream , in "class file" format.

Notice that if an IOException is thrown, the class file is probably written incompletely and thus invalid.

public  byte[]toByteArray()
     Return the byte code of this ClassFile as a byte array.

Field Detail
MAJOR_VERSION_JDK_1_1
final public static short MAJOR_VERSION_JDK_1_1(Code)



MAJOR_VERSION_JDK_1_2
final public static short MAJOR_VERSION_JDK_1_2(Code)



MAJOR_VERSION_JDK_1_3
final public static short MAJOR_VERSION_JDK_1_3(Code)



MAJOR_VERSION_JDK_1_4
final public static short MAJOR_VERSION_JDK_1_4(Code)



MAJOR_VERSION_JDK_1_5
final public static short MAJOR_VERSION_JDK_1_5(Code)



MINOR_VERSION_JDK_1_1
final public static short MINOR_VERSION_JDK_1_1(Code)



MINOR_VERSION_JDK_1_2
final public static short MINOR_VERSION_JDK_1_2(Code)



MINOR_VERSION_JDK_1_3
final public static short MINOR_VERSION_JDK_1_3(Code)



MINOR_VERSION_JDK_1_4
final public static short MINOR_VERSION_JDK_1_4(Code)



MINOR_VERSION_JDK_1_5
final public static short MINOR_VERSION_JDK_1_5(Code)



accessFlags
public short accessFlags(Code)



constantPool
public List constantPool(Code)



fieldInfos
public List fieldInfos(Code)



interfaces
public short[] interfaces(Code)



methodInfos
public List methodInfos(Code)



superclass
public short superclass(Code)



thisClass
public short thisClass(Code)




Constructor Detail
ClassFile
public ClassFile(short accessFlags, String thisClassFD, String superclassFD, String[] interfaceFDs)(Code)
Construct from parsed components.
Parameters:
  accessFlags - as defined by org.codehaus.janino.Mod
Parameters:
  thisClassFD - the field descriptor for this class
Parameters:
  superclassFD - the field descriptor for the extended class (e.g. "Ljava/lang/Object;")
Parameters:
  interfaceFDs - the field descriptors for the implemented interfaces



ClassFile
public ClassFile(InputStream inputStream) throws IOException, ClassFormatError(Code)
Read "class file" data from a InputStream and construct a ClassFile object from it.

If the ClassFile is created with this constructor, then most modifying operations lead to a UnsupportedOperationException ; only fields, methods and attributes can be added.
Parameters:
  inputStream -
throws:
  IOException -
throws:
  ClassFormatError -





Method Detail
addConstantClassInfo
public short addConstantClassInfo(String typeFD)(Code)
Add a "CONSTANT_Class_info" structure to the class file.
See Also:    JVM specification, section 4.4.1



addConstantDoubleInfo
public short addConstantDoubleInfo(double value)(Code)
Add a "CONSTANT_Double_info" structure to the class file.
See Also:    JVM specification, section 4.4.5



addConstantFieldrefInfo
public short addConstantFieldrefInfo(String classFD, String fieldName, String fieldFD)(Code)
Add a "CONSTANT_Fieldref_info" structure to the class file.
See Also:    JVM specification, section 4.4.2



addConstantFloatInfo
public short addConstantFloatInfo(float value)(Code)
Add a "CONSTANT_Float_info" structure to the class file.
See Also:    JVM specification, section 4.4.4



addConstantIntegerInfo
public short addConstantIntegerInfo(int value)(Code)
Add a "CONSTANT_Integer_info" structure to the class file.
See Also:    JVM specification, section 4.4.4



addConstantInterfaceMethodrefInfo
public short addConstantInterfaceMethodrefInfo(String classFD, String methodName, String methodMD)(Code)
Add a "CONSTANT_InterfaceMethodref_info" structure to the class file.
See Also:    JVM specification, section 4.4.2



addConstantLongInfo
public short addConstantLongInfo(long value)(Code)
Add a "CONSTANT_Long_info" structure to the class file.
See Also:    JVM specification, section 4.4.5



addConstantMethodrefInfo
public short addConstantMethodrefInfo(String classFD, String methodName, String methodMD)(Code)
Add a "CONSTANT_Methodref_info" structure to the class file.
See Also:    JVM specification, section 4.4.2



addConstantStringInfo
public short addConstantStringInfo(String string)(Code)
Add a "CONSTANT_String_info" structure to the class file.
See Also:    JVM specification, section 4.4.3



addConstantUtf8Info
public short addConstantUtf8Info(String s)(Code)
Add a "CONSTANT_Utf8_info" structure to the class file.
See Also:    JVM specification, section 4.4.7



addDeprecatedAttribute
public void addDeprecatedAttribute()(Code)



addFieldInfo
public FieldInfo addFieldInfo(short accessFlags, String fieldName, String fieldTypeFD, Object optionalConstantValue)(Code)



addInnerClassesAttributeEntry
public void addInnerClassesAttributeEntry(InnerClassesAttribute.Entry e)(Code)
Create an "InnerClasses" attribute if it does not exist, then add the given entry to the "InnerClasses" attribute.
Parameters:
  e -



addMethodInfo
public MethodInfo addMethodInfo(short accessFlags, String methodName, String methodMD)(Code)



addSourceFileAttribute
public void addSourceFileAttribute(String sourceFileName)(Code)
Adds a "SourceFile" attribute to this class file. (Does not check whether one exists already.)
Parameters:
  sourceFileName -



getClassFileResourceName
public static String getClassFileResourceName(String className)(Code)
Construct the name of a resource that could contain the class file of the class with the given name.
Parameters:
  className - Fully qualified class name, e.g. "pkg1.pkg2.Outer$Inner" the name of the resource, e.g. "pkg1/pkg2/Outer$Inner.class"



getConstantClassName
public String getConstantClassName(short index)(Code)

Parameters:
  index - Index to a CONSTANT_Class_info in the constant pool The name of the denoted class in "internal form" (see JVMS 4.2)



getConstantPoolInfo
public ConstantPoolInfo getConstantPoolInfo(short index)(Code)



getConstantUtf8
public String getConstantUtf8(short index)(Code)

Parameters:
  index - Index to a CONSTANT_Utf8_info in the constant pool The string represented by the structure



getInnerClassesAttribute
public InnerClassesAttribute getInnerClassesAttribute()(Code)
Find the "InnerClasses" attribute of this class file null if this class has no "InnerClasses" attribute



getMajorVersion
public short getMajorVersion()(Code)
Returns the current major class file version number.



getMinorVersion
public short getMinorVersion()(Code)
Returns the current minor class file version number.



getSourceResourceName
public static String getSourceResourceName(String className)(Code)
Construct the name of a resource that could contain the source code of the class with the given name.

Notice that member types are declared inside a different type, so the relevant source file is that of the outermost declaring class.
Parameters:
  className - Fully qualified class name, e.g. "pkg1.pkg2.Outer$Inner" the name of the resource, e.g. "pkg1/pkg2/Outer.java"




getThisClassName
public String getThisClassName()(Code)
The fully qualified name of this class, e.g. "pkg1.pkg2.Outer$Inner"



isRecognizedVersion
public static boolean isRecognizedVersion(short majorVersion, short minorVersion)(Code)



setVersion
public void setVersion(short majorVersion, short minorVersion)(Code)
Sets the major and minor class file version numbers (JVMS 4.1). The class file version defaults to the JDK 1.1 values (45.3) which execute on virtually every JVM.
Parameters:
  majorVersion -
Parameters:
  minorVersion -



store
public void store(OutputStream os) throws IOException(Code)
Write ClassFile to an OutputStream , in "class file" format.

Notice that if an IOException is thrown, the class file is probably written incompletely and thus invalid. The calling method must take care of this situation, e.g. by closing the output stream and then deleting the file.
Parameters:
  os -
throws:
  IOException -




toByteArray
public byte[] toByteArray()(Code)
Return the byte code of this ClassFile as a byte array.



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.