public class SymbolType extends Object implements org.walkmod.javalang.ast.SymbolData, org.walkmod.javalang.ast.MethodSymbolData, org.walkmod.javalang.ast.FieldSymbolData, org.walkmod.javalang.ast.ConstructorSymbolData
| Constructor and Description |
|---|
SymbolType() |
SymbolType(Class<?> clazz) |
SymbolType(List<SymbolType> upperBounds) |
SymbolType(List<SymbolType> upperBounds,
List<SymbolType> lowerBounds) |
SymbolType(String name) |
SymbolType(String name,
List<SymbolType> upperBounds) |
SymbolType(String name,
List<SymbolType> upperBounds,
List<SymbolType> lowerBounds) |
| Modifier and Type | Method and Description |
|---|---|
static SymbolType |
anonymousClassOf(String name)
Build symbol representing an anonymous class.
|
boolean |
belongsToAnonymousClass() |
static SymbolType |
classValueOf(String className,
int arrayCount)
Build a simple class based symbol probably as an array.
|
SymbolType |
clone() |
SymbolType |
cloneAsArray(int arrayCount) |
SymbolType |
cloneAsArray(String name,
int arrayCount) |
static SymbolType |
cloneAsArrayOrNull(SymbolType type,
int arrayCount) |
SymbolType |
cloneAsTypeVariable(String typeVariable) |
static SymbolType |
enumConstantOf(String name)
Build symbol representing an enum constant class.
|
boolean |
equals(Object o) |
int |
getArrayCount() |
List<Class<?>> |
getBoundClasses() |
List<SymbolType> |
getBounds() |
Class<?> |
getClazz() |
Constructor<?> |
getConstructor() |
Field |
getField() |
List<Class<?>> |
getLowerBoundClasses() |
List<SymbolType> |
getLowerBounds() |
Method |
getMethod() |
String |
getName() |
List<SymbolType> |
getParameterizedTypes() |
String |
getTemplateVariable() |
boolean |
hasBounds() |
boolean |
isCompatible(SymbolType other) |
boolean |
isLoadedAnonymousClass()
Is symbol for anonymous class that has been either being loaded successfully
or being detected as disabled code on load?
|
boolean |
isTemplateVariable() |
SymbolType |
markDisabledCode()
If code is disabled via conditional compilation the symbol information
is typically incomplete because no class has been created.
|
org.walkmod.javalang.ast.SymbolData |
merge(org.walkmod.javalang.ast.SymbolData other) |
SymbolType |
refactor(Map<String,SymbolType> mapping) |
SymbolType |
refactor(Map<String,SymbolType> mapping,
boolean dynamicVar) |
SymbolType |
refactor(String variable,
SymbolType st,
boolean dynamicVar) |
SymbolType |
refactorToTypeVariable(String typeVariable,
SymbolType st,
boolean dynamicVar) |
void |
setArrayCount(int arrayCount) |
void |
setClazz(Class<?> clazz) |
void |
setConstructor(Constructor<?> constructor) |
void |
setField(Field field) |
void |
setMethod(Method method) |
void |
setName(String name)
Deprecated.
|
void |
setParameterizedTypes(List<SymbolType> parameterizedTypes) |
void |
setTemplateVariable(String templateVariable)
Deprecated.
use factory methods "templateVariableOf" instead
Sets the template variable
|
static <T extends org.walkmod.javalang.ast.SymbolData> |
toClassArray(T[] args) |
String |
toString() |
static SymbolType |
typeVariableOf(String typeVariable,
Class<Object> clazz)
Builds a symbol for a type variable from a Java class.
|
static SymbolType |
typeVariableOf(String typeVariable,
List<SymbolType> upperBounds)
Builds a symbol for a type variable from a list of upper bounds.
|
static SymbolType |
typeVariableOf(String typeVariable,
String name)
Builds a symbol for a type variable from a (Java class) name.
|
static SymbolType |
typeVariableOf(TypeVariable<?> typeVariable)
Builds a symbol for a type variable from a TypeVariable.
|
static SymbolType |
valueOf(Method method,
Map<String,SymbolType> typeMapping) |
static SymbolType |
valueOf(Type type,
Map<String,SymbolType> typeMapping) |
static SymbolType |
valueOf(Type type,
SymbolType arg,
Map<String,SymbolType> updatedTypeMapping,
Map<String,SymbolType> typeMapping)
Builds a symbol type from a Java type.
|
SymbolType |
withName(String name)
Clones replacing the symbol type name.
|
public SymbolType()
public SymbolType(List<SymbolType> upperBounds)
public SymbolType(List<SymbolType> upperBounds, List<SymbolType> lowerBounds)
public SymbolType(String name, List<SymbolType> upperBounds)
public SymbolType(String name, List<SymbolType> upperBounds, List<SymbolType> lowerBounds)
public SymbolType(Class<?> clazz)
public SymbolType(String name)
public boolean hasBounds()
public List<SymbolType> getBounds()
public void setClazz(Class<?> clazz)
public String getName()
getName in interface org.walkmod.javalang.ast.SymbolData@Deprecated public void setName(String name)
name - the complete class namepublic List<SymbolType> getLowerBounds()
public List<SymbolType> getParameterizedTypes()
getParameterizedTypes in interface org.walkmod.javalang.ast.SymbolDatapublic void setParameterizedTypes(List<SymbolType> parameterizedTypes)
public int getArrayCount()
getArrayCount in interface org.walkmod.javalang.ast.SymbolDatapublic void setArrayCount(int arrayCount)
public boolean isTemplateVariable()
isTemplateVariable in interface org.walkmod.javalang.ast.SymbolDatapublic void setTemplateVariable(String templateVariable)
templateVariable - name of the template variable (e.g "T")public String getTemplateVariable()
public boolean isCompatible(SymbolType other)
public boolean isLoadedAnonymousClass()
public Class<?> getClazz()
getClazz in interface org.walkmod.javalang.ast.SymbolDatapublic List<Class<?>> getBoundClasses()
getBoundClasses in interface org.walkmod.javalang.ast.SymbolDatapublic SymbolType withName(String name)
name - the symbol type namepublic SymbolType clone()
public SymbolType cloneAsTypeVariable(String typeVariable)
public static SymbolType cloneAsArrayOrNull(SymbolType type, int arrayCount)
public SymbolType cloneAsArray(int arrayCount)
public SymbolType cloneAsArray(String name, int arrayCount)
public SymbolType markDisabledCode()
public static SymbolType anonymousClassOf(String name)
name - the full class name of an anonymous classpublic static SymbolType classValueOf(String className, int arrayCount)
className - the name of the array typearrayCount - the array dimensions (1 an array, 2 matrix, etc..)public static SymbolType enumConstantOf(String name)
name - is the enumeration class namepublic static SymbolType typeVariableOf(String typeVariable, String name)
typeVariable - the name of the variablename - the (upper bound) type of the variablepublic static SymbolType typeVariableOf(String typeVariable, Class<Object> clazz)
typeVariable - the name of the variableclazz - the (upper bound) type of the variablepublic static SymbolType typeVariableOf(String typeVariable, List<SymbolType> upperBounds)
typeVariable - the name of the variableupperBounds - the upper bounds of the type variablepublic static SymbolType typeVariableOf(TypeVariable<?> typeVariable) throws InvalidTypeException
typeVariable - The loaded type variable by reflectionInvalidTypeException - when the type cannot be loadedpublic static SymbolType valueOf(Type type, SymbolType arg, Map<String,SymbolType> updatedTypeMapping, Map<String,SymbolType> typeMapping) throws InvalidTypeException
type - type to convertarg - reference class to take into account if the type is a generic variable.updatedTypeMapping - place to put the resolved generic variables.typeMapping - reference type mapping for generic variables.InvalidTypeException - when the type cannot be loadedpublic static SymbolType valueOf(Type type, Map<String,SymbolType> typeMapping) throws InvalidTypeException
InvalidTypeExceptionpublic Method getMethod()
getMethod in interface org.walkmod.javalang.ast.MethodSymbolDatapublic void setMethod(Method method)
public static SymbolType valueOf(Method method, Map<String,SymbolType> typeMapping) throws ClassNotFoundException, InvalidTypeException
public void setField(Field field)
public Field getField()
getField in interface org.walkmod.javalang.ast.FieldSymbolDatapublic org.walkmod.javalang.ast.SymbolData merge(org.walkmod.javalang.ast.SymbolData other)
merge in interface org.walkmod.javalang.ast.SymbolDatapublic void setConstructor(Constructor<?> constructor)
public Constructor<?> getConstructor()
getConstructor in interface org.walkmod.javalang.ast.ConstructorSymbolDatapublic boolean belongsToAnonymousClass()
public List<Class<?>> getLowerBoundClasses()
getLowerBoundClasses in interface org.walkmod.javalang.ast.SymbolDatapublic SymbolType refactorToTypeVariable(String typeVariable, SymbolType st, boolean dynamicVar)
public SymbolType refactor(String variable, SymbolType st, boolean dynamicVar)
public SymbolType refactor(Map<String,SymbolType> mapping)
public SymbolType refactor(Map<String,SymbolType> mapping, boolean dynamicVar)
public static <T extends org.walkmod.javalang.ast.SymbolData> Class<?>[] toClassArray(T[] args)
Copyright © 2018. All rights reserved.