Class CompilationUnit
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit
- All Implemented Interfaces:
ICompilationUnit,IDependent
-
Field Summary
FieldsModifier and TypeFieldDescriptionchar[]char[]char[]char[]Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.IDependent
JAR_FILE_ENTRY_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionCompilationUnit(char[] contents, String fileName, String encoding) CompilationUnit(char[] contents, String fileName, String encoding, String destinationPath) CompilationUnit(char[] contents, String fileName, String encoding, String destinationPath, boolean ignoreOptionalProblems, String modName) CompilationUnit(char[] contents, String fileName, String encoding, String destinationPath, boolean ignoreOptionalProblems, String modName, Function<String, String> annotationPathProvider) -
Method Summary
Modifier and TypeMethodDescriptionchar[]Answer the contents of the compilation unit.getExternalAnnotationPath(String qualifiedTypeName) Answers a path for external annotations that has been configured for the providing classpath entry, ornull.char[]Answer the file name which defines the type.char[]Answer the name of the top level public type.char[]Returns the name of the module to which this compilation unit is associated.char[][]Answer the name of the package according to the directory structure or null if package consistency checks should be ignored.booleanAnswer if optional problems should be ignored for this compilation unit.module(LookupEnvironment rootEnvironment) Returns the binding of the module that this compilation unit is associated with.toString()
-
Field Details
-
contents
public char[] contents -
fileName
public char[] fileName -
mainTypeName
public char[] mainTypeName -
destinationPath
-
module
public char[] module
-
-
Constructor Details
-
CompilationUnit
-
CompilationUnit
-
CompilationUnit
-
CompilationUnit
-
-
Method Details
-
getContents
public char[] getContents()Description copied from interface:ICompilationUnitAnswer the contents of the compilation unit. In normal use, the contents are requested twice. Once during the initial lite parsing step, then again for the more detailed parsing step. Implementors must never return null - return an empty char[] instead, CharOperation.NO_CHAR being the candidate of choice.- Specified by:
getContentsin interfaceICompilationUnit
-
getFileName
public char[] getFileName()Description copied from interface:IDependentAnswer the file name which defines the type. The path part (optional) must be separated from the actual file proper name by a separator suitable for the type (java.io.File.separator for example), e.g. "c:\\source\\com\\p\\X.java" or "/com/p/Y.java". The path to the zip or jar file (optional) must be separated from the actual path part by JAR_FILE_ENTRY_SEPARATOR, e.g. "c:\\lib\\some.jar|/com/p/X.class" or "/lib/some.zip|/com/q/Y.class". The proper file name includes the suffix extension (e.g. ".java") e.g. "c:/org/eclipse/jdt/internal/compileri/env/IDependent.java" Return null if no file defines the type.- Specified by:
getFileNamein interfaceIDependent- See Also:
-
getMainTypeName
public char[] getMainTypeName()Description copied from interface:ICompilationUnitAnswer the name of the top level public type. For example, {Hashtable}.- Specified by:
getMainTypeNamein interfaceICompilationUnit
-
getPackageName
public char[][] getPackageName()Description copied from interface:ICompilationUnitAnswer the name of the package according to the directory structure or null if package consistency checks should be ignored. For example, {java, lang}.- Specified by:
getPackageNamein interfaceICompilationUnit
-
ignoreOptionalProblems
public boolean ignoreOptionalProblems()Description copied from interface:ICompilationUnitAnswer if optional problems should be ignored for this compilation unit. Implementors should returnfalseif there is no preference.- Specified by:
ignoreOptionalProblemsin interfaceICompilationUnit
-
toString
-
getModuleName
public char[] getModuleName()Description copied from interface:ICompilationUnitReturns the name of the module to which this compilation unit is associated. A return value ofnullsignals the unnamed module.- Specified by:
getModuleNamein interfaceICompilationUnit- Returns:
- module name or
nullfor the unnamed module.
-
module
Description copied from interface:ICompilationUnitReturns the binding of the module that this compilation unit is associated with.- Specified by:
modulein interfaceICompilationUnit- Returns:
- the binding representing the module.
-
getDestinationPath
- Specified by:
getDestinationPathin interfaceICompilationUnit
-
getExternalAnnotationPath
Description copied from interface:ICompilationUnitAnswers a path for external annotations that has been configured for the providing classpath entry, ornull.- Specified by:
getExternalAnnotationPathin interfaceICompilationUnit
-