Interface ExtensibilityModel
- All Known Implementing Classes:
ExtensibilityModelImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a newDiscardUnboundContentModelElementImplinto the model so that when content is rendered it will be discarded.voidAdd a newUnboundContentModelElementImplinto the model so that when content is rendered it will be kept but will not be available to extensions to modify.voidafter(ExtensibilityDirectiveData directive) Places content in the modell after some base content.voidbefore(ExtensibilityDirectiveData directive) Places content in the model before some base content.booleanclearRelocatedContent(String id, String directiveName) Finds a specificContentModelElement(with the supplied identifier) in the model.voidflushModel(Writer out) Flushes the entire content of the model to the suppliedWriter.Retrieves the list of elements being generated as part of extension processing.getDeferredContent(String directiveId, String directiveName) Gets theExtensibilityModelenclosing this model (assuming that this model is nested within a parent).Gets theModelWriterbeing used by this instance.voidinsertDeferredContentTarget(int index, OpenModelElement open, DeferredContentTargetModelElement target, CloseModelElement close) AllowsDeferredContentTargetModelElementinstances (along with their associatedOpenModelElementandCloseModelElementinstances) to be inserted at a requested point in the model.booleanIndicates whether the base model is complete and extensions are now being processed.booleanIndicates whether or not the has been started.voidmerge(ExtensibilityDirectiveData directive) Places new content in the base model.voidremove(ExtensibilityDirectiveData directive) Removes content from the model.voidreplace(ExtensibilityDirectiveData directive) Replaces content in the model.voidsetChildDebugData(ExtensibilityDebugData childData) Sets theExtensibilityDebugDataassociated with the nested childExtensibilityModel.voidSwitches from defining the base model to processing extensions.
-
Method Details
-
isModelStarted
boolean isModelStarted()Indicates whether or not the has been started.
- Returns:
- boolean
-
switchToExtensionProcessing
void switchToExtensionProcessing()Switches from defining the base model to processing extensions. When extension processing the "merge" action can no longer be used but the "remove", "replace", "modify", "before" and "after" actions can be.
-
isExtensionProcessing
boolean isExtensionProcessing()Indicates whether the base model is complete and extensions are now being processed. Extension processing commences once the
switchToExtensionProcessingmethod has been called. When extension processing the "merge" action can no longer be used but the "remove", "replace", "modify", "before" and "after" actions can be.- Returns:
- boolean
-
getParentModel
ExtensibilityModel getParentModel()Gets the
ExtensibilityModelenclosing this model (assuming that this model is nested within a parent).- Returns:
- The enclosing
ExtensibilityModelif the current model is nested andnullotherwise.
-
getWriter
ModelWriter getWriter()Gets the
ModelWriterbeing used by this instance.- Returns:
- ModelWriter
-
flushModel
Flushes the entire content of the model to the supplied
Writer. Once this has been done it will no longer be possible to update the model.- Parameters:
out- AWriterto render the model to.
-
addUnboundContent
void addUnboundContent()Add a new
UnboundContentModelElementImplinto the model so that when content is rendered it will be kept but will not be available to extensions to modify. This is used when processing the content in base files that is not provided by anExtensibilityDirective. -
addDiscardContent
void addDiscardContent()Add a new
DiscardUnboundContentModelElementImplinto the model so that when content is rendered it will be discarded. This is used when extension files are processed that contain "unbounded" content (that is content that is not provided by anExtensibilityDirective). -
getDeferredContent
-
clearRelocatedContent
-
remove
void remove(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException Removes content from the model.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionIOException
-
replace
void replace(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException Replaces content in the model.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionIOException
-
merge
void merge(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException Places new content in the base model.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionIOException
-
before
void before(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException Places content in the model before some base content.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionIOException
-
after
void after(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, IOException Places content in the modell after some base content.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionIOException
-
findContentModelElement
Finds a specific
ContentModelElement(with the supplied identifier) in the model.- Parameters:
id- String- Returns:
- ContentModelElement
-
getDebugData
ExtensibilityDebugData getDebugData()- Returns:
- The
ExtensibilityDebugDataassociated with theExtensibilityModel.
-
getChildDebugData
ExtensibilityDebugData getChildDebugData()- Returns:
- The
ExtensibilityDebugDataassociated with the nested childExtensibilityModel.
-
setChildDebugData
Sets the
ExtensibilityDebugDataassociated with the nested childExtensibilityModel. -
getAdditionalContentElements
List<ExtensibilityModelElement> getAdditionalContentElements()Retrieves the list of elements being generated as part of extension processing.
- Returns:
- List
-
insertDeferredContentTarget
void insertDeferredContentTarget(int index, OpenModelElement open, DeferredContentTargetModelElement target, CloseModelElement close) Allows
DeferredContentTargetModelElementinstances (along with their associatedOpenModelElementandCloseModelElementinstances) to be inserted at a requested point in the model. This facility should be used with extreme care and was provided to allow WebScripts run outside of the context of a page to process dependencies.- Parameters:
index- The index within the model to insert the elementsopen- TheOpenModelElementthat identifies the start of the contenttarget- TheDeferredContentTargetModelElementfor adding deferred content intoclose- TheCloseModelElementthat identifies the end of the content
-