Class SherlockHelper
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.api.util.SherlockHelper
-
public class SherlockHelper extends java.lang.Object
Static helper functions and access to various engine functions which do not fit elsewhere in the api
-
-
Constructor Summary
Constructors Constructor Description SherlockHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
buildFieldReference(java.lang.reflect.Field field)
Builds the reference string of a field by prepending the declaring class namestatic ICodeBlockGroup
getInstanceOfCodeBlockGroup()
Constructs a new instance of the current ICodeBlockGroup implementation and returns itstatic ISourceFile
getSourceFile(long persistentId)
Fetches the instance of ISourceFile for the corresponding unique id
-
-
-
Method Detail
-
buildFieldReference
public static java.lang.String buildFieldReference(java.lang.reflect.Field field)
Builds the reference string of a field by prepending the declaring class name- Parameters:
field
- field to build reference for- Returns:
- string reference for field
-
getInstanceOfCodeBlockGroup
public static ICodeBlockGroup getInstanceOfCodeBlockGroup() throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
Constructs a new instance of the current ICodeBlockGroup implementation and returns it- Returns:
- New instance
- Throws:
java.lang.IllegalAccessException
- the implementation is incorrectjava.lang.InstantiationException
- issue creating new instancejava.lang.NoSuchMethodException
- the implementation is incorrectjava.lang.reflect.InvocationTargetException
- inuse code block group class is null, ensure SherlockEngine is running correctly
-
getSourceFile
public static ISourceFile getSourceFile(long persistentId)
Fetches the instance of ISourceFile for the corresponding unique id- Parameters:
persistentId
- unique id to fetch- Returns:
- instance of ISourceFile with passed id
-
-