Interface ExtensibilityDirectiveData
- All Known Implementing Classes:
DefaultExtensibilityDirectiveData
Represents a single invocation of an ExtensibilityDirective. This class is necessary since ExtensibilityDirective
can be used multiple times within a single request and their instance variables are volatile. As well as providing methods for the
instantiation of the OpenModelElement, ContentModelElement and CloseModelElement implementations associated with
the ExtensibilityDirective this interface ensures that all information required for processing the directive in the model
will not be lost when the next invocation of the directive type occurs.
- Author:
- David Draper
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of the type ofCloseModelElementfor with the associatedExtensibilityDirective.Creates a new instance of the type ofContentModelElementfor with the associatedExtensibilityDirective.Creates a new instance of the type ofOpenModelElementfor with the associatedExtensibilityDirective.Gets the action being performed by the invocation of the associatedExtensibilityDirectivetype.freemarker.template.TemplateDirectiveBodygetBody()Returns theTemplateDirectiveBodyof the invocation of the associatedExtensibilityDirectivetype.Returns the name of the associatedExtensibilityDirectivetype.getId()Returns the id of FreeMarker directive represented by implementing instance.Gets the id of theExtensibilityDirectivethat the invocation of the associatedExtensibilityDirectivetype is targeting.voidrender(ModelWriter writer) Renders the output provided by the directive.
-
Method Details
-
getId
String getId()Returns the id of FreeMarker directive represented by implementing instance.
- Returns:
- String
-
getAction
String getAction()Gets the action being performed by the invocation of the associated
ExtensibilityDirectivetype. The default set of actions include "merge", "remove", "replace", "before" and "after".- Returns:
- A String representing the action being performed by the invocation of the associated
ExtensibilityDirectivetype.
-
getTarget
String getTarget()Gets the id of the
ExtensibilityDirectivethat the invocation of the associatedExtensibilityDirectivetype is targeting. This will only be expected to return a non-null value when theExtensibilityDirectiveis being processed as part of an extension. Any action that has an effect on the existing model (such as "remove" or "replace") will always require target information.- Returns:
- String
-
getDirectiveName
String getDirectiveName()Returns the name of the associated
ExtensibilityDirectivetype.- Returns:
- String
-
getBody
freemarker.template.TemplateDirectiveBody getBody()Returns the
TemplateDirectiveBodyof the invocation of the associatedExtensibilityDirectivetype.- Returns:
- A
TemplateDirectiveBodyassociated with a single invocation of the associatedExtensibilityDirective.
-
createOpen
OpenModelElement createOpen()Creates a new instance of the type of
OpenModelElementfor with the associatedExtensibilityDirective. In almost all cases this would be expected to be an instance ofOpenModelElementImpl.- Returns:
- OpenModelElement
-
createContentModelElement
ContentModelElement createContentModelElement()Creates a new instance of the type of
ContentModelElementfor with the associatedExtensibilityDirective. The implementation returned could be varied depending upon the function of theExtensibilityDirective. Where standard rendering of the associatedTemplateDirectiveBodywill occur, aDefaultExtensibilityContentwill most likely be returned.- Returns:
- OpenModelElement
-
createClose
CloseModelElement createClose()Creates a new instance of the type of
CloseModelElementfor with the associatedExtensibilityDirective. In almost all cases this would be expected to be an instance ofCloseModelElementImpl.- Returns:
- CloseModelElement
-
render
Renders the output provided by the directive. In most cases this will probably call the
rendermethod of the associatedTemplateDirectiveBody. However, it is possible that rendering may possible by directive with an empty body.- Parameters:
writer-ModelWriterto send the rendered output to.- Throws:
freemarker.template.TemplateExceptionIOException
-