|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.roo.model.ImportRegistrationResolverImpl
public class ImportRegistrationResolverImpl
Constructor Summary | |
---|---|
ImportRegistrationResolverImpl(JavaPackage compilationUnitPackage)
|
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 ImportRegistrationResolver.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 ImportRegistrationResolver.isAdditionLegal(JavaType) , then ImportRegistrationResolver.addImport(JavaType) , and
finally ImportRegistrationResolver.isFullyQualifiedFormRequired(JavaType) , returning the result of the final method. |
static boolean |
isPartOfJavaLang(String simpleTypeName)
Determines whether the presented simple type name is part of java.lang or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImportRegistrationResolverImpl(JavaPackage compilationUnitPackage)
Method Detail |
---|
public void addImport(JavaType javaType)
ImportRegistrationResolver
ImportRegistrationResolver.isAdditionLegal(JavaType)
for verification).
addImport
in interface ImportRegistrationResolver
javaType
- to register (required)public JavaPackage getCompilationUnitPackage()
getCompilationUnitPackage
in interface ImportRegistrationResolver
public Set<JavaType> getRegisteredImports()
ImportRegistrationResolver
getRegisteredImports
in interface ImportRegistrationResolver
public boolean isAdditionLegal(JavaType javaType)
ImportRegistrationResolver
JavaType
can be legally presented to ImportRegistrationResolver.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.
isAdditionLegal
in interface ImportRegistrationResolver
public boolean isFullyQualifiedFormRequired(JavaType javaType)
ImportRegistrationResolver
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.
isFullyQualifiedFormRequired
in interface ImportRegistrationResolver
javaType
- to lookup (required)
public boolean isFullyQualifiedFormRequiredAfterAutoImport(JavaType javaType)
ImportRegistrationResolver
ImportRegistrationResolver.isAdditionLegal(JavaType)
, then ImportRegistrationResolver.addImport(JavaType)
, and
finally ImportRegistrationResolver.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.
isFullyQualifiedFormRequiredAfterAutoImport
in interface ImportRegistrationResolver
javaType
- to automatically register (if possible) and lookup whether simplified used is available (required)
public static boolean isPartOfJavaLang(String simpleTypeName)
simpleTypeName
- the simple type name (required)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |