|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ImportRegistrationResolver
Represents the known imports for a particular compilation unit, and resolves whether a particular type name can be expressed as a simple type name or requires a fully-qualified type name.
Method Summary | |
---|---|
void |
addImport(JavaType javaType)
Explicitly registers an import. |
JavaPackage |
getCompilationUnitPackage()
|
Set<JavaType> |
getRegisteredImports()
Provides access to the registered imports. |
boolean |
isAdditionLegal(JavaType javaType)
Indicates whether the presented JavaType can be legally presented to addImport(JavaType) . |
boolean |
isFullyQualifiedFormRequired(JavaType javaType)
Determines whether the presented JavaType must be used in a fully-qualified form or not. |
boolean |
isFullyQualifiedFormRequiredAfterAutoImport(JavaType javaType)
Automatically invokes isAdditionLegal(JavaType) , then addImport(JavaType) , and
finally isFullyQualifiedFormRequired(JavaType) , returning the result of the final method. |
Method Detail |
---|
JavaPackage getCompilationUnitPackage()
boolean isFullyQualifiedFormRequired(JavaType javaType)
JavaType
must be used in a fully-qualified form or not.
It may only be used in simple form if:
DataType.VARIABLE
; orDataType.PRIMITIVE
; orNote that advanced implementations may be able to determine all types available in a particular package, but this is not required.
javaType
- to lookup (required)
boolean isFullyQualifiedFormRequiredAfterAutoImport(JavaType javaType)
isAdditionLegal(JavaType)
, then addImport(JavaType)
, and
finally isFullyQualifiedFormRequired(JavaType)
, returning the result of the final method.
This method is the main method that should be used by callers, as it will automatically attempt to
cause a JavaType
to be used in its simple form if at all possible.
javaType
- to automatically register (if possible) and lookup whether simplified used is available (required)
boolean isAdditionLegal(JavaType javaType)
JavaType
can be legally presented to addImport(JavaType)
.
It is considered legal only if the presented JavaType
is of type DataType.TYPE
,
there is not an existing conflicting registered import, and the proposed type is not within the default
package. Note it is legal to add types from the same package as the compilation unit, and indeed may be
required by implementations that are otherwise unaware of all the types available in a particular package.
javaType
-
void addImport(JavaType javaType)
isAdditionLegal(JavaType)
for verification).
javaType
- to register (required)Set<JavaType> getRegisteredImports()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |