Java Doc for ClassFile.java in  » Database-DBMS » db4o-6.4 » EDU » purdue » cs » bloat » file » 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 » Database DBMS » db4o 6.4 » EDU.purdue.cs.bloat.file 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   EDU.purdue.cs.bloat.file.ClassFile

ClassFile
public class ClassFile implements ClassInfo(Code)
ClassFile basically represents a Java classfile as it is found on disk. The classfile is modeled according to the Java Virtual Machine Specification. Methods are provided to edit the classfile at a very low level.
See Also:   Attribute
See Also:   EDU.purdue.cs.bloat.reflect.Constant
See Also:   Field
See Also:   Method
author:
   Nate Nystrom (author:
   href="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu)



Constructor Summary
public  ClassFile(File file, ClassInfoLoader loader, DataInputStream in)
     Constructor.
public  ClassFile(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, List constants, ClassInfoLoader loader)
     Creates a new ClassFile from scratch.

Method Summary
public  FieldInfoaddNewField(int modifiers, int typeIndex, int nameIndex)
    
public  FieldInfoaddNewField(int modifiers, int typeIndex, int nameIndex, int cvNameIndex, int constantValueIndex)
    
public  MethodInfoaddNewMethod(int modifiers, int typeIndex, int nameIndex, int exceptionIndex, int[] exceptionTypeIndices, int codeIndex)
    
public  intclassIndex()
     Get the index into the constant pool of the name of the class.
public  voidcommit()
     Commit any changes back to a file in the output directory.
public  voidcommitOnly(Set methods, Set fields)
    
 voidcommitTo(OutputStream outStream)
     Commit changes made to this class.
public  Constant[]constants()
     Get an array of the constants in the constant pool.
public  voiddeleteField(int nameIndex)
     Removes the field whose name is at the given index in the constant pool.
public  voiddeleteMethod(int nameIndex, int typeIndex)
    
public  FieldInfo[]fields()
     Get an array of FieldInfo structures for each field in the class.
public  Filefile()
     Returns the File from which this ClassFile was created.
public  int[]interfaceIndices()
     Get the indices into the constant pool of the names of the class's interfaces.
public  ClassInfoLoaderloader()
     Get the class info loader for the class.
public  MethodInfo[]methods()
     Returns an array of MethodInfo structures for each method in the class.
public  intmodifiers()
     Get the modifiers of the class.
public  Stringname()
     Get the name of the class, including the package name.
public  FileoutputFile()
     Creates a new File object to hold this class.
public  voidprint(PrintStream out)
     Prints a textual representation of this classfile to a PrintStream.
public  voidprint(PrintWriter out)
    
public  voidsetClassIndex(int index)
     Set the index into the constant pool of the name of the class.
public  voidsetConstants(Constant[] constants)
     Set all the constants in the constant pool.
public  voidsetInterfaceIndices(int[] indices)
     Set the indices into the constant pool of the names of the class's interfaces.
public  voidsetMethods(MethodInfo[] methods)
     Sets the methods in this class.
public  voidsetModifiers(int modifiers)
     Set the modifiers of the class.
public  voidsetSuperclassIndex(int index)
     Set the index into the constant pool of the name of the class's superclass.
public  intsuperclassIndex()
     Get the index into the constant pool of the name of the class's superclass.
public  StringtoString()
    


Constructor Detail
ClassFile
public ClassFile(File file, ClassInfoLoader loader, DataInputStream in)(Code)
Constructor. This constructor parses the class file from the input stream.
Parameters:
  file - The file in which the class resides.
Parameters:
  loader - The class info loader which loaded the class.
Parameters:
  in - The data stream containing the class.
exception:
  ClassFormatError - When the class could not be parsed.



ClassFile
public ClassFile(int modifiers, int classIndex, int superClassIndex, int[] interfaceIndexes, List constants, ClassInfoLoader loader)(Code)
Creates a new ClassFile from scratch. It has no fields or methods.
Parameters:
  modifiers - The modifiers describing the newly-created class
Parameters:
  classIndex - The index of the type of the newly-created class in itsconstant pool
Parameters:
  superClassIndex - The index of the type of the newly-created class's superclassin its constant pool
Parameters:
  interfaceIndexes - The indexes of the types of the interfaces that thenewly-created class implements
Parameters:
  constants - The constant pool for the newly created class (a list ofConstants).




Method Detail
addNewField
public FieldInfo addNewField(int modifiers, int typeIndex, int nameIndex)(Code)
Creates a new field in this classfile



addNewField
public FieldInfo addNewField(int modifiers, int typeIndex, int nameIndex, int cvNameIndex, int constantValueIndex)(Code)
Creates a new field in this classfile



addNewMethod
public MethodInfo addNewMethod(int modifiers, int typeIndex, int nameIndex, int exceptionIndex, int[] exceptionTypeIndices, int codeIndex)(Code)
Creates a new method in this class



classIndex
public int classIndex()(Code)
Get the index into the constant pool of the name of the class. The index of the name of the class.



commit
public void commit()(Code)
Commit any changes back to a file in the output directory. The output directory is determined from the ClassFileLoader.



commitOnly
public void commitOnly(Set methods, Set fields)(Code)



commitTo
void commitTo(OutputStream outStream)(Code)
Commit changes made to this class. Write changes to an OutputStream.



constants
public Constant[] constants()(Code)
Get an array of the constants in the constant pool. An array of Constants.



deleteField
public void deleteField(int nameIndex)(Code)
Removes the field whose name is at the given index in the constant pool.
throws:
  IllegalArgumentException - The class does not contain a field whosename is at the given index



deleteMethod
public void deleteMethod(int nameIndex, int typeIndex)(Code)
Deletes a method from this class
Parameters:
  nameIndex - Index in the constant pool of the name of the method to bedeleted
Parameters:
  typeIndex - Index in the constant pool of the type of the method to bedeleted
throws:
  IllegalArgumentException - The class modeled by thisClassInfo does not contain a method whose name andtype are not at the given indices



fields
public FieldInfo[] fields()(Code)
Get an array of FieldInfo structures for each field in the class. An array of FieldInfo structures.



file
public File file()(Code)
Returns the File from which this ClassFile was created. If this ClassFile was created from scratch, null is returned.



interfaceIndices
public int[] interfaceIndices()(Code)
Get the indices into the constant pool of the names of the class's interfaces. The indices of the names of the interfaces.



loader
public ClassInfoLoader loader()(Code)
Get the class info loader for the class. The class info loader for the class.



methods
public MethodInfo[] methods()(Code)
Returns an array of MethodInfo structures for each method in the class.



modifiers
public int modifiers()(Code)
Get the modifiers of the class. The values correspond to the constants in the Modifiers class. A bit vector of modifier flags for the class.
See Also:   Modifiers



name
public String name()(Code)
Get the name of the class, including the package name. The name of the class.



outputFile
public File outputFile()(Code)
Creates a new File object to hold this class. It is placed in the output directory and has the name of the class represented by this ClassFile followed by the .class extension.



print
public void print(PrintStream out)(Code)
Prints a textual representation of this classfile to a PrintStream. The text includes information such as the constants in the constant pool, the name of the class's superclass, its modifier flags, its fields, and its methods.
Parameters:
  out - The stream to which to print.



print
public void print(PrintWriter out)(Code)



setClassIndex
public void setClassIndex(int index)(Code)
Set the index into the constant pool of the name of the class.
Parameters:
  index - The index of the name of the class.



setConstants
public void setConstants(Constant[] constants)(Code)
Set all the constants in the constant pool.
Parameters:
  constants - The array of Constants.



setInterfaceIndices
public void setInterfaceIndices(int[] indices)(Code)
Set the indices into the constant pool of the names of the class's interfaces.
Parameters:
  indices - The indices of the names of the interfaces.



setMethods
public void setMethods(MethodInfo[] methods)(Code)
Sets the methods in this class.



setModifiers
public void setModifiers(int modifiers)(Code)
Set the modifiers of the class. The values correspond to the constants in the Modifiers class.
Parameters:
  modifiers - A bit vector of modifier flags for the class.
See Also:   Modifiers



setSuperclassIndex
public void setSuperclassIndex(int index)(Code)
Set the index into the constant pool of the name of the class's superclass.
Parameters:
  index - The index of the name of the superclass.



superclassIndex
public int superclassIndex()(Code)
Get the index into the constant pool of the name of the class's superclass. The index of the name of the superclass.



toString
public String toString()(Code)



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.