Java Doc for ClassReader.java in  » 6.0-JDK-Modules-sun » javac-compiler » com » sun » tools » javac » jvm » 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 » 6.0 JDK Modules sun » javac compiler » com.sun.tools.javac.jvm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tools.javac.jvm.ClassFile
      com.sun.tools.javac.jvm.ClassReader

All known Subclasses:   com.sun.tools.javac.main.JavaCompiler,
ClassReader
public class ClassReader extends ClassFile implements Completer(Code)
This class provides operations to read a classfile into an internal representation. The internal representation is anchored in a ClassSymbol which contains in its scope symbol representations for all other definitions in the classfile. Top-level Classes themselves appear as members of the scopes of PackageSymbols.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Inner Class :public static class BadClassFile extends CompletionFailure
Inner Class :interface ProxyVisitor extends Attribute.Visitor
Inner Class :static class EnumAttributeProxy extends Attribute
Inner Class :static class ArrayAttributeProxy extends Attribute
Inner Class :static class CompoundAnnotationProxy extends Attribute
Inner Class :class AnnotationDeproxy implements ProxyVisitor
Inner Class :class AnnotationDefaultCompleter extends AnnotationDeproxy implements Annotate.Annotator
Inner Class :class AnnotationCompleter extends AnnotationDeproxy implements Annotate.Annotator
Inner Class :public interface SourceCompleter

Field Summary
 booleanallowAnnotations
     Switch: allow annotations.
 booleanallowGenerics
     Switch: read GJ signature information.
 booleanallowVarargs
     Switch: read varargs attribute.
 Annotateannotate
    
 intbp
     The current input pointer.
 byte[]buf
     The buffer containing the currently read class file.
 booleancheckClassFile
     Switch: check class file for correct minor version, unrecognized attributes.
final protected static  Context.Key<ClassReader>classReaderKey
     The context key for the class reader.
final  NamecompletionFailureName
    
protected  JavaFileObjectcurrentClassFile
     The path name of the class file currently being read.
protected  LocationcurrentLoc
    
protected  SymbolcurrentOwner
     The class or method currently being read.
final  Loglog
    
final  Name.Tablenames
     The name table.
 int[]poolIdx
     For every constant pool entry, an index into buf where the defining section of the entry is found.
 Object[]poolObj
     The objects of the constant pool.
public  booleanpreferSource
    
public  booleanreadAllOfClassFile
     Switch: read constant pool and code sections.
public  booleansaveParameterNames
     Switch: preserve parameter names from the variable table.
 intsbp
    
 booleansigEnterPhase
    
 intsiglimit
    
 byte[]signature
     The unread portion of the currently read type is signature[sigp..siglimit-1].
 byte[]signatureBuffer
    
 intsigp
    
public  SourceCompletersourceCompleter
     Can be reassigned from outside: the completer to be used for ".java" files.
 Symtabsyms
     The symbol table.
 Typestypes
    
protected  Scopetypevars
     The current scope where type variables are entered.
 booleanverbose
     Switch: verbose output.

Constructor Summary
protected  ClassReader(Context context, boolean definitive)
     Construct a new class reader, optionally treated as the definitive classreader for this invocation.

Method Summary
 longadjustClassFlags(long flags)
    
 longadjustFieldFlags(long flags)
    
 longadjustMethodFlags(long flags)
    
 voidattachAnnotationDefault(Symbol sym)
     Attach the default value for an annotation element.
 voidattachAnnotations(Symbol sym)
     Attach annotations.
 voidattachParameterAnnotations(Symbol method)
     Attach parameter annotations.
public  BadClassFilebadClassFile(String key, Object... args)
    
 TypeclassSigToType()
     Convert class signature to type, where signature is implicit.
public  voidcomplete(Symbol sym)
     Completion for classes to be loaded.
public  ClassSymboldefineClass(Name name, Symbol owner)
     Define a new class given its name and owner.
public  ClassSymbolenterClass(Name name, TypeSymbol owner)
     Create a new toplevel or member class symbol with given name and owner and enter in `classes' unless already there.
public  ClassSymbolenterClass(Name flatName, JavaFileObject classFile)
     Creates a new toplevel class symbol with given flat name and given class (or source) file.
public  ClassSymbolenterClass(Name flatname)
     Create a new member or toplevel class symbol with given flat name and enter in `classes' unless already there.
public  PackageSymbolenterPackage(Name fullname)
     Make a package, given its fully qualified name.
public  PackageSymbolenterPackage(Name name, PackageSymbol owner)
     Make a package, given its unqualified name and enclosing package.
protected  voidenterTypevars(Type t)
     Enter type variables of this classtype and all enclosing ones in `typevars'.
protected  voidenterTypevars(Symbol sym)
    
protected  voidextraFileActions(PackageSymbol pack, JavaFileObject fe)
    
 TypefindTypeVar(Name name)
     Find type variable with given name in `typevars' scope.
 chargetChar(int bp)
     Extract a character at position bp from buf.
 doublegetDouble(int bp)
     Extract a double at position bp from buf.
 floatgetFloat(int bp)
     Extract a float at position bp from buf.
 intgetInt(int bp)
     Extract an integer at position bp from buf.
 longgetLong(int bp)
     Extract a long integer at position bp from buf.
protected  EnumSet<JavaFileObject.Kind>getPackageFileKinds()
    
protected  voidincludeClassFile(PackageSymbol p, JavaFileObject file)
     Include class corresponding to given class file in package, unless (1) we already have one the same kind (.class or .java), or (2) we have one of the other kind, and the given class file is older.
 voidindexPool()
     Index all constant pool entries, writing their start addresses into poolIdx.
public  voidinit(Symtab syms)
     Initialize classes and packages, treating this as the definitive classreader.
public static  ClassReaderinstance(Context context)
     Get the ClassReader instance for this invocation.
public  ClassSymbolloadClass(Name flatname)
     Load a toplevel class with given fully qualified name The class is entered into `classes' only if load was successful.
 charnextChar()
     Read a character.
 intnextInt()
     Read an integer.
public  booleanpackageExists(Name fullname)
     Check to see if a package exists, given its fully qualified name.
protected  JavaFileObjectpreferredFileObject(JavaFileObject a, JavaFileObject b)
     Implement policy to choose to derive information from a source file or a class file when both are present.
 AttributereadAttributeValue()
    
 voidreadClass(ClassSymbol c)
     Read contents of a given class symbol `c'.
 voidreadClassAttr(ClassSymbol c, Name attrName, int attrLen)
     Read class attribute.
 voidreadClassAttrs(ClassSymbol c)
     Read class attributes.
 ObjectreadClassOrType(int i)
     If name is an array type or class signature, return the corresponding type; otherwise return a ClassSymbol with given name.
 ClassSymbolreadClassSymbol(int i)
     Read class entry.
 CodereadCode(Symbol owner)
     Read code block.
 CompoundAnnotationProxyreadCompoundAnnotation()
    
 voidreadEnclosingMethodAttr(Symbol sym)
    
 TypereadEnumType(int i)
    
 VarSymbolreadField()
     Read a field.
 voidreadInnerClasses(ClassSymbol c)
     Read inner class info.
 voidreadMemberAttr(Symbol sym, Name attrName, int attrLen)
     Read member attribute.
 voidreadMemberAttrs(Symbol sym)
     Read member attributes.
 MethodSymbolreadMethod()
     Read a method.
 NamereadName(int i)
     Read name.
 ObjectreadPool(int i)
     Read constant pool entry at start address i, use pool as a cache.
 TypereadType(int i)
     Read signature and convert to type.
 TypereadTypeOrClassSymbol(int i)
    
 List<Type>readTypeParams(int i)
     Read signature and convert to type parameters.
 TypesigToType(Name sig)
     Convert signature to type, where signature is a name.
 TypesigToType(byte[] sig, int offset, int len)
     Convert signature to type, where signature is a byte array segment.
 TypesigToType()
     Convert signature to type, where signature is implicit.
 TypesigToTypeParam()
     Convert (implicit) signature to type parameter.
 List<Type>sigToTypeParams(Name name)
     Convert signature to type parameters, where signature is a name.
 List<Type>sigToTypeParams(byte[] sig, int offset, int len)
     Convert signature to type parameters, where signature is a byte array segment.
 List<Type>sigToTypeParams()
     Convert signature to type parameters, where signature is implicit.
 List<Type>sigToTypes(char terminator)
     Convert (implicit) signature to list of types until `terminator' is encountered.
 voidskipMember()
    
 voidunrecognized(Name attrName)
     Report unrecognized attribute.

Field Detail
allowAnnotations
boolean allowAnnotations(Code)
Switch: allow annotations.



allowGenerics
boolean allowGenerics(Code)
Switch: read GJ signature information.



allowVarargs
boolean allowVarargs(Code)
Switch: read varargs attribute.



annotate
Annotate annotate(Code)



bp
int bp(Code)
The current input pointer.



buf
byte[] buf(Code)
The buffer containing the currently read class file.



checkClassFile
boolean checkClassFile(Code)
Switch: check class file for correct minor version, unrecognized attributes.



classReaderKey
final protected static Context.Key<ClassReader> classReaderKey(Code)
The context key for the class reader.



completionFailureName
final Name completionFailureName(Code)
Force a completion failure on this name



currentClassFile
protected JavaFileObject currentClassFile(Code)
The path name of the class file currently being read.



currentLoc
protected Location currentLoc(Code)



currentOwner
protected Symbol currentOwner(Code)
The class or method currently being read.



log
final Log log(Code)
The log to use for verbose output



names
final Name.Table names(Code)
The name table.



poolIdx
int[] poolIdx(Code)
For every constant pool entry, an index into buf where the defining section of the entry is found.



poolObj
Object[] poolObj(Code)
The objects of the constant pool.



preferSource
public boolean preferSource(Code)
Switch: prefer source files instead of newer when both source and class are available



readAllOfClassFile
public boolean readAllOfClassFile(Code)
Switch: read constant pool and code sections. This switch is initially set to false but can be turned on from outside.



saveParameterNames
public boolean saveParameterNames(Code)
Switch: preserve parameter names from the variable table.



sbp
int sbp(Code)



sigEnterPhase
boolean sigEnterPhase(Code)



siglimit
int siglimit(Code)



signature
byte[] signature(Code)
The unread portion of the currently read type is signature[sigp..siglimit-1].



signatureBuffer
byte[] signatureBuffer(Code)



sigp
int sigp(Code)



sourceCompleter
public SourceCompleter sourceCompleter(Code)
Can be reassigned from outside: the completer to be used for ".java" files. If this remains unassigned ".java" files will not be loaded.



syms
Symtab syms(Code)
The symbol table.



types
Types types(Code)



typevars
protected Scope typevars(Code)
The current scope where type variables are entered.



verbose
boolean verbose(Code)
Switch: verbose output.




Constructor Detail
ClassReader
protected ClassReader(Context context, boolean definitive)(Code)
Construct a new class reader, optionally treated as the definitive classreader for this invocation.




Method Detail
adjustClassFlags
long adjustClassFlags(long flags)(Code)



adjustFieldFlags
long adjustFieldFlags(long flags)(Code)
Adjusting flags



adjustMethodFlags
long adjustMethodFlags(long flags)(Code)



attachAnnotationDefault
void attachAnnotationDefault(Symbol sym)(Code)
Attach the default value for an annotation element.



attachAnnotations
void attachAnnotations(Symbol sym)(Code)
Attach annotations.



attachParameterAnnotations
void attachParameterAnnotations(Symbol method)(Code)
Attach parameter annotations.



badClassFile
public BadClassFile badClassFile(String key, Object... args)(Code)



classSigToType
Type classSigToType()(Code)
Convert class signature to type, where signature is implicit.



complete
public void complete(Symbol sym) throws CompletionFailure(Code)
Completion for classes to be loaded. Before a class is loaded we make sure its enclosing class (if any) is loaded.



defineClass
public ClassSymbol defineClass(Name name, Symbol owner)(Code)
Define a new class given its name and owner.



enterClass
public ClassSymbol enterClass(Name name, TypeSymbol owner)(Code)
Create a new toplevel or member class symbol with given name and owner and enter in `classes' unless already there.



enterClass
public ClassSymbol enterClass(Name flatName, JavaFileObject classFile)(Code)
Creates a new toplevel class symbol with given flat name and given class (or source) file.
Parameters:
  flatName - a fully qualified binary class name
Parameters:
  classFile - the class file or compilation unit definingthe class (may be null ) a newly created class symbol
throws:
  AssertionError - if the class symbol already exists



enterClass
public ClassSymbol enterClass(Name flatname)(Code)
Create a new member or toplevel class symbol with given flat name and enter in `classes' unless already there.



enterPackage
public PackageSymbol enterPackage(Name fullname)(Code)
Make a package, given its fully qualified name.



enterPackage
public PackageSymbol enterPackage(Name name, PackageSymbol owner)(Code)
Make a package, given its unqualified name and enclosing package.



enterTypevars
protected void enterTypevars(Type t)(Code)
Enter type variables of this classtype and all enclosing ones in `typevars'.



enterTypevars
protected void enterTypevars(Symbol sym)(Code)



extraFileActions
protected void extraFileActions(PackageSymbol pack, JavaFileObject fe)(Code)
this is used to support javadoc



findTypeVar
Type findTypeVar(Name name)(Code)
Find type variable with given name in `typevars' scope.



getChar
char getChar(int bp)(Code)
Extract a character at position bp from buf.



getDouble
double getDouble(int bp)(Code)
Extract a double at position bp from buf.



getFloat
float getFloat(int bp)(Code)
Extract a float at position bp from buf.



getInt
int getInt(int bp)(Code)
Extract an integer at position bp from buf.



getLong
long getLong(int bp)(Code)
Extract a long integer at position bp from buf.



getPackageFileKinds
protected EnumSet<JavaFileObject.Kind> getPackageFileKinds()(Code)
specifies types of files to be read when filling in a package symbol



includeClassFile
protected void includeClassFile(PackageSymbol p, JavaFileObject file)(Code)
Include class corresponding to given class file in package, unless (1) we already have one the same kind (.class or .java), or (2) we have one of the other kind, and the given class file is older.



indexPool
void indexPool()(Code)
Index all constant pool entries, writing their start addresses into poolIdx.



init
public void init(Symtab syms)(Code)
Initialize classes and packages, treating this as the definitive classreader.



instance
public static ClassReader instance(Context context)(Code)
Get the ClassReader instance for this invocation.



loadClass
public ClassSymbol loadClass(Name flatname) throws CompletionFailure(Code)
Load a toplevel class with given fully qualified name The class is entered into `classes' only if load was successful.



nextChar
char nextChar()(Code)
Read a character.



nextInt
int nextInt()(Code)
Read an integer.



packageExists
public boolean packageExists(Name fullname)(Code)
Check to see if a package exists, given its fully qualified name.



preferredFileObject
protected JavaFileObject preferredFileObject(JavaFileObject a, JavaFileObject b)(Code)
Implement policy to choose to derive information from a source file or a class file when both are present. May be overridden by subclasses.



readAttributeValue
Attribute readAttributeValue()(Code)



readClass
void readClass(ClassSymbol c)(Code)
Read contents of a given class symbol `c'. Both external and internal versions of an inner class are read.



readClassAttr
void readClassAttr(ClassSymbol c, Name attrName, int attrLen)(Code)
Read class attribute.



readClassAttrs
void readClassAttrs(ClassSymbol c)(Code)
Read class attributes.



readClassOrType
Object readClassOrType(int i)(Code)
If name is an array type or class signature, return the corresponding type; otherwise return a ClassSymbol with given name.



readClassSymbol
ClassSymbol readClassSymbol(int i)(Code)
Read class entry.



readCode
Code readCode(Symbol owner)(Code)
Read code block.



readCompoundAnnotation
CompoundAnnotationProxy readCompoundAnnotation()(Code)



readEnclosingMethodAttr
void readEnclosingMethodAttr(Symbol sym)(Code)



readEnumType
Type readEnumType(int i)(Code)



readField
VarSymbol readField()(Code)
Read a field.



readInnerClasses
void readInnerClasses(ClassSymbol c)(Code)
Read inner class info. For each inner/outer pair allocate a member class.



readMemberAttr
void readMemberAttr(Symbol sym, Name attrName, int attrLen)(Code)
Read member attribute.



readMemberAttrs
void readMemberAttrs(Symbol sym)(Code)
Read member attributes.



readMethod
MethodSymbol readMethod()(Code)
Read a method.



readName
Name readName(int i)(Code)
Read name.



readPool
Object readPool(int i)(Code)
Read constant pool entry at start address i, use pool as a cache.



readType
Type readType(int i)(Code)
Read signature and convert to type.



readTypeOrClassSymbol
Type readTypeOrClassSymbol(int i)(Code)



readTypeParams
List<Type> readTypeParams(int i)(Code)
Read signature and convert to type parameters.



sigToType
Type sigToType(Name sig)(Code)
Convert signature to type, where signature is a name.



sigToType
Type sigToType(byte[] sig, int offset, int len)(Code)
Convert signature to type, where signature is a byte array segment.



sigToType
Type sigToType()(Code)
Convert signature to type, where signature is implicit.



sigToTypeParam
Type sigToTypeParam()(Code)
Convert (implicit) signature to type parameter.



sigToTypeParams
List<Type> sigToTypeParams(Name name)(Code)
Convert signature to type parameters, where signature is a name.



sigToTypeParams
List<Type> sigToTypeParams(byte[] sig, int offset, int len)(Code)
Convert signature to type parameters, where signature is a byte array segment.



sigToTypeParams
List<Type> sigToTypeParams()(Code)
Convert signature to type parameters, where signature is implicit.



sigToTypes
List<Type> sigToTypes(char terminator)(Code)
Convert (implicit) signature to list of types until `terminator' is encountered.



skipMember
void skipMember()(Code)
Skip a field or method



unrecognized
void unrecognized(Name attrName)(Code)
Report unrecognized attribute.



Fields inherited from com.sun.tools.javac.jvm.ClassFile
final public static int CONSTANT_Class(Code)(Java Doc)
final public static int CONSTANT_Double(Code)(Java Doc)
final public static int CONSTANT_Fieldref(Code)(Java Doc)
final public static int CONSTANT_Float(Code)(Java Doc)
final public static int CONSTANT_Integer(Code)(Java Doc)
final public static int CONSTANT_InterfaceMethodref(Code)(Java Doc)
final public static int CONSTANT_Long(Code)(Java Doc)
final public static int CONSTANT_Methodref(Code)(Java Doc)
final public static int CONSTANT_NameandType(Code)(Java Doc)
final public static int CONSTANT_String(Code)(Java Doc)
final public static int CONSTANT_Unicode(Code)(Java Doc)
final public static int CONSTANT_Utf8(Code)(Java Doc)
final public static int JAVA_MAGIC(Code)(Java Doc)
final public static int MAX_CODE(Code)(Java Doc)
final public static int MAX_DIMENSIONS(Code)(Java Doc)
final public static int MAX_LOCALS(Code)(Java Doc)
final public static int MAX_PARAMETERS(Code)(Java Doc)
final public static int MAX_STACK(Code)(Java Doc)

Methods inherited from com.sun.tools.javac.jvm.ClassFile
public static byte[] externalize(byte[] buf, int offset, int len)(Code)(Java Doc)
public static byte[] externalize(Name name)(Code)(Java Doc)
public static byte[] internalize(byte[] buf, int offset, int len)(Code)(Java Doc)
public static byte[] internalize(Name name)(Code)(Java Doc)

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.