public class ImportBuilder extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ImportBuilder.Strategy
Represents an import strategy.
|
| Constructor and Description |
|---|
ImportBuilder(ModelFactory factory,
PackageDeclaration packageDecl,
ImportBuilder.Strategy strategy)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
PackageDeclaration |
getPackageDeclaration()
Returns the package declaration of this builder.
|
Type |
resolve(Type type)
Resolves the target type and returns it as an imported type representation.
|
Type |
resolvePackageMember(Name name)
Resolves the type name as an package member of this current context.
|
List<ImportDeclaration> |
toImportDeclarations()
Returns the built import declarations.
|
Type |
toType(Name name)
Resolves the target type and returns it as an imported type representation.
|
Type |
toType(Type type)
Resolves the target type and returns it as an imported type representation.
|
public ImportBuilder(ModelFactory factory, PackageDeclaration packageDecl, ImportBuilder.Strategy strategy)
factory - the Java DOM factorypackageDecl - the target package declaration (nullable)strategy - the import strategyIllegalArgumentException - if the parameters are nullpublic Type resolvePackageMember(Name name)
name - the target type nameIllegalArgumentException - if the parameter is nullpublic Type resolve(Type type)
type - the target typeIllegalArgumentException - if the parameter is nullpublic Type toType(Name name)
name - the target type nameIllegalArgumentException - if the parameter is nullpublic Type toType(Type type)
type - the target typeIllegalArgumentException - if the parameter is nullpublic List<ImportDeclaration> toImportDeclarations()
public PackageDeclaration getPackageDeclaration()
null if the current package is the default (unnamed) packageCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.