Interface ExtensibilityDirectiveData

All Known Implementing Classes:
DefaultExtensibilityDirectiveData

public interface ExtensibilityDirectiveData

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 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 ExtensibilityDirective type. 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 ExtensibilityDirective type.
    • getTarget

      String getTarget()

      Gets the id of the ExtensibilityDirective that the invocation of the associated ExtensibilityDirective type is targeting. This will only be expected to return a non-null value when the ExtensibilityDirective is 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 ExtensibilityDirective type.

      Returns:
      String
    • getBody

      freemarker.template.TemplateDirectiveBody getBody()

      Returns the TemplateDirectiveBody of the invocation of the associated ExtensibilityDirective type.

      Returns:
      A TemplateDirectiveBody associated with a single invocation of the associated ExtensibilityDirective.
    • createOpen

      OpenModelElement createOpen()

      Creates a new instance of the type of OpenModelElement for with the associated ExtensibilityDirective. In almost all cases this would be expected to be an instance of OpenModelElementImpl.

      Returns:
      OpenModelElement
    • createContentModelElement

      ContentModelElement createContentModelElement()

      Creates a new instance of the type of ContentModelElement for with the associated ExtensibilityDirective. The implementation returned could be varied depending upon the function of the ExtensibilityDirective. Where standard rendering of the associated TemplateDirectiveBody will occur, a DefaultExtensibilityContent will most likely be returned.

      Returns:
      OpenModelElement
    • createClose

      CloseModelElement createClose()

      Creates a new instance of the type of CloseModelElement for with the associated ExtensibilityDirective. In almost all cases this would be expected to be an instance of CloseModelElementImpl.

      Returns:
      CloseModelElement
    • render

      void render(ModelWriter writer) throws freemarker.template.TemplateException, IOException

      Renders the output provided by the directive. In most cases this will probably call the render method of the associated TemplateDirectiveBody. However, it is possible that rendering may possible by directive with an empty body.

      Parameters:
      writer - ModelWriter to send the rendered output to.
      Throws:
      freemarker.template.TemplateException
      IOException