Interface ExtensibilityModel
-
- All Known Implementing Classes:
ExtensibilityModelImpl
public interface ExtensibilityModel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDiscardContent()Add a newDiscardUnboundContentModelElementImplinto the model so that when content is rendered it will be discarded.voidaddUnboundContent()Add 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(java.lang.String id, java.lang.String directiveName)ContentModelElementfindContentModelElement(java.lang.String id)Finds a specificContentModelElement(with the supplied identifier) in the model.voidflushModel(java.io.Writer out)Flushes the entire content of the model to the suppliedWriter.java.util.List<ExtensibilityModelElement>getAdditionalContentElements()Retrieves the list of elements being generated as part of extension processing.ExtensibilityDebugDatagetChildDebugData()ExtensibilityDebugDatagetDebugData()DeferredContentTargetModelElementgetDeferredContent(java.lang.String directiveId, java.lang.String directiveName)ExtensibilityModelgetParentModel()Gets theExtensibilityModelenclosing this model (assuming that this model is nested within a parent).ModelWritergetWriter()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.booleanisExtensionProcessing()Indicates whether the base model is complete and extensions are now being processed.booleanisModelStarted()Indicates 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.voidswitchToExtensionProcessing()Switches from defining the base model to processing extensions.
-
-
-
Method Detail
-
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
void flushModel(java.io.Writer out)
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
DeferredContentTargetModelElement getDeferredContent(java.lang.String directiveId, java.lang.String directiveName)
-
clearRelocatedContent
boolean clearRelocatedContent(java.lang.String id, java.lang.String directiveName)
-
remove
void remove(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, java.io.IOException
Removes content from the model.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionjava.io.IOException
-
replace
void replace(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, java.io.IOException
Replaces content in the model.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionjava.io.IOException
-
merge
void merge(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, java.io.IOException
Places new content in the base model.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionjava.io.IOException
-
before
void before(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, java.io.IOException
Places content in the model before some base content.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionjava.io.IOException
-
after
void after(ExtensibilityDirectiveData directive) throws freemarker.template.TemplateException, java.io.IOException
Places content in the modell after some base content.
- Parameters:
directive- ExtensibilityDirectiveData- Throws:
freemarker.template.TemplateExceptionjava.io.IOException
-
findContentModelElement
ContentModelElement findContentModelElement(java.lang.String id)
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
void setChildDebugData(ExtensibilityDebugData childData)
Sets the
ExtensibilityDebugDataassociated with the nested childExtensibilityModel.
-
getAdditionalContentElements
java.util.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
-
-