use of ratpack.groovy.script.internal.LineNumber in project ratpack by ratpack.
the class ClosureUtil method getSourceInfo.
public static SourceInfo getSourceInfo(Closure<?> closure) {
Class<?> closureClass = closure.getClass();
LineNumber lineNumber = closureClass.getAnnotation(LineNumber.class);
if (lineNumber == null) {
return null;
}
Class<?> rootClass = getRootClass(closure);
ScriptPath scriptPath = rootClass.getAnnotation(ScriptPath.class);
if (scriptPath == null) {
return null;
}
return new SourceInfo(scriptPath.value(), lineNumber.value());
}
Aggregations