3. Implementation classes
In order to run an atomic step (implemented in the JVM), the processor
must know what class provides its implementation. The preferred way to
identify implementation classes is with the
XMLCalabash
annotation:
package com.example.package;
import com.xmlcalabash.core.XMLCalabash;
import com.xmlcalabash.library.DefaultStep;
@XMLCalabash(
name = "ex:step-name",
type = "{http://example.com/ns/extensions}step-name")
public class StepName extends DefaultStep {
…
}
The name
annotation might be used in
messages, but it's the type
annotation that's important.
It must be the namespace URI and local name of the step type in “Clark
notation.” If there are multiple steps that share an implementation the
type
annotation may be a space-separated list
of tokens.
If for some reason it isn't possible to use the annotation, the
cc:implementation
element in the XML Configuration
file can be used instead:
XML configuration: | <cc:implementation type=" |
The type
attribute may be a space-separated
list of QNames. The class-name
must be a fully
qualified class name, such as com.xmlcalabash.library.Identity
.