public class ReferenceFactory extends Object
IReference.| Modifier and Type | Method and Description |
|---|---|
static IReference |
builtinReference(IASLanguageConstants.BuiltinType type)
|
static IReference |
lexicalReference(IWorkspace workspace,
String baseName)
Generates an
IReference for an unqualified base name. |
static IResolvedQualifiersReference |
multinameReference(IWorkspace workspace,
Set<INamespaceDefinition> namespaces,
String baseName)
Generates an
IReference for a multiname coming from an ABC. |
static IReference |
notATypeReference(IWorkspace workspace,
String baseName)
Generates an
IReference for a type reference that will always be
an error. |
static IResolvedQualifiersReference |
packageQualifiedReference(IWorkspace workspace,
String qname)
Generates an
IReference for a fully qualified name. |
static IResolvedQualifiersReference |
packageQualifiedReference(IWorkspace workspace,
String qname,
boolean includeInternal)
Generates an
IReference for a fully qualified name. |
static IResolvedQualifiersReference |
packageQualifiedReference(IWorkspace workspace,
String packageName,
String baseName,
boolean includeInternal)
Generates an
IReference for a base name qualified by a package
name. |
static IReference |
parameterizedReference(IWorkspace workspace,
IReference base,
IReference param)
Generates an
IReference for a parameterized type, such as
{@code Vector. |
static IResolvedQualifiersReference |
resolvedQualifierQualifiedReference(IWorkspace workspace,
INamespaceDefinition namespace,
String baseName)
Generates an
IReference for a base name qualified by an
INamespaceDefinition. |
static IReference |
resolvedReference(IDefinition definition)
Generates an
IReference that always resolves to the
IDefinition passed in. |
public static IReference builtinReference(IASLanguageConstants.BuiltinType type)
type - The IASLanguageConstants.BuiltinType you want the
reference for.BuiltinReference.public static IReference lexicalReference(IWorkspace workspace, String baseName)
IReference for an unqualified base name.workspace - The workspace.baseName - The base name you want a reference to.LexicalReference.public static IResolvedQualifiersReference resolvedQualifierQualifiedReference(IWorkspace workspace, INamespaceDefinition namespace, String baseName)
IReference for a base name qualified by an
INamespaceDefinition.workspace - The workspace.namespace - The INamespaceDefinition to use as the qualifier.baseName - The base name you want to reference to.ResolvedQualifiersReference.public static IResolvedQualifiersReference packageQualifiedReference(IWorkspace workspace, String packageName, String baseName, boolean includeInternal)
IReference for a base name qualified by a package
name.workspace - The workspace.packageName - The package name to use as the qualifier.baseName - The base name you want a reference to.includeInternal - Indicates whether or not the reference should
resolve to package internal definitions.ResolvedQualifiersReference.public static IResolvedQualifiersReference packageQualifiedReference(IWorkspace workspace, String qname)
IReference for a fully qualified name.
It is expected that the string will be of the form
my.package.name.Foo. This will be used to generate a
reference to Foo in the package my.package.name.
workspace - The workspace.qname - A String representing a fully qualified name.ResolvedQualifiersReference.public static IResolvedQualifiersReference packageQualifiedReference(IWorkspace workspace, String qname, boolean includeInternal)
IReference for a fully qualified name.
It is expected that the string will be of the form
my.package.name.Foo. This will be used to generate a
reference to Foo in the package my.package.name.
workspace - The workspace.qname - A String representing a fully qualified name.includeInternal - Indicates whether or not the reference should
resolve to package internal definitions.ResolvedQualifiersReference.public static IResolvedQualifiersReference multinameReference(IWorkspace workspace, Set<INamespaceDefinition> namespaces, String baseName)
IReference for a multiname coming from an ABC.workspace - The workspace.namespaces - The set of INamespaceDefinitions to use as the
namespace set.baseName - The base name you want a reference to.ResolvedQualifiersReference.npublic static IReference parameterizedReference(IWorkspace workspace, IReference base, IReference param)
IReference for a parameterized type, such as
Vector.<Foo>.
This currently only supports one type parameter, as Vector is the only parameterized type, and it only takes 1 type parameter.
workspace - The workspace.base - The base reference, such as Vector in
Vector.<Foo>.param - The type parameter reference, such as Foo in
Vector.<Foo>.ParameterizedReference.public static IReference resolvedReference(IDefinition definition)
IReference that always resolves to the
IDefinition passed in.
This is useful for Vector methods, where the return type is
the type parameter for the Vector (i.e., T in
Vector.<T>).
definition - The IDefinition to generate a reference to.ResolvedReference that resolves to d.public static IReference notATypeReference(IWorkspace workspace, String baseName)
IReference for a type reference that will always be
an error. An example would be: class C extends a.b.c.d.Foo{} If a.b.c.d
was not a package name then this class would be used to represent the
reference. This is because a property access will be an error, but we
have to remember that something was specified for the base class so we
can report the correct error when we try and resolve it.workspace - The workspace.baseName - The base name you want a reference to.NotATypeReference.Copyright © 2016 The Apache Software Foundation. All rights reserved.