Class SpoonUtils
java.lang.Object
org.tudalgo.algoutils.tutor.general.SpoonUtils
A collection of utilities for working with spoon.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U extends spoon.reflect.declaration.CtType<?>>
TgetCtElementForSourceCode(String ignoredSourceCode, Class<U> ignoredKind, Matcher<Stringifiable> ignoredNameMatcher) Deprecated.static spoon.reflect.CtModelDeprecated.usegetType(String, Class)insteadstatic StringgetNameOfCtElement(Class<?> type) Returns a human-readable name of the given element type.static StringgetNameOfCtElement(spoon.reflect.declaration.CtElement element) Returns a human-readable name of the given element.static spoon.reflect.declaration.CtType<?>Returns the correspondingCtTypein the spoon world for the given class.static <T extends spoon.reflect.declaration.CtType<?>>
TReturns the correspondingCtTypein the spoon world for the given class.
-
Method Details
-
getCtElementForSourceCode
public static <T,U extends spoon.reflect.declaration.CtType<?>> T getCtElementForSourceCode(String ignoredSourceCode, Class<U> ignoredKind, Matcher<Stringifiable> ignoredNameMatcher) Deprecated.usegetType(String, Class)instead -
getNameOfCtElement
Returns a human-readable name of the given element.
- Parameters:
element- the element- Returns:
- the human-readable name
-
getNameOfCtElement
Returns a human-readable name of the given element type.
- Parameters:
type- the element type- Returns:
- the human-readable name
-
getCtModel
public static spoon.reflect.CtModel getCtModel()Deprecated.usegetType(String, Class)insteadReturns a
CtModelfor submission.If the test run is a test cycle run, the class loader of the test cycle is used to load the submission.
- Returns:
- the
CtModel - See Also:
-
TestCycleResolver
-
getType
Returns the correspondingCtTypein the spoon world for the given class.- Parameters:
className- the class to get the spoon type for- Returns:
- the corresponding
CtTypein the spoon world for the given class
-
getType
public static <T extends spoon.reflect.declaration.CtType<?>> T getType(String className, Class<T> type) Returns the correspondingCtTypein the spoon world for the given class.- Type Parameters:
T- the type of the spoon type to return- Parameters:
className- the class to get the spoon type fortype- the type of the spoon type to return- Returns:
- the corresponding
CtTypein the spoon world for the given class
-
getType(String, Class)instead