Methods Summary |
---|
abstract void | execute()override to perform transformation
|
protected abstract java.lang.String | getImplementation()This methods should return the classname implementation of the
underlying xslt processor
|
protected final java.io.OutputStream | getOutputStream()get the appropriate stream based on the format (frames/noframes)
if (AggregateTransformer.FRAMES.equals(caller.format)) {
// dummy output for the framed report
// it's all done by extension...
return new ByteArrayOutputStream();
} else {
return new BufferedOutputStream(
new FileOutputStream(new File(caller.toDir, "junit-noframes.html")));
}
|
protected abstract java.lang.String | getProcVersion(java.lang.String classNameImpl)Try to discover the xslt processor version based on the
className. There is nothing carved in stone and it can change
anytime, so this is just for the sake of giving additional
information if we can find it.
|
protected final java.lang.String | getXSLTCVersion(java.lang.String procVersionClassName)a bit simplistic but xsltc data are conveniently private non final
// there's a convenient xsltc class version but data are
// private so use package information
Class procVersion = Class.forName(procVersionClassName);
Package pkg = procVersion.getPackage();
return pkg.getName() + " " + pkg.getImplementationTitle()
+ " " + pkg.getImplementationVersion();
|
protected final java.lang.String | getXalanVersion(java.lang.String procVersionClassName)pretty useful data (Xalan version information) to display.
Class procVersion = Class.forName(procVersionClassName);
String pkg = procVersion.getPackage().getName();
try {
Field f = procVersion.getField("S_VERSION");
return pkg + " " + f.get(null).toString();
} catch (Exception e) {
return pkg + " ?.?";
}
|
static org.apache.tools.ant.taskdefs.optional.junit.XalanExecutor | newInstance(AggregateTransformer caller)Create a valid Xalan executor. It checks if Xalan2 is
present. If none is available, it fails.
XalanExecutor executor = null;
try {
Class clazz = Class.forName(PACKAGE + "Xalan2Executor");
executor = (XalanExecutor) clazz.newInstance();
} catch (Exception xsltcApacheMissing) {
caller.task.log(xsltcApacheMissing.toString());
throw new BuildException("Could not find xstlc nor xalan2 "
+ "in the classpath. Check "
+ "http://xml.apache.org/xalan-j");
}
String classNameImpl = executor.getImplementation();
String version = executor.getProcVersion(classNameImpl);
caller.task.log("Using " + version, Project.MSG_VERBOSE);
executor.setCaller(caller);
return executor;
|
private void | setCaller(AggregateTransformer caller)set the caller for this object.
// CheckStyle:VisibilityModifier ON
this.caller = caller;
|