public class DefaultExtensibilityDirectiveData extends Object implements 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.
| Constructor and Description |
|---|
DefaultExtensibilityDirectiveData(String id,
String action,
String target,
String directiveName,
freemarker.template.TemplateDirectiveBody body,
freemarker.core.Environment env) |
| Modifier and Type | Method and Description |
|---|---|
CloseModelElement |
createClose()
Creates a new instance of the type of
CloseModelElement for with the associated ExtensibilityDirective. |
ContentModelElement |
createContentModelElement()
Creates a new instance of the type of
ContentModelElement for with the associated ExtensibilityDirective. |
OpenModelElement |
createOpen()
Creates a new instance of the type of
OpenModelElement for with the associated ExtensibilityDirective. |
String |
getAction()
Gets the action being performed by the invocation of the associated
ExtensibilityDirective type. |
freemarker.template.TemplateDirectiveBody |
getBody()
Returns the
TemplateDirectiveBody of the invocation of the associated ExtensibilityDirective type. |
String |
getDirectiveName()
Returns the name of the associated
ExtensibilityDirective type. |
freemarker.core.Environment |
getEnv() |
String |
getId()
Returns the id of FreeMarker directive represented by implementing instance.
|
String |
getTarget()
Gets the id of the
ExtensibilityDirective that the invocation of the associated ExtensibilityDirective type
is targeting. |
void |
render(ModelWriter writer)
Renders the output provided by the directive.
|
String |
toString() |
public freemarker.core.Environment getEnv()
public String getId()
ExtensibilityDirectiveDataReturns the id of FreeMarker directive represented by implementing instance.
getId in interface ExtensibilityDirectiveDatapublic String getAction()
ExtensibilityDirectiveDataGets the action being performed by the invocation of the associated ExtensibilityDirective type. The default
set of actions include "merge", "remove", "replace", "before" and "after".
getAction in interface ExtensibilityDirectiveDataExtensibilityDirective type.public String getTarget()
ExtensibilityDirectiveDataGets 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.
getTarget in interface ExtensibilityDirectiveDatapublic String getDirectiveName()
ExtensibilityDirectiveDataReturns the name of the associated ExtensibilityDirective type.
getDirectiveName in interface ExtensibilityDirectiveDatapublic freemarker.template.TemplateDirectiveBody getBody()
ExtensibilityDirectiveDataReturns the TemplateDirectiveBody of the invocation of the associated ExtensibilityDirective type.
getBody in interface ExtensibilityDirectiveDataTemplateDirectiveBody associated with a single invocation of the associated ExtensibilityDirective.public OpenModelElement createOpen()
ExtensibilityDirectiveDataCreates 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.
createOpen in interface ExtensibilityDirectiveDatapublic ContentModelElement createContentModelElement()
ExtensibilityDirectiveDataCreates 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.
createContentModelElement in interface ExtensibilityDirectiveDatapublic CloseModelElement createClose()
ExtensibilityDirectiveDataCreates 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.
createClose in interface ExtensibilityDirectiveDatapublic void render(ModelWriter writer) throws freemarker.template.TemplateException, IOException
ExtensibilityDirectiveDataRenders 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.
render in interface ExtensibilityDirectiveDatawriter - ModelWriter to send the rendered output to.freemarker.template.TemplateExceptionIOExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.