Package org.concordion.api.extension
Interface ConcordionExtender
- All Known Implementing Classes:
ConcordionBuilder
public interface ConcordionExtender
Allows
ConcordionExtension
s to add features to Concordion.-
Method Summary
Modifier and TypeMethodDescriptionwithAssertEqualsListener
(AssertEqualsListener listener) Adds a listener toconcordion:assertEquals
commands.withAssertFalseListener
(AssertFalseListener listener) Adds a listener toconcordion:assertFalse
commands.withAssertTrueListener
(AssertTrueListener listener) Adds a listener toconcordion:assertTrue
commands.withBreadcrumbRenderer
(BreadcrumbRenderer breadcrumbRenderer) Overrides the listener for rendering bread crumbs.withBuildListener
(ConcordionBuildListener listener) Adds a listener that is invoked when a Concordion instance is built, providing access to theTarget
to which resources can be written.withCommand
(String namespaceURI, String commandName, Command command) Adds a command to Concordion.Adds a listener that is invoked when Concordion parses the specification document, providing access to the parsed document.withEmbeddedCSS
(String css) Embeds the given CSS in the Concordion output.withEmbeddedCSS
(String css, boolean append) Embeds the given CSS in the Concordion output.withEmbeddedJavaScript
(String javaScript) Embeds the given JavaScript in the Concordion output.withExampleListener
(ExampleListener listener) Adds a listener that is invoked before and after Concordion has processed the example, providing access to the example node.withExecuteListener
(ExecuteListener executeListener) Adds a listener toconcordion:execute
commands.withImplementationStatusModifier
(ImplementationStatusModifier statusModifier) Adds a status modifier which Concordion can apply to each specification example to override their status.withLinkedCSS
(String cssPath, Resource targetResource) Copies the given CSS file to the Concordion output folder, and adds a link to the CSS in the <head> section of the Concordion HTML.withLinkedJavaScript
(String jsPath, Resource targetResource) Copies the given JavaScript file to the Concordion output folder, and adds a link to the JavaScript in the <head> section of the Concordion HTML.withOuterExampleListener
(OuterExampleListener listener) Adds a listener that is invoked before and after Concordion has processed the "outer" example (which includes all commands in a specification not inside an example command).withResource
(String sourcePath, Resource targetResource) Copies a resource to the Concordion output.withRunListener
(RunListener listener) Adds a listener toconcordion:run
commands.withRunStrategy
(RunStrategy runStrategy) Sets the strategy for theRunCommand
.withSetListener
(SetListener setListener) Adds a listener toconcordion:set
commands.withSource
(Source source) Overrides the source that the Concordion specifications are read from.Overrides the locator for Concordion specifications.Adds a listener that is invoked before and after Concordion has processed the specification, providing access to the specification resource and root element.withSpecificationType
(String typeSuffix, SpecificationConverter specificationConverter) Adds a new specification type to the types that can be handled (by default HTML and Markdown are supported).withTarget
(Target target) Overrides the target that the Concordion specifications are written to.withThrowableListener
(ThrowableCaughtListener throwableListener) Adds a listener that is invoked when an uncaughtThrowable
is thrown by a command, including commands that have been added usingwithCommand(String, String, Command)
.withVerifyRowsListener
(VerifyRowsListener listener) Adds a listener toconcordion:verifyRows
commands.
-
Method Details
-
withCommand
Adds a command to Concordion.- Parameters:
namespaceURI
- the URI to be used for the namespace of the command. Must not beconcordion.org
.commandName
- the name to be used for the command. The fully qualified name composed of thenamespaceURI
andcommandName
must be used to reference the command in the Concordion specification.command
- the command to be executed- Returns:
- this
-
withAssertEqualsListener
Adds a listener toconcordion:assertEquals
commands.- Parameters:
listener
- the listener- Returns:
- this
-
withAssertTrueListener
Adds a listener toconcordion:assertTrue
commands.- Parameters:
listener
- the listener- Returns:
- this
-
withAssertFalseListener
Adds a listener toconcordion:assertFalse
commands.- Parameters:
listener
- the listener- Returns:
- this
-
withExecuteListener
Adds a listener toconcordion:execute
commands.- Parameters:
executeListener
- the listener- Returns:
- this
-
withSetListener
Adds a listener toconcordion:set
commands.- Parameters:
setListener
- the listener- Returns:
- this
-
withRunListener
Adds a listener toconcordion:run
commands.- Parameters:
listener
- the listener- Returns:
- this
-
withVerifyRowsListener
Adds a listener toconcordion:verifyRows
commands.- Parameters:
listener
- the listener- Returns:
- this
-
withThrowableListener
Adds a listener that is invoked when an uncaughtThrowable
is thrown by a command, including commands that have been added usingwithCommand(String, String, Command)
.- Parameters:
throwableListener
- the listener- Returns:
- this
-
withDocumentParsingListener
Adds a listener that is invoked when Concordion parses the specification document, providing access to the parsed document.- Parameters:
listener
- the listener- Returns:
- this
-
withSpecificationProcessingListener
Adds a listener that is invoked before and after Concordion has processed the specification, providing access to the specification resource and root element.- Parameters:
listener
- the listener- Returns:
- this
-
withExampleListener
Adds a listener that is invoked before and after Concordion has processed the example, providing access to the example node.- Parameters:
listener
- the listener- Returns:
- this
-
withImplementationStatusModifier
Adds a status modifier which Concordion can apply to each specification example to override their status.- Parameters:
statusModifier
- the status modifier- Returns:
- this
-
withOuterExampleListener
Adds a listener that is invoked before and after Concordion has processed the "outer" example (which includes all commands in a specification not inside an example command).- Parameters:
listener
- the listener- Returns:
- this
- Since:
- 2.0.2
-
withBuildListener
Adds a listener that is invoked when a Concordion instance is built, providing access to theTarget
to which resources can be written.- Parameters:
listener
- the listener- Returns:
- this
-
withResource
Copies a resource to the Concordion output.- Parameters:
sourcePath
- Storage PathtargetResource
- Target Resource- Returns:
- this
-
withEmbeddedCSS
Embeds the given CSS in the Concordion output.- Parameters:
css
- CSS- Returns:
- this
-
withEmbeddedCSS
Embeds the given CSS in the Concordion output.- Parameters:
css
- CSSappend
- if true appends as last element in head section, else inserts as first element- Returns:
- this
-
withLinkedCSS
Copies the given CSS file to the Concordion output folder, and adds a link to the CSS in the <head> section of the Concordion HTML.- Parameters:
cssPath
- CSS PathtargetResource
- Target Resource- Returns:
- this
-
withEmbeddedJavaScript
Embeds the given JavaScript in the Concordion output.- Parameters:
javaScript
- javaScript- Returns:
- this
-
withLinkedJavaScript
Copies the given JavaScript file to the Concordion output folder, and adds a link to the JavaScript in the <head> section of the Concordion HTML.- Parameters:
jsPath
- path to javascripttargetResource
- target resource- Returns:
- this
-
withSource
Overrides the source that the Concordion specifications are read from.- Parameters:
source
- the new source- Returns:
- this
-
withTarget
Overrides the target that the Concordion specifications are written to.- Parameters:
target
- the new target- Returns:
- this
-
withSpecificationLocator
Overrides the locator for Concordion specifications.- Parameters:
locator
- the new specification locator- Returns:
- this
-
withRunStrategy
Sets the strategy for theRunCommand
.- Parameters:
runStrategy
- the new strategy for running the specifications- Returns:
- this
-
withBreadcrumbRenderer
Overrides the listener for rendering bread crumbs.- Parameters:
breadcrumbRenderer
- the new bread crumb renderer- Returns:
- this
-
withSpecificationType
ConcordionExtender withSpecificationType(String typeSuffix, SpecificationConverter specificationConverter) Adds a new specification type to the types that can be handled (by default HTML and Markdown are supported).- Parameters:
typeSuffix
- the suffix of the file type to map this tospecificationConverter
- converts the specification to HTML format- Returns:
- this
-