org.netbeans.modules.classfile

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 » IDE Netbeans » classfile » org.netbeans.modules.classfile 
org.netbeans.modules.classfile
The org.netbeans.modules.classfile package supports direct access to a Java Virtual Machine classfile contents. All elements and attributes of a classfile are accessible from this package's API. This package only supports read-only access of classfiles at this time.

The classfile library is not actually a NetBeans module, but is only packaged as one to use NetBeans' Auto Update facility. By being packaged as a module, other (real) NetBeans modules may list it as a dependency and require a minimum version to be present on the system. The classfile library does not use any NetBeans API, only Java core API.

The classfile library has only four constructors, as the only objects that can be created by a client are ClassFile objects (one constructor takes an InputStream of classfile bytes, another takes a filename, and variants of these two constructors allow creation of Code objects to be suppressed). The ClassFile object is then queried for its elements. A ClassFile and its elements should be considered immutable, even though it may be possible to change one of its objects (if so, it's a bug).

Examples

Here is a simple example which dumps out a classfile:


    static void printClass(String classname) {
        try {
            System.out.println(new ClassFile(classname));
        } catch (IOException e) {
            System.out.println(e.toString());
            e.printStackTrace();
        }
    }

Here is an example which prints out any synthetic methods:


    static void printSyntheticMethods(InputStream in) throws IOException {
        ClassFile cf = new ClassFile(in);
        Iterator iter = cf.getMethods();
        while (iter.hasNext()) {
            Method m = (Method)iter.next();
            if (m.isSynthetic())
                 System.out.println(m.toString());
        }
    }

Related Documentation

Java Source File NameTypeComment
Access.javaClass A utility class defining access flags and access utility methods.
AccessTest.javaClass
Annotation.javaClass Annotation: a single annotation on a program element.
AnnotationComponent.javaClass AnnotationComponent: a single annotation on a program element.
ArrayElementValue.javaClass ArrayElementValue: the value portion of an annotation element that is an array of ElementValue instances.
AttributeMap.javaClass Class representing a map of classfile attributes.
ByteCodes.javaInterface Constant definitions for the bytecodes defined in the Java Virtual Machine specification, Chapter 10.
ClassElementValue.javaClass ClassElementValue: the value part of a single element for those annotations that are a class type.
ClassFile.javaClass Class representing a Java class file.
ClassName.javaClass Class representing the name of a Java class.
ClassNameTest.javaClass
Code.javaClass The Code attribute of a method.
ConstantPool.javaClass Class representing a Java class file constant pool.
ConstantPoolReader.javaClass A Java class file constant pool reader.
ConstantPoolTest.javaClass
CPClassInfo.javaClass A class representing the CONSTANT_Class constant pool type.
CPDoubleInfo.javaClass A class representing the CONSTANT_Double constant pool type.
CPEntry.javaClass A class representing an entry in a ConstantPool.
CPFieldInfo.javaClass A class representing the CONSTANT_Fieldref constant pool type.
CPFieldMethodInfo.javaClass The base class for field, method, and interface method constant pool types.
CPFloatInfo.javaClass A class representing the CONSTANT_Float constant pool type.
CPIntegerInfo.javaClass A class representing the CONSTANT_Integer constant pool type.
CPInterfaceMethodInfo.javaClass A class representing the CONSTANT_InterfaceMethodref constant pool type.
CPLongInfo.javaClass A class representing the CONSTANT_Long constant pool type.
CPMethodInfo.javaClass A class representing the CONSTANT_Methodref constant pool type.
CPName.javaClass The base class for all constant pool types which store strings.
CPNameAndTypeInfo.javaClass A class representing the CONSTANT_NameAndType constant pool type.
CPStringInfo.javaClass A class representing the CONSTANT_String constant pool type.
CPUTF8Info.javaClass A class representing the CONSTANT_Utf8 constant pool type.
ElementValue.javaClass ElementValue: the value portion of the name-value pair of a single annotation element.
EnclosingMethod.javaClass A class representing the enclosing method of an inner class.
EnumElementValue.javaClass EnumElementValue: a single annotation on a program element for those annotations that are enum constants.
ExceptionTableEntry.javaClass An entry in the exception table of a method's code attribute.
Field.javaClass Base class for variables and methods.
InnerClass.javaClass An InnerClass attribute of a classfile.
InvalidClassFileAttributeException.javaClass Thrown when a classfile attribute does not follow the specified format. This is an RuntimeException subclass rather than an Exception because it is very unlikely that a classfile can be read without exception (such as when the classfile is truncated or overwritten) yet have an invalid attribute.
InvalidClassFormatException.javaClass Exception thrown when a classfile with an invalid format is detected.
LocalVariableTableEntry.javaClass An entry in the local variable table of a method's code attribute.
LocalVariableTypeTableEntry.javaClass An entry in the local variable type table of a method's code attribute. This table is similar to the local variable table, but differs in that it only contains the type information for those variables that are generic reference types.
Method.javaClass A Java method object.
NestedElementValue.javaClass NestedElementValue: an annotation on a program element that is another annotation.
Parameter.javaClass A representation of a parameter to a method declaration.
ParamNameTest.javaClass Converted from org.netbeans.jmi.javamodel.getters.ParamNameTest to directly use classfile API instead of javacore.
PrimitiveElementValue.javaClass A PrimitiveElementValue is the value portion of an annotation component that has a primitive type or String constant.
StackMapFrame.javaClass A stack map frame, as defined by a StackMapTable attribute.
Variable.javaClass A Java field.
VerificationTypeInfo.javaClass VerificationTypeInfo structure, which is defined as a C-like union in the Java Virtual Machine Specification, section 4.8.4, and is used to define stack map frame structures.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.