use of com.dexels.navajo.version.AbstractVersion in project navajo by Dexels.
the class GetVersionInfo method evaluate.
@Override
public final Object evaluate() throws TMLExpressionException {
Object o = getOperand(0);
String packageName = o + "";
try {
Class<?> c = null;
if (DispatcherFactory.getInstance().getNavajoConfig().getClassloader() == null) {
c = Class.forName(packageName + ".Version");
} else {
c = Class.forName(packageName + ".Version", true, DispatcherFactory.getInstance().getNavajoConfig().getClassloader());
}
AbstractVersion v = (AbstractVersion) c.getDeclaredConstructor().newInstance();
return v.toString();
} catch (Exception e) {
throw new TMLExpressionException(this, "Could not find version object for package: " + packageName);
}
}
Aggregations