Search in sources :

Example 1 with FailOnInvalidReference

use of eu.esdihumboldt.hale.io.xslt.internal.FailOnInvalidReference in project hale by halestudio.

the class XslTransformationUtil method createStrictVelocityContext.

/**
 * Create a new {@link VelocityContext} that lets template merging fail if
 * an invalid reference is encountered.
 *
 * @return the velocity context
 */
public static VelocityContext createStrictVelocityContext() {
    VelocityContext context = new VelocityContext();
    EventCartridge eventCartridge = new EventCartridge();
    eventCartridge.addEventHandler(new FailOnInvalidReference());
    context.attachEventCartridge(eventCartridge);
    return context;
}
Also used : VelocityContext(org.apache.velocity.VelocityContext) FailOnInvalidReference(eu.esdihumboldt.hale.io.xslt.internal.FailOnInvalidReference) EventCartridge(org.apache.velocity.app.event.EventCartridge)

Aggregations

FailOnInvalidReference (eu.esdihumboldt.hale.io.xslt.internal.FailOnInvalidReference)1 VelocityContext (org.apache.velocity.VelocityContext)1 EventCartridge (org.apache.velocity.app.event.EventCartridge)1