public class SourceCompilationUnitFactory extends Object
ICompilationUnit
's
given File's.Constructor and Description |
---|
SourceCompilationUnitFactory(CompilerProject project) |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(ISourceFileHandler handler)
Registers a new handler with the factory.
|
boolean |
canCreateCompilationUnit(File file)
Determines if there is a registered handler that can handle the specified
File.
|
boolean |
canCreateCompilationUnitForFileType(String fileExtensionWithoutDot)
Determines if there is a registered handler for the file type associated
with the specified file extension ( without the dot eg:
as , not .as ). |
boolean |
canCreateInvisibleCompilationUnit(File file)
Determines if an invisible
ICompilationUnit can be created for
the specified file. |
ICompilationUnit |
createCompilationUnit(File file,
DefinitionPriority.BasePriority basePriority,
int order,
String qname,
String locale)
Constructs an
ICompilationUnit that can process the specified
file, if there is a registered handler that can handle the specified
file. |
String[] |
getHandledFileExtensions()
Utility method to get an array of all file extensions for which there
is a handler.
|
boolean |
needCompilationUnit(File file,
String qname,
String locale)
Determines if a
ICompilationUnit is needed for the specified
file, qualified name, and locale. |
public SourceCompilationUnitFactory(CompilerProject project)
public void addHandler(ISourceFileHandler handler)
handler
- Handler to register.public boolean canCreateCompilationUnitForFileType(String fileExtensionWithoutDot)
as
, not .as
).fileExtensionWithoutDot
- The file extension to check without a dot, for
example mxml
.public boolean canCreateCompilationUnit(File file)
file
- A file.ICompilationUnit
can be constructed for the
specified File.public boolean needCompilationUnit(File file, String qname, String locale)
ICompilationUnit
is needed for the specified
file, qualified name, and locale.
This method will return false for resource bundles when the project does has an empty locale list.
ICompilationUnit
is needed, false otherwise.public ICompilationUnit createCompilationUnit(File file, DefinitionPriority.BasePriority basePriority, int order, String qname, String locale)
ICompilationUnit
that can process the specified
file, if there is a registered handler that can handle the specified
file.file
- A file.basePriority
- DefinitionPriority.BasePriority
used to determine
if definitions defined by the new ICompilationUnit
shadow
definitions defined by other ICompilationUnit
s.order
- The index of the entry in the source path or source list
that is causing this method to be called.locale
- locale of the file if the file is locale dependent or
null
if the file is not locale dependent.ICompilationUnit
or null if there is no handler that
can handle the specified file or the handler decides to return null.public String[] getHandledFileExtensions()
public boolean canCreateInvisibleCompilationUnit(File file)
ICompilationUnit
can be created for
the specified file.file
- A file.ICompilationUnit
can be created for
the specified file, false otherwise.Copyright © 2016 The Apache Software Foundation. All rights reserved.