@OpenApiAll
public class SorterTool
extends com.nomagic.magicreport.engine.tools.SortTool
com.nomagic.magicreport.engine.tools.SortTool.AscendingSort, com.nomagic.magicreport.engine.tools.SortTool.DescendingSort, com.nomagic.magicreport.engine.tools.SortTool.HumanAscendingSort, com.nomagic.magicreport.engine.tools.SortTool.HumanDescendingSort| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTEXT_NAME
Contains a context name.
|
| Constructor and Description |
|---|
SorterTool() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection |
containmentTreeSort(java.util.Collection collection)
Sorter for sorting elements that they would look same as in browser tree.
|
java.lang.String |
getBlankValue()
Return the value for blank field.
|
protected java.lang.Object |
getValue(java.lang.Object object,
java.lang.String propertyName)
Look up a object value by property name.
|
java.util.Collection |
humanSort(java.util.Collection collection)
Special sorting function with human order, which says to split the text to be sorted into numeric and
non-numeric chunks, then sort so that the numeric chunks are treated as numbers.
|
void |
setProperties(java.util.Properties properties)
This method is invoked by the template engine runtime, after class has been initializing, to set the
template properties.
|
java.util.Collection |
sort(java.util.Collection collection)
Sort function for template report.
|
java.util.Collection |
tagSort(java.util.Collection collection,
Stereotype stereotype,
java.lang.String tagName)
Sort element by tag name of specific stereotype.
|
java.util.Collection |
tagSort(java.util.Collection collection,
Stereotype stereotype,
java.lang.String tagName,
boolean forceNumber)
Sort element by tag name of specific stereotype.
|
java.util.Collection |
tagSort(java.util.Collection collection,
java.lang.String stereotypeName,
java.lang.String tagName)
Sort element by tag name of specific stereotype name.
|
java.util.Collection |
tagSort(java.util.Collection collection,
java.lang.String stereotypeName,
java.lang.String tagName,
boolean forceNumber)
Sort element by tag name of specific stereotype name.
|
java.util.Collection |
treeSort(java.util.Collection collection)
Special sorting function with human order for containment tree elements, which says to split the text to be
sorted into numeric and non-numeric chunks, then sort so that the numeric chunks are treated as numbers.
|
getNextToken, humanSort, humanSort, humanSort, isForceNumber, setForceNumber, sort, sort, sortByFirstNumber, sortByFirstNumber, sortByLocale, sortByLocaleclone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContextpublic static final java.lang.String CONTEXT_NAME
public void setProperties(java.util.Properties properties)
setProperties in interface com.nomagic.magicreport.engine.IToolsetProperties in class com.nomagic.magicreport.engine.Toolproperties - template engine propertiespublic java.lang.String getBlankValue()
public java.util.Collection sort(java.util.Collection collection)
$sorter
For example:
<code>
#foreach ($rel in $sorter.sort($package))
$rel.name
#end
</code>
This method will sort object in collection by default MagicDraw model ordering ('name' when input is a collection of NamedElement).
sort in class com.nomagic.magicreport.engine.tools.SortToolcollection - collection to be sortpublic java.util.Collection humanSort(java.util.Collection collection)
This method will sort object in collection by default MagicDraw model ordering. ('name' when input is a collection of NamedElement).
humanSort in class com.nomagic.magicreport.engine.tools.SortToolcollection - collection collection to be sortpublic java.util.Collection tagSort(java.util.Collection collection,
Stereotype stereotype,
java.lang.String tagName)
collection - elements to be sortedstereotype - specific stereotypepropertyName - tagNamepublic java.util.Collection tagSort(java.util.Collection collection,
java.lang.String stereotypeName,
java.lang.String tagName)
collection - elements to be sortedstereotypeName - specific stereotype namepropertyName - tagNamepublic java.util.Collection tagSort(java.util.Collection collection,
Stereotype stereotype,
java.lang.String tagName,
boolean forceNumber)
collection - elements to be sortedstereotype - specific stereotypeforceNumber - try to compare by numberpropertyName - tagNamepublic java.util.Collection tagSort(java.util.Collection collection,
java.lang.String stereotypeName,
java.lang.String tagName,
boolean forceNumber)
collection - elements to be sortedstereotypeName - specific stereotype nameforceNumber - try to compare by numberpropertyName - tagNamepublic java.util.Collection treeSort(java.util.Collection collection)
This method will sort object in collection by default MagicDraw model ordering. ('name' when input is a collection of NamedElement).
collection - collection collection to be sortpublic java.util.Collection containmentTreeSort(java.util.Collection collection)
collection - collection collection to be sortprotected java.lang.Object getValue(java.lang.Object object,
java.lang.String propertyName)
getValue in class com.nomagic.magicreport.engine.tools.SortToolobject - target object.propertyName - property name