public class TemplateUnificator
extends java.lang.Object
Copyright (C) 2012-2016 JIOWA Business Solutions GmbH, Bettinastr. 30 , 60325 Frankfurt am Main, Germany
Homepage: www.jiowa.de
All rights reserved.
Download: www.jiowa.de/download.html
License: www.jiowa.de/license.html
Modifier and Type | Field and Description |
---|---|
protected TemplateUnificator |
parent |
protected TemplateMapUnificator |
root |
protected Template |
template |
protected TemplateMap |
templateMap |
protected java.util.SortedSet<java.lang.String> |
visited |
Modifier | Constructor and Description |
---|---|
|
TemplateUnificator(Template template,
TemplateMapUnificator root)
Constructs a unificator for a given template and the underlying template map.
|
protected |
TemplateUnificator(Template template,
TemplateUnificator parent)
This constructor should only be used from within
TemplateUnificator . |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
addLeftOffsetToEachLineOfString(int offset,
java.lang.String s)
Adds an offset (whitespace) string to the front of a string.
|
protected java.util.List<Tag> |
addLeftOffsetToIncludedTemplate(java.util.List<Tag> tagListOfTemplate,
int offset)
Adjusts the positions of included template according to the given left offset.
|
protected java.util.List<IncludeTag> |
collectAllIncludeTagsRecursively()
Collects all include tags of this template.
|
protected int |
computeLeftTextOffset(java.util.LinkedList<Tag> list)
Computes the left text offset until the current tag in the given list.
|
protected boolean |
inducesCycle(java.lang.String templateName)
Returns true if a template inclusion cycle is induced, and false, otherwise.
|
protected void |
logUniqueErrorMessage(java.lang.String msg) |
Template |
unify()
Returns the internal template as unified template (without containing any include statements any more).
|
protected TemplateMap |
unifyIncludeTags(java.util.List<IncludeTag> list)
Unifies all include tags.
|
protected InlineSubTemplateTag |
unifyInlineSubTemplateTag(InlineSubTemplateTag inlineTag,
TemplateMap unifiedIncTemplateMap)
Unifies an inline subtemplate tag, i.e. it inserts include tags into the subtemplate (recursively if needed).
|
protected SubTemplateStructureTag |
unifySubTemplateStructureTag(SubTemplateStructureTag subStructTag,
TemplateMap unifiedIncTemplateMap)
Unifies a subtemplate structure tag.
|
protected Template |
unifyTemplate()
Unifies a template by considering by processing all its includes.
|
protected TemplateMapUnificator root
protected TemplateUnificator parent
protected Template template
protected TemplateMap templateMap
protected java.util.SortedSet<java.lang.String> visited
public TemplateUnificator(Template template, TemplateMapUnificator root)
template
- root
- reference to root TemplateMapUnificator
protected TemplateUnificator(Template template, TemplateUnificator parent)
TemplateUnificator
. Therefore, it is protected.public Template unify()
protected java.util.List<IncludeTag> collectAllIncludeTagsRecursively()
IncludeTag
sprotected TemplateMap unifyIncludeTags(java.util.List<IncludeTag> list)
list
- TemplateMap
protected Template unifyTemplate()
protected SubTemplateStructureTag unifySubTemplateStructureTag(SubTemplateStructureTag subStructTag, TemplateMap unifiedIncTemplateMap)
subStructTag
- unifiedIncTemplateMap
- protected InlineSubTemplateTag unifyInlineSubTemplateTag(InlineSubTemplateTag inlineTag, TemplateMap unifiedIncTemplateMap)
inlineTag
- unifiedIncTemplateMap
- protected boolean inducesCycle(java.lang.String templateName)
templateName
- template which could induce a cycle.protected int computeLeftTextOffset(java.util.LinkedList<Tag> list)
list
- protected java.util.List<Tag> addLeftOffsetToIncludedTemplate(java.util.List<Tag> tagListOfTemplate, int offset)
tagListOfTemplate
- template as list of tagsoffset
- number of spaces as offsetTag
sprotected java.lang.String addLeftOffsetToEachLineOfString(int offset, java.lang.String s)
offset
- s
- protected void logUniqueErrorMessage(java.lang.String msg)