Class DefaultExtensibilityDirectiveData
- All Implemented Interfaces:
ExtensibilityDirectiveData
This is the default class for capturing the data contained within extensibility directives. It is required because directive instances are re-used so the data stored within them cannot be relied upon when building the content model.
- Author:
- David Draper
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultExtensibilityDirectiveData(String id, String action, String target, String directiveName, freemarker.template.TemplateDirectiveBody body, freemarker.core.Environment env) -
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.freemarker.core.EnvironmentgetEnv()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.toString()
-
Constructor Details
-
DefaultExtensibilityDirectiveData
-
-
Method Details
-
getEnv
public freemarker.core.Environment getEnv() -
getId
Description copied from interface:ExtensibilityDirectiveDataReturns the id of FreeMarker directive represented by implementing instance.
- Specified by:
getIdin interfaceExtensibilityDirectiveData- Returns:
- String
-
getAction
Description copied from interface:ExtensibilityDirectiveDataGets the action being performed by the invocation of the associated
ExtensibilityDirectivetype. The default set of actions include "merge", "remove", "replace", "before" and "after".- Specified by:
getActionin interfaceExtensibilityDirectiveData- Returns:
- A String representing the action being performed by the invocation of the associated
ExtensibilityDirectivetype.
-
getTarget
Description copied from interface:ExtensibilityDirectiveDataGets 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.- Specified by:
getTargetin interfaceExtensibilityDirectiveData- Returns:
- String
-
getDirectiveName
Description copied from interface:ExtensibilityDirectiveDataReturns the name of the associated
ExtensibilityDirectivetype.- Specified by:
getDirectiveNamein interfaceExtensibilityDirectiveData- Returns:
- String
-
getBody
public freemarker.template.TemplateDirectiveBody getBody()Description copied from interface:ExtensibilityDirectiveDataReturns the
TemplateDirectiveBodyof the invocation of the associatedExtensibilityDirectivetype.- Specified by:
getBodyin interfaceExtensibilityDirectiveData- Returns:
- A
TemplateDirectiveBodyassociated with a single invocation of the associatedExtensibilityDirective.
-
createOpen
Description copied from interface:ExtensibilityDirectiveDataCreates a new instance of the type of
OpenModelElementfor with the associatedExtensibilityDirective. In almost all cases this would be expected to be an instance ofOpenModelElementImpl.- Specified by:
createOpenin interfaceExtensibilityDirectiveData- Returns:
- OpenModelElement
-
createContentModelElement
Description copied from interface:ExtensibilityDirectiveDataCreates 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.- Specified by:
createContentModelElementin interfaceExtensibilityDirectiveData- Returns:
- OpenModelElement
-
createClose
Description copied from interface:ExtensibilityDirectiveDataCreates a new instance of the type of
CloseModelElementfor with the associatedExtensibilityDirective. In almost all cases this would be expected to be an instance ofCloseModelElementImpl.- Specified by:
createClosein interfaceExtensibilityDirectiveData- Returns:
- CloseModelElement
-
toString
-
render
Description copied from interface:ExtensibilityDirectiveDataRenders 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.- Specified by:
renderin interfaceExtensibilityDirectiveData- Parameters:
writer-ModelWriterto send the rendered output to.- Throws:
freemarker.template.TemplateExceptionIOException
-