Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.model.java
Interface JavaModel  view JavaModel download JavaModel.java

All Superinterfaces:
javax.ide.model.java.source.util.TreeLocator, javax.ide.model.java.source.write.TreeManager, javax.ide.model.java.source.util.TreeResolver

public interface JavaModel
extends javax.ide.model.java.source.write.TreeManager, javax.ide.model.java.source.util.TreeResolver, javax.ide.model.java.source.util.TreeLocator

The JavaModel is the central point of access to all source compilation unit facilities. Read and write access to parse trees is provided through the TreeManager interface. The ability to resolve source references to declarations is provided through the TreeResolver interface. The ability to fetch the source for a declaration is provided through the TreeLocator interface. Finally, declaration loading is provided through the JavaModel interface itself. Typically, a JavaModel will have an underlying classpath and sourcepath that define its search path.


Method Summary
 javax.ide.model.java.declaration.TypeD getArrayType(javax.ide.model.java.declaration.TypeD componentType, int dims)
          Fetches a TypeD for the given array type of the specified component type an dimensions.
 javax.ide.model.java.declaration.ClassD getClass(java.lang.String sourceName)
          Fetches a ClassD for the given fully qualified name in source format, null if none.
 javax.ide.model.java.declaration.PackageD getPackage(java.lang.String sourceName)
          Fetches a PackageD for the given fully-qualified name.
 
Methods inherited from interface javax.ide.model.java.source.write.TreeManager
beginMultiTransaction, cloneSourceFile, createSourceFile, getAnonymousFile, getMultiTransaction, getSourceFile
 
Methods inherited from interface javax.ide.model.java.source.util.TreeResolver
getResolvedDeclaration, getResolvedDeclarations, getResolvedType, getResolvedTypes
 
Methods inherited from interface javax.ide.model.java.source.util.TreeLocator
getTree
 

Method Detail

getClass

public javax.ide.model.java.declaration.ClassD getClass(java.lang.String sourceName)
Fetches a ClassD for the given fully qualified name in source format, null if none. The name may denote a primitive type, void return type, array type, or class type.

If multiple sources of class information are available, the most up-to-date one should be returned. For example, suppose we have both a class file C.class and a source file C.java that both provide class information for a class C. If C.class has a more recent timestamp than C.java, then a ClassD built from C.class should be returned.

Although implementations are not required to return the same instance each time, they are encouraged to do so as it will dramatically improve performance.

Note: TypeD's, except for TypeVariableD's, can be uniquely identified by their source names.


getArrayType

public javax.ide.model.java.declaration.TypeD getArrayType(javax.ide.model.java.declaration.TypeD componentType,
                                                           int dims)
Fetches a TypeD for the given array type of the specified component type an dimensions.


getPackage

public javax.ide.model.java.declaration.PackageD getPackage(java.lang.String sourceName)
Fetches a PackageD for the given fully-qualified name.

Although implementations are not required to return the same instance each time, they are encouraged to do so as it will dramatically improve performance.