@OpenApiAll
public class ReportHelper
extends com.nomagic.magicreport.engine.Tool
$report
For example:
<code>
#foreach ($rel in $report.getRelationships($package))
$rel.name
#end
</code>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ICON_PROPERTY_RETINASCALING |
| Constructor and Description |
|---|
ReportHelper() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<Element> |
collectRelationships(Element element)
Gets direct relationships of specified element.
|
java.util.Collection<Element> |
collectRelationships(Element element,
boolean includeIndirect)
Gets relationships of specified element.
|
java.util.Collection<Element> |
collectRelationships(Element element,
boolean includeIndirect,
boolean isRecursive)
Gets relationships of specified element.
|
boolean |
containsStereotype(Element element,
java.lang.String stereotypeName)
Returns true if element contains a stereotype (include all derived stereotype) for the specified stereotype
name.
|
boolean |
containsStereotype(Element element,
java.lang.String stereotypeName,
boolean includeDerived)
Returns true if element contains a stereotype for the specified stereotype name.
|
java.lang.String |
createValueSpecificationText(ValueSpecification specification)
Create text represents the ValueSpecification element.
|
java.util.Collection<Element> |
filter(java.util.Collection<Element> elementList,
java.lang.String propertyName,
java.util.Collection<?> propertyValue)
Return the collection from the element list filtered by specified property name.
|
java.util.Collection<BaseElement> |
filterClassName(java.util.Collection<BaseElement> elementList,
java.util.Collection<java.lang.String> shortNameForClassTypes)
Return the collection from the element list filtered by short name for class types.
|
java.util.Collection<Diagram> |
filterDiagram(java.util.Collection<Diagram> diagramList,
java.util.Collection<java.lang.String> digramTypes)
Return the collection from the diagram list filtered by types.
|
java.util.Collection<BaseElement> |
filterElement(java.util.Collection<BaseElement> elementList,
java.util.Collection<java.lang.String> humanTypes)
Return the collection from the element list filtered by human types.
|
java.util.List<Element> |
filterElementByElementFilters(java.util.List<Element> elements,
java.util.List<com.nomagic.magicdraw.ui.ElementFilter> elementFilters) |
java.util.Collection<BaseElement> |
filterElementByStereotypeName(java.util.Collection<BaseElement> elementList,
java.util.Collection<java.lang.String> stereotypesNames)
Return the collection from the element list filtered by stereotype.
|
java.util.Collection<BaseElement> |
filterElementType(java.util.Collection<BaseElement> elementList,
java.util.Collection<java.lang.String> elementTypes)
Return the collection from the element list filtered by element types.
|
java.util.List<Element> |
filterVisibleElement(java.util.List<Element> elements) |
java.util.List<Element> |
filterVisibleElement(java.util.List<Element> elements,
boolean includeAuxiliaryResources) |
java.util.Collection<Element> |
findElementByName(java.util.Collection<Element> source,
java.lang.String regex)
Search and return the elements from name by regular expression.
|
Element |
findElementInCollection(java.util.Collection<? extends Element> col,
java.lang.String elementName)
Search and return the element in the collection by element name.
|
java.util.Collection<Element> |
findRelationship(Package modelPackage)
Search and return a collection of relationship element inside package.
|
java.util.Collection<Element> |
findRelationship(Package modelPackage,
boolean recursive)
Search and return a collection of relationship element inside package.
|
java.lang.String |
getActorNumber(Element element)
Return the actor ID of Actor.
|
java.util.List<Class> |
getAllCustomizationsByElement(Element element)
Get all customizations from specific element.
|
java.util.List<Class> |
getAllCustomizationsByElement(Element element,
java.lang.Object aStereotype)
Get all customizations from specific stereotype on element.
|
java.util.List<Class> |
getAllCustomizationsByTarget(java.lang.Object targetElement)
Get all customizations from specific target element of customization element.
|
java.util.List<FlowStep> |
getAlternativeFlows(UseCase useCase)
Find and return all alternative flows from given use case.
|
Stereotype |
getAppliedStereotypeByName(Element element,
java.lang.String stereotypeName)
Returns stereotype assigned to element.
|
Stereotype |
getAppliedStereotypeByString(Element element,
java.lang.String stereotype)
Deprecated.
|
java.io.File |
getAttachedFile(Element element)
Get file from attached file.
|
java.lang.Object |
getAttachedImage(Element element) |
java.lang.Object |
getAttachedImage(Element element,
java.lang.String cannotRenderImageMsg)
Get image from attached image.
|
java.util.Collection |
getBaseClassAssociations(Classifier classifier)
Gets the classifier associations.
|
java.util.List<Classifier> |
getBaseClassifiers(Classifier classifier)
Return classifier based elements.
|
java.util.Collection |
getBaseClassInheritableAttributes(Classifier classifier)
Gets the classifier inheritable attributes.
|
java.util.Collection |
getBaseClassInheritableOperations(Classifier classifier)
Gets the classifier inheritable operations.
|
java.util.Collection |
getBaseClassPorts(Classifier classifier)
Gets the classifier port.
|
java.util.Collection |
getBaseRealizedInterfaces(BehavioredClassifier behavioredClassifier)
Gets the behavior classifier realized interfaces.
|
java.util.Collection |
getBaseRelations(Classifier classifier)
Gets the classifier relations.
|
java.util.List<FlowStep> |
getBasicFlows(UseCase useCase)
Find and return a list of basic flows from given use case.
|
Element |
getClientElement(Element element)
Gets relationship client.
|
java.lang.String |
getComment(Element element)
Returns documentation of given element.
|
com.nomagic.magicreport.Image |
getCustomImage(Element element)
Return original image of Image property
|
com.nomagic.magicreport.Image |
getCustomImage(PresentationElement presentationElement)
Return original image of Image property from presentationElement
|
ElementImageHelper.ImageInformation |
getCustomImageInformation(Element element)
Return a CustomImageHolder information
|
java.lang.Object |
getCustomizationProperty(Element element,
java.lang.Object aStereotype,
java.lang.String propertyName)
Return property value from Customization element of the specified stereotype, on the element.
|
java.lang.String |
getCustomizationPropertyString(Element element,
java.lang.Object aStereotype,
java.lang.String propertyName)
Return property value as string from Customization element of the specified stereotype, on the element.
|
com.nomagic.magicdraw.ui.ElementFilter |
getDefaultElementFilter() |
java.util.Collection<Classifier> |
getDerivedClassifiers(Classifier parentClassifier)
Returns classifier derived elements.
|
java.util.Collection<Element> |
getDiagramElements(Diagram diagram)
Gets elements from this diagram.
|
java.util.Collection<Element> |
getDiagramElements(DiagramPresentationElement diagram)
Gets presentation elements from this diagram.
|
java.lang.String |
getDiagramType(Diagram diagram)
Gets diagram type.
|
java.lang.Object |
getDSLProperty(Element element,
java.lang.String propertyName)
Get DSL Property.
|
Comment |
getElementComment(Element element)
Returns comment annotated to this element.
|
java.lang.String |
getElementName(java.lang.Object element)
Gets name of the element.
|
java.util.List<Property> |
getElementProperties(Element element)
Get all properties from specific element.
|
java.util.List<Property> |
getElementProperties(Element element,
java.lang.String mode)
Collects properties that appears in element's specification dialog tree at specific view mode (Standard/Expert/All)
|
java.util.List<java.lang.String> |
getElementPropertiesName(Element element)
Get name of all properties from specific element.
|
java.util.List<java.lang.String> |
getElementPropertiesNameWithMode(Element element)
Get name of all properties from specific element and current mode.
|
java.util.List<java.lang.String> |
getElementPropertiesNameWithMode(Element element,
java.lang.String mode)
Get name of all properties from specific element and specific mode.
|
java.lang.String |
getElementURL(Element element)
Retrieve MagicDraw's element URL.
|
java.util.List<FlowStep> |
getExceptionalFlows(UseCase useCase)
Find and return a basic flow from given use case.
|
com.nomagic.magicdraw.ui.ElementFilter |
getExcludeAuxiliaryResourceFilter() |
com.nomagic.magicdraw.ui.ElementFilter |
getExcludeRelationshipElementFilter() |
com.nomagic.magicreport.Image |
getIconFor(BaseElement element)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
boolean allowDuplicate)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
boolean allowDuplicate,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode,
boolean allowDuplicate)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode,
boolean allowDuplicate,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(BaseElement element,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(java.lang.String type)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(java.lang.String type,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode)
Return image icon for element.
|
com.nomagic.magicreport.Image |
getIconFor(java.lang.String type,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
Return image icon for element.
|
java.lang.String |
getIconId(BaseElement element,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode,
boolean allowDuplicate,
ResizableIcon icon) |
java.lang.Object |
getImageFor(Element element)
Create image from element.
|
java.lang.Object |
getImageFor(java.lang.Object object,
boolean allowDuplicate)
Create image from object.
|
java.lang.Object |
getImageFor(java.lang.Object object,
boolean allowDuplicate,
java.lang.String cannotRenderImageMsg)
Create image from object.
|
java.util.Collection<Element> |
getIncludeUseCase(UseCase useCase)
Gets use case included element.
|
java.util.Collection<Element> |
getInnerElement(Element element)
Return a collection of inner element.
|
java.lang.String |
getInteractionMessageType(Message message)
Gets interaction message type.
|
java.lang.Object |
getMetaClass(Element element)
Get meta class of specific element
|
java.util.Collection<Class> |
getMetaClass(Stereotype stereotype)
Get stereotype meta class.
|
java.util.List<Element> |
getOwnedElementsIncludingAdditional(Element element,
boolean includePureOwned)
Return owned elements of the given Element including additional owned elements defined in DSL specification by additionalContentProperty.
|
java.util.List<Element> |
getOwnedElementsIncludingAdditional(Element element,
boolean includePureOwned,
boolean excludeRelationship)
Return owned elements of the given Element including additional owned elements defined in DSL specification by additionalContentProperty.
|
java.util.List<Element> |
getOwnedElementsIncludingAdditional(Element element,
boolean includePureOwned,
boolean excludeRelationship,
boolean excludeAuxiliaryResources)
Return owned elements of the given Element including additional owned elements defined in DSL specification by additionalContentProperty.
|
java.util.List<Element> |
getOwnedElementsIncludingAdditional(Element element,
boolean includePureOwned,
boolean excludeRelationship,
boolean excludeAuxiliaryResources,
boolean excludeInvisibleElement)
Return owned elements of the given Element including additional owned elements defined in DSL specification by additionalContentProperty.
|
static java.lang.String |
getPackageQualifiedName(NamedElement namedElement,
java.lang.String separator)
Get a qualified name by consider only Package and given element.
|
java.util.Collection<Element> |
getPackages(boolean includeSmartPacakge) |
java.util.Collection<PresentationElement> |
getPresentationDiagramElements(Diagram diagram)
Gets presentation element in the diagram.
|
java.util.Collection<PresentationElement> |
getPresentationDiagramElements(Diagram diagram,
boolean includeNonManipulator)
Gets presentation element in the diagram.
|
java.util.List<com.nomagic.magicdraw.magicreport.helper.Polygon> |
getPresentationElementBounds(Diagram diagram,
Element element)
Gets the bounds of this element in the form of a Polygon object.
|
com.nomagic.magicdraw.magicreport.helper.Polygon |
getPresentationElementBounds(PresentationElement element)
Gets the bounds of this element in the form of a Polygon object.
|
java.util.List<java.awt.Rectangle> |
getPresentationElementRectangle(Diagram diagram,
Element element)
Gets the bounds of this element in the form of a Rectangle object.
|
java.util.Collection<PresentationElement> |
getPresentationElements(Diagram diagram)
Deprecated.
|
java.lang.Object |
getProperty(Element element,
java.lang.String propertyName)
Get the element property value.
|
java.util.Set<com.nomagic.magicdraw.propertygroup.PropertyGroup> |
getPropertyGroupsByElement(Element element,
boolean addAlwaysVisible)
Get set of
PropertyGroup by specific element. |
java.util.Collection<com.nomagic.magicdraw.propertygroup.PropertyGroup> |
getPropertyGroupsByStereotype(Class stereotype)
Get collection of
PropertyGroup by specific stereotype. |
java.util.List<Property> |
getQProperties(Element element,
java.lang.String propertyName)
Get list of properties for element with DSL property groups, and each property group has its own property.
|
Property |
getQProperty(Element element,
java.lang.String propertyName)
Get a property for element with DSL property groups, and each property group has its own property.
|
static java.lang.String |
getQualifiedName(NamedElement namedElement,
java.lang.String separator)
Get a qualified name.
|
java.lang.String |
getQualifiedOwnerName(NamedElement obj)
Deprecated.
result from this method is incorrect. Use $element.owner.qualifiedName
|
Element |
getRecievingOperationalNode(Element element)
Get needline association ends.
|
java.util.Collection<Element> |
getRelationship(Element element)
Gets direct relationships of specified element.
|
java.util.Collection<Element> |
getRelationship(Element element,
boolean recursive)
Gets direct relationships of specified element.
|
java.util.Collection<Element> |
getRelationship(Element element,
boolean recursive,
boolean includeIndirect)
Gets relationships of specified element.
|
java.util.Collection<Actor> |
getRelativeActor(Element element)
Gets element relative actor.
|
java.lang.String |
getRepresentationText(BaseElement e) |
Node |
getRootNodeOfContainmentTree(boolean startWithPrimaryModel)
Get root node from containment tree.
|
Node |
getRootNodeOfDiagramTree()
Get root node from diagram tree.
|
Element |
getSendingOperationalNode(Element element)
Get needline association ends.
|
java.lang.Object |
getSlotProperty(Element element,
java.lang.String classifierName)
Get slot property by classifier name If there are more than one classifier matching with specified
parameters, return only the property of first matching classifier.
|
java.util.List<java.lang.Object> |
getSlotValue(Element element,
java.lang.String classifierName,
java.lang.String definingFeatureName)
Get slot value by classifier name and definingFeature name.
|
java.lang.Object |
getStereotypeProperty(Element element,
Stereotype stereotype,
java.lang.String propertyName)
Gets stereotype property.
|
java.lang.Object |
getStereotypeProperty(Element element,
Stereotype stereotype,
java.lang.String propertyName,
boolean checkMultiplicity)
Gets stereotype property.
|
java.lang.Object |
getStereotypeProperty(Element element,
java.lang.String stereotypeName,
java.lang.String propertyName)
Gets stereotype property.
|
java.lang.Object |
getStereotypeProperty(Element element,
java.lang.String stereotypeName,
java.lang.String propertyName,
boolean checkMultiplicity)
Gets stereotype property.
|
static java.lang.Object |
getStereotypeProperty(Element element,
java.lang.String profileName,
java.lang.String stereotypeName,
java.lang.String propertyName)
Get Stereotype Property.
|
java.util.List<java.lang.Object> |
getStereotypePropertyList(Element element,
java.lang.String stereotypeName,
java.lang.String propertyName)
Deprecated.
value return from this method is improperly converted.
|
java.lang.String |
getStereotypePropertyString(Element element,
Stereotype stereotype,
java.lang.String propertyName)
Gets stereotype property as String value.
|
java.lang.String |
getStereotypePropertyString(Element element,
java.lang.String stereotypeName,
java.lang.String propertyName)
Gets stereotype property as String value.
|
java.lang.String |
getStereotypePropertyString(Element element,
java.lang.String profileName,
java.lang.String stereotypeName,
java.lang.String propertyName)
Gets stereotype property as String value.
|
java.lang.String |
getStereotypePropertyStringValue(java.lang.Object o)
Deprecated.
value return from this method is improperly converted.
|
java.util.List<Stereotype> |
getStereotypes(Element element)
Gets all stereotypes applied to element.
|
Element |
getSupplierElement(Element element)
Gets relationship supplier.
|
java.io.File |
getTemplateFile(Element element)
Get template file from element.
|
java.io.File |
getTemplateFile(java.lang.String templateFileName,
java.lang.String templateLocation,
java.lang.String extension,
java.lang.Object marker)
Get Template file from template file name/path.
|
java.lang.String |
getUCOwnerNumber(Element element)
Return the use case number or use case ID of element.
|
java.util.Collection<BaseElement> |
getUsageElements(java.util.Map<BaseElement,java.util.List<com.nomagic.magicdraw.uml.DependencyType>> usagesMap,
Element element)
Gets the element usages from usage map.
|
java.lang.String |
getUsageRepresentationText(BaseElement be,
boolean addFullPath)
Formats the usage subject.
|
java.util.Map<BaseElement,java.util.List<com.nomagic.magicdraw.uml.DependencyType>> |
getUsages(java.lang.Object selectedObjects)
Returns Usage Map of MD and then use getUsageElements method for returning the usage of the specified
element.
|
java.util.Collection<Element> |
getUseCaseAssociatedElement(Element obj)
Deprecated.
|
java.lang.String |
getUseCaseNumber(Element element)
Return the use case number or use case ID of element.
|
java.util.Collection<BaseElement> |
getUsedBy(Element element)
Return a list of element used by this element (except diagram).
|
com.nomagic.magicdraw.ui.ElementFilter |
getVisibleElementFilter() |
boolean |
hasBaseClassifier(Classifier classifier,
java.lang.String baseClassifier)
Checks if element has base classifier with given name.
|
boolean |
hasProperty(Element element,
java.lang.String propertyName)
Returns true when a property with a given name is specified on this element, false otherwise.
|
boolean |
hasStereotype(Element element)
Checks if element has stereotypes.
|
boolean |
hasStereotype(Element element,
java.lang.String stereotype)
Deprecated.
|
boolean |
isAttachedFile(Element element)
Check if element is attached file.
|
boolean |
isAttachedImage(Element element)
Check if element is attached image.
|
boolean |
isDerivedClassifier(Classifier parent,
Classifier child)
Checks if child is derived from parent by generalization.
|
boolean |
isEmpty(java.lang.Object obj)
Test and return true if object is null, empty string or empty collection.
|
boolean |
isInvisibleElement(BaseElement element) |
boolean |
isInvisibleElement(BaseElement element,
boolean isTypeFilter) |
boolean |
isInvisibleElement(BaseElement element,
com.nomagic.magicdraw.ui.ElementFilter elementFilter) |
boolean |
isNamedElement(Element element)
Returns whether the element an
NamedElement. |
boolean |
isNull(java.lang.Object obj)
Test and return true if object is null.
|
boolean |
isRelationship(Element element)
Test and return true if element is relationship.
|
static java.lang.Object |
parseObjectForPrinting(java.lang.Object value)
Parses Strings and Collections of Strings
|
com.nomagic.magicdraw.magicreport.helper.Hyperlink |
serialize(Hyperlink hyperlink)
Convert
com.nomagic.magicdraw.hyperlinks.Hyperlink to Hyperlink. |
java.lang.String |
trimString(java.lang.String s)
Deprecated.
replaced with $s.trim()
|
clone, getContext, getProperties, getProperty, getProperty, notifyObservers, setContext, setPropertiespublic static final java.lang.String ICON_PROPERTY_RETINASCALING
public java.lang.Object getDSLProperty(Element element, java.lang.String propertyName)
element - the element.propertyName - the property name.public java.lang.Object getStereotypeProperty(Element element, java.lang.String stereotypeName, java.lang.String propertyName)
element - the element.stereotypeName - the stereotype name.propertyName - the property name.getStereotypeProperty(Element, Stereotype, String),
getStereotypeProperty(Element, String, String, String)public java.lang.Object getStereotypeProperty(Element element, java.lang.String stereotypeName, java.lang.String propertyName, boolean checkMultiplicity)
element - the element.stereotypeName - the stereotype name.propertyName - the property name.checkMultiplicity - check multiplicity before return valuegetStereotypeProperty(Element, Stereotype, String),
getStereotypeProperty(Element, String, String, String)public static java.lang.Object parseObjectForPrinting(java.lang.Object value)
public java.lang.Object getStereotypeProperty(Element element, Stereotype stereotype, java.lang.String propertyName)
element - the element.stereotype - the stereotype.propertyName - the property name.getStereotypeProperty(Element, String, String),
getStereotypeProperty(Element, String, String, String)public java.lang.Object getStereotypeProperty(Element element, Stereotype stereotype, java.lang.String propertyName, boolean checkMultiplicity)
element - the element.stereotype - the stereotype.propertyName - the property name.checkMultiplicity - check multiplicity before return valuegetStereotypeProperty(Element, String, String),
getStereotypeProperty(Element, String, String, String)public static java.lang.Object getStereotypeProperty(Element element, java.lang.String profileName, java.lang.String stereotypeName, java.lang.String propertyName)
element - the element.profileName - profile namestereotypeName - the stereotype name.propertyName - the property name.@Deprecated public java.util.List<java.lang.Object> getStereotypePropertyList(Element element, java.lang.String stereotypeName, java.lang.String propertyName)
element - element with assigned stereotypestereotypeName - stereotype namepropertyName - name of the propertypublic java.lang.String getStereotypePropertyString(Element element, java.lang.String stereotypeName, java.lang.String propertyName)
element - the element instancestereotypeName - the stereotype namepropertyName - the property namepublic java.lang.String getStereotypePropertyString(Element element, Stereotype stereotype, java.lang.String propertyName)
element - the element instancestereotype - the stereotype instancepropertyName - the property namepublic java.lang.String getStereotypePropertyString(Element element, java.lang.String profileName, java.lang.String stereotypeName, java.lang.String propertyName)
element - the element instanceprofileName - profile namestereotypeName - the stereotype namepropertyName - the property name@Deprecated public java.lang.String getStereotypePropertyStringValue(java.lang.Object o)
o - the propertypublic java.lang.String getRepresentationText(BaseElement e)
public boolean isNamedElement(Element element)
NamedElement.element - element to testNamedElement; otherwise false@CheckForNull @Deprecated public Stereotype getAppliedStereotypeByString(Element element, java.lang.String stereotype)
getAppliedStereotypeByName(Element, String)element - elementstereotype - name of stereotype@CheckForNull public Stereotype getAppliedStereotypeByName(Element element, java.lang.String stereotypeName)
element - elementstereotypeName - name of stereotype@Deprecated public boolean hasStereotype(Element element, java.lang.String stereotype)
containsStereotype(Element, String)element - element to checkstereotype - stereotype name to checkpublic boolean containsStereotype(Element element, java.lang.String stereotypeName)
element - element to teststereotypeName - stereotype name to be testedcontainsStereotype(Element, String, boolean)public boolean containsStereotype(Element element, java.lang.String stereotypeName, boolean includeDerived)
element - element to teststereotypeName - stereotype name to be testedincludeDerived - true if search target include all derived stereotypes; otherwise falsecontainsStereotype(Element, String)public boolean hasProperty(Element element, java.lang.String propertyName)
element - element to testpropertyName - property namepublic java.lang.Object getProperty(Element element, java.lang.String propertyName) throws com.nomagic.magicdraw.magicreport.helper.PropertyNotFoundException
element - the object that will be gotten that data.propertyName - the field of the element.PropertyNotFoundException - when a request property name is not found on target element.public java.util.List<Stereotype> getStereotypes(Element element) throws java.lang.IllegalArgumentException
element - the elementjava.lang.IllegalArgumentException - from StereotypesHelper.getStereotypespublic boolean hasStereotype(Element element) throws java.lang.IllegalArgumentException
element - element to checkjava.lang.IllegalArgumentException - if element is null@CheckForNull public Element findElementInCollection(java.util.Collection<? extends Element> col, java.lang.String elementName)
col - the collection of elementselementName - the name of elementpublic java.util.Collection<Element> findElementByName(java.util.Collection<Element> source, java.lang.String regex)
source - sourceregex - the regular expression to which name is to be matchedpublic java.util.Collection<Classifier> getDerivedClassifiers(Classifier parentClassifier)
parentClassifier - the parent classpublic boolean hasBaseClassifier(Classifier classifier, java.lang.String baseClassifier)
classifier - the classifierbaseClassifier - base classifier namepublic java.util.List<Classifier> getBaseClassifiers(Classifier classifier)
classifier - the classifierpublic java.lang.String getComment(Element element)
element - the element which will be gotten the name.@CheckForNull public Comment getElementComment(Element element)
element - the element which will be gotten the Comment.public java.util.Collection<Actor> getRelativeActor(Element element)
element - the element@Deprecated public java.util.Collection<Element> getUseCaseAssociatedElement(Element obj)
obj - the element that we would like to find the other partpublic java.util.Collection<Element> getIncludeUseCase(UseCase useCase)
useCase - the UseCase instance@Deprecated public java.lang.String trimString(java.lang.String s)
s - the Stringpublic java.lang.String createValueSpecificationText(ValueSpecification specification)
specification - The given ValueSpecification.@Deprecated public java.util.Collection<PresentationElement> getPresentationElements(Diagram diagram)
getPresentationDiagramElements(Diagram).diagram - the diagram instance.getPresentationDiagramElements(Diagram)public java.util.Collection<PresentationElement> getPresentationDiagramElements(Diagram diagram)
diagram - the diagram instance.getPresentationDiagramElements(Diagram, boolean)public java.util.Collection<PresentationElement> getPresentationDiagramElements(Diagram diagram, boolean includeNonManipulator)
diagram - the diagram instance.includeNonManipulator - true for include all non-manipulator element.getPresentationDiagramElements(Diagram)public com.nomagic.magicdraw.magicreport.helper.Polygon getPresentationElementBounds(PresentationElement element)
element - the presentation element on diagram.public java.util.List<java.awt.Rectangle> getPresentationElementRectangle(Diagram diagram, Element element)
diagram - the target diagram.element - the presentation element on given diagram.public java.util.List<com.nomagic.magicdraw.magicreport.helper.Polygon> getPresentationElementBounds(Diagram diagram, Element element)
diagram - the target diagram.element - the presentation element on given diagram.public java.lang.String getDiagramType(Diagram diagram)
diagram - the diagram instance.public java.util.Collection<Class> getMetaClass(Stereotype stereotype)
stereotype - the stereotypepublic java.lang.Object getMetaClass(Element element)
element - elementpublic java.util.Collection<Element> getDiagramElements(Diagram diagram)
diagram - the target diagram.public java.util.Collection<Element> getDiagramElements(DiagramPresentationElement diagram)
diagram - the target diagram.@Deprecated public java.lang.String getQualifiedOwnerName(NamedElement obj)
obj - the object instancepublic static java.lang.String getQualifiedName(NamedElement namedElement, java.lang.String separator)
namedElement - NamedElementseparator - separator symbol. If value is null or empty string, the '::' will be used.public static java.lang.String getPackageQualifiedName(NamedElement namedElement, java.lang.String separator)
For example: The element hierarchy is When template code is:
Design : Model -> com : Package -> nomagic : Package -> ui -> Package -> BaseDialog : Class
Where $class is "BaseDialog" element, the result from above code will be:
$report.getPackageQualifiedName($class, ".")
com.nomagic.ui.BaseDialog
namedElement - NamedElementseparator - separator symbol. If value is null or empty string, the '::' will be used.public com.nomagic.magicdraw.magicreport.helper.Hyperlink serialize(Hyperlink hyperlink)
com.nomagic.magicdraw.hyperlinks.Hyperlink to Hyperlink.hyperlink - the magicdraw hyperlinkpublic Element getSendingOperationalNode(Element element)
element - elementpublic Element getRecievingOperationalNode(Element element)
element - elementpublic java.util.Collection<Element> findRelationship(Package modelPackage)
modelPackage - package elementpublic java.util.Collection<Element> findRelationship(Package modelPackage, boolean recursive)
modelPackage - package elementrecursive - if true, perform recursivelypublic java.util.Collection<Element> getRelationship(Element element)
element - Element element to be collectpublic java.util.Collection<Element> getRelationship(Element element, boolean recursive)
element - Element element to be collectrecursive - if true, perform recursivelypublic java.util.Collection<Element> getRelationship(Element element, boolean recursive, boolean includeIndirect)
element - element to be collectrecursive - if true, perform recursivelyincludeIndirect - true to include indirect relationshipspublic java.util.Collection<Element> collectRelationships(Element element)
element - Element element to be collectpublic java.util.Collection<Element> collectRelationships(Element element, boolean includeIndirect)
element - element to be collectincludeIndirect - true to include indirect relationshipspublic java.util.Collection<Element> collectRelationships(Element element, boolean includeIndirect, boolean isRecursive)
element - element to be collectincludeIndirect - true to include indirect relationshipsisRecursive - if true, perform recursivelypublic Element getClientElement(Element element)
element - relationship model element.public Element getSupplierElement(Element element)
element - relationship model element.public java.util.Collection<Element> getInnerElement(Element element)
element - Element element to be collectpublic com.nomagic.magicreport.Image getIconFor(BaseElement element)
element - a Magic Draw elementpublic com.nomagic.magicreport.Image getIconFor(BaseElement element, java.util.Map<java.lang.String,java.lang.String> iconProperty)
element - a Magic Draw elementiconProperty - custom property to create iconpublic com.nomagic.magicreport.Image getIconFor(BaseElement element, boolean allowDuplicate)
element - a Magic Draw elementallowDuplicate - true to always create new icon and don't keep the icon in mappublic com.nomagic.magicreport.Image getIconFor(BaseElement element, boolean allowDuplicate, java.util.Map<java.lang.String,java.lang.String> iconProperty)
element - a Magic Draw elementallowDuplicate - true to always create new icon and don't keep the icon in mapiconProperty - custom property to create iconpublic com.nomagic.magicreport.Image getIconFor(BaseElement element, java.lang.String prefix, java.lang.String suffix, boolean hashCode)
hashCode equals true, icon's name format is set to
"icon_"+hash code and doesn't include prefix/suffix.element - a MagicDraw elementprefix - prefix for icon's namesuffix - suffix for icon's namehashCode - uses hash code in icon's namepublic com.nomagic.magicreport.Image getIconFor(BaseElement element, java.lang.String prefix, java.lang.String suffix, boolean hashCode, java.util.Map<java.lang.String,java.lang.String> iconProperty)
hashCode equals true, icon's name format is set to
"icon_"+hash code and doesn't include prefix/suffix.element - a MagicDraw elementprefix - prefix for icon's namesuffix - suffix for icon's namehashCode - uses hash code in icon's nameiconProperty - custom property to create iconpublic com.nomagic.magicreport.Image getIconFor(BaseElement element, java.lang.String prefix, java.lang.String suffix, boolean hashCode, boolean allowDuplicate)
hashCode equals true, icon's name format is set to
"icon_"+hash code and doesn't include prefix/suffix.element - a MagicDraw elementprefix - prefix for icon's namesuffix - suffix for icon's namehashCode - uses hash code in icon's nameallowDuplicate - true to always create new icon and don't keep the icon in mappublic java.lang.String getIconId(BaseElement element, java.lang.String prefix, java.lang.String suffix, boolean hashCode, boolean allowDuplicate, ResizableIcon icon)
@CheckForNull public com.nomagic.magicreport.Image getIconFor(BaseElement element, java.lang.String prefix, java.lang.String suffix, boolean hashCode, boolean allowDuplicate, @CheckForNull java.util.Map<java.lang.String,java.lang.String> iconProperty)
hashCode equals true, icon's name format is set to
"icon_"+hash code and doesn't include prefix/suffix.element - a MagicDraw elementprefix - prefix for icon's namesuffix - suffix for icon's namehashCode - uses hash code in icon's nameallowDuplicate - true to always create new icon and don't keep the icon in mapiconProperty - custom property to create iconpublic com.nomagic.magicreport.Image getIconFor(java.lang.String type)
type - element typepublic com.nomagic.magicreport.Image getIconFor(java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
type - element typepublic com.nomagic.magicreport.Image getIconFor(java.lang.String type,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode)
hashCode equals true, icon's name format is set to
"icon_"+hash code and doesn't include prefix/suffix.type - element typeprefix - prefix for icon's namesuffix - suffix for icon's namehashCode - uses hash code in icon's namepublic com.nomagic.magicreport.Image getIconFor(java.lang.String type,
java.lang.String prefix,
java.lang.String suffix,
boolean hashCode,
java.util.Map<java.lang.String,java.lang.String> iconProperty)
hashCode equals true, icon's name format is set to
"icon_"+hash code and doesn't include prefix/suffix.type - element typeprefix - prefix for icon's namesuffix - suffix for icon's namehashCode - uses hash code in icon's nameiconProperty - custom property to create iconpublic com.nomagic.magicreport.Image getCustomImage(PresentationElement presentationElement)
presentationElement - a presentationElementpublic com.nomagic.magicreport.Image getCustomImage(Element element)
element - an elementpublic ElementImageHelper.ImageInformation getCustomImageInformation(Element element)
element - elementpublic boolean isNull(java.lang.Object obj)
obj - object being tested.public boolean isEmpty(java.lang.Object obj)
obj - object being tested.public boolean isRelationship(Element element)
element - element being tested.public java.lang.String getInteractionMessageType(Message message)
message - Messagepublic java.lang.String getUsageRepresentationText(BaseElement be, boolean addFullPath)
be - ModelElement to format.addFullPath - use full path.public java.util.Collection<BaseElement> getUsedBy(Element element)
element - the the element which will be gotten the list of element name that uses the specified
element.public java.util.Map<BaseElement,java.util.List<com.nomagic.magicdraw.uml.DependencyType>> getUsages(java.lang.Object selectedObjects)
selectedObjects - the elements that this method will find the usage.public java.util.Collection<BaseElement> getUsageElements(java.util.Map<BaseElement,java.util.List<com.nomagic.magicdraw.uml.DependencyType>> usagesMap, Element element)
usagesMap - the Usages Map of MagicDraw.element - the element which will be gotten the list of element name that uses the specified element.public java.lang.String getElementName(java.lang.Object element)
element - the element.public java.util.Collection<Diagram> filterDiagram(java.util.Collection<Diagram> diagramList, java.util.Collection<java.lang.String> digramTypes)
Example:
#foreach ($d in $report.filterElement($Diagram, ['Use Case Diagram', 'Class Diagram'])
$d.name
#end
diagramList - the collection of diagrams.digramTypes - the collection of diagram types which is used to filter.public java.util.Collection<BaseElement> filterElement(java.util.Collection<BaseElement> elementList, java.util.Collection<java.lang.String> humanTypes)
Example:
#foreach ($e in $report.filterElement($elements, ['Class', 'Interface'])
$e.name $e.humanType
#end
elementList - the collection of element.humanTypes - the collection of human types which is used to filter.public java.util.Collection<BaseElement> filterElementByStereotypeName(java.util.Collection<BaseElement> elementList, java.util.Collection<java.lang.String> stereotypesNames)
elementList - the collection of element.stereotypesNames - the collection of stereotypes names which is used to filter.public java.util.Collection<BaseElement> filterElementType(java.util.Collection<BaseElement> elementList, java.util.Collection<java.lang.String> elementTypes)
Example:
#foreach ($e in $report.filterElementType($elements, ['class', 'interface'])
$e.name $e.elementType
#end
elementList - the collection of element.elementTypes - the collection of element types which is used to filter.public java.util.Collection<BaseElement> filterClassName(java.util.Collection<BaseElement> elementList, java.util.Collection<java.lang.String> shortNameForClassTypes)
Example:
#foreach ($e in $report.filterClassName($elements, ['Diagram', 'UseCase'])
$e.name $e.className
#end
elementList - the collection of element.shortNameForClassTypes - the collection of short name for class type which is used to filter.public java.util.Collection<Element> filter(java.util.Collection<Element> elementList, java.lang.String propertyName, java.util.Collection<?> propertyValue)
Example:
#foreach ($e in $report.filter($elements, 'name', ['foo', 'bar'])
$e.name
#end
elementList - the collection of element.propertyName - the property name which is used to filter.propertyValue - the collection of element property values which is used to filter.public java.util.Collection getBaseClassInheritableAttributes(Classifier classifier)
classifier - the Classifier.public java.util.Collection getBaseClassInheritableOperations(Classifier classifier)
classifier - the Classifier.public java.util.Collection getBaseClassAssociations(Classifier classifier)
classifier - the Classifier.public java.util.Collection getBaseRelations(Classifier classifier)
classifier - the Classifier.public java.util.Collection getBaseClassPorts(Classifier classifier)
classifier - the Classifier.public java.util.Collection getBaseRealizedInterfaces(BehavioredClassifier behavioredClassifier)
behavioredClassifier - the BehavioredClassifier.public boolean isDerivedClassifier(Classifier parent, Classifier child)
parent - parentchild - possible parentpublic java.lang.String getUseCaseNumber(Element element)
element - the elementpublic java.lang.String getActorNumber(Element element)
element - elementpublic java.lang.String getUCOwnerNumber(Element element)
element - the elementpublic java.lang.String getElementURL(Element element)
element - element objectpublic java.util.List<FlowStep> getBasicFlows(UseCase useCase)
useCase - a use case.FlowSteppublic java.util.List<FlowStep> getAlternativeFlows(UseCase useCase)
useCase - a use case.FlowSteppublic java.util.List<FlowStep> getExceptionalFlows(UseCase useCase)
useCase - a use case.FlowSteppublic java.util.List<java.lang.Object> getSlotValue(Element element, java.lang.String classifierName, java.lang.String definingFeatureName)
element - an element.classifierName - classifier name. [case-sensitive]definingFeatureName - defining feature name. [case-sensitive]@CheckForNull public java.lang.Object getSlotProperty(Element element, java.lang.String classifierName)
element - an element.classifierName - classifier name. [case-sensitive]public java.util.List<Element> getOwnedElementsIncludingAdditional(Element element, boolean includePureOwned)
element - an element to be found owned elementincludePureOwned - include element owned directly in ownedElement UML metapropertypublic java.util.List<Element> getOwnedElementsIncludingAdditional(Element element, boolean includePureOwned, boolean excludeRelationship)
element - an element to be found owned elementincludePureOwned - include element owned directly in ownedElement UML metapropertyexcludeRelationship - true to exclude relationshippublic java.util.List<Element> getOwnedElementsIncludingAdditional(Element element, boolean includePureOwned, boolean excludeRelationship, boolean excludeAuxiliaryResources)
element - an element to be found owned elementincludePureOwned - include element owned directly in ownedElement UML metapropertyexcludeRelationship - true to exclude relationship of given elementexcludeAuxiliaryResources - true to exclude auxiliary resourespublic java.util.List<Element> getOwnedElementsIncludingAdditional(Element element, boolean includePureOwned, boolean excludeRelationship, boolean excludeAuxiliaryResources, boolean excludeInvisibleElement)
element - an element to be found owned elementincludePureOwned - include element owned directly in ownedElement UML metapropertyexcludeRelationship - true to exclude relationship of given elementexcludeAuxiliaryResources - true to exclude auxiliary resourcesexcludeInvisibleElement - true to exclude invisible elementpublic java.util.List<Element> filterElementByElementFilters(java.util.List<Element> elements, java.util.List<com.nomagic.magicdraw.ui.ElementFilter> elementFilters)
public java.util.Collection<Element> getPackages(boolean includeSmartPacakge)
public boolean isAttachedFile(Element element)
element - specific elementpublic boolean isAttachedImage(Element element)
element - specific elementpublic java.lang.Object getAttachedImage(Element element) throws java.io.IOException
java.io.IOException@CheckForNull public java.lang.Object getAttachedImage(Element element, @CheckForNull java.lang.String cannotRenderImageMsg) throws java.io.IOException
element - specific elementcannotRenderImageMsg - in case the element is attached file but not image, return this msg instead.java.io.IOExceptionpublic java.io.File getAttachedFile(Element element) throws java.io.IOException
element - specific elementjava.io.IOException@CheckForNull
public java.io.File getTemplateFile(java.lang.String templateFileName,
java.lang.String templateLocation,
java.lang.String extension,
java.lang.Object marker)
templateFileName - template file name or pathtemplateLocation - template location/dirextension - extension for template file. in case it has no extensionmarker - The marker object used to track the file.public java.io.File getTemplateFile(Element element) throws java.io.IOException
element - attached filejava.io.IOExceptionpublic java.lang.Object getImageFor(Element element)
element - target elementpublic java.lang.Object getImageFor(java.lang.Object object,
boolean allowDuplicate)
object - object to be exported as imageallowDuplicate - allowDuplicated true to always create new image and don't keep the image in mappublic java.lang.Object getImageFor(java.lang.Object object,
boolean allowDuplicate,
@CheckForNull
java.lang.String cannotRenderImageMsg)
object - object to be exported as imageallowDuplicate - allowDuplicated true to always create new image and don't keep the image in mapcannotRenderImageMsg - in case the element is attached file but not image, return error message instead.public java.lang.String getCustomizationPropertyString(Element element, java.lang.Object aStereotype, java.lang.String propertyName)
element - an elementaStereotype - stereotype name or elementpropertyName - property namepublic java.lang.Object getCustomizationProperty(Element element, java.lang.Object aStereotype, java.lang.String propertyName)
element - an elementaStereotype - stereotype name or elementpropertyName - property namepublic java.util.List<Class> getAllCustomizationsByElement(Element element)
element - an elementpublic java.util.List<Class> getAllCustomizationsByElement(Element element, @CheckForNull java.lang.Object aStereotype)
element - an elementaStereotype - stereotype name or elementpublic java.util.List<Class> getAllCustomizationsByTarget(java.lang.Object targetElement)
targetElement - a target elementpublic java.util.List<java.lang.String> getElementPropertiesName(Element element)
element - elementpublic java.util.List<java.lang.String> getElementPropertiesNameWithMode(Element element)
element - elementpublic java.util.List<java.lang.String> getElementPropertiesNameWithMode(Element element, @CheckForNull java.lang.String mode)
element - elementmode - view mode from PropertiesModeHelper.MODESpublic java.util.List<Property> getElementProperties(Element element)
element - elementpublic java.util.List<Property> getElementProperties(Element element, @CheckForNull java.lang.String mode)
element - elementmode - view mode from PropertiesModeHelper.MODES -- STANDARD, EXPERT, ALLpublic com.nomagic.magicdraw.ui.ElementFilter getDefaultElementFilter()
public com.nomagic.magicdraw.ui.ElementFilter getExcludeAuxiliaryResourceFilter()
public com.nomagic.magicdraw.ui.ElementFilter getVisibleElementFilter()
public com.nomagic.magicdraw.ui.ElementFilter getExcludeRelationshipElementFilter()
public java.util.List<Element> filterVisibleElement(java.util.List<Element> elements)
public java.util.List<Element> filterVisibleElement(java.util.List<Element> elements, boolean includeAuxiliaryResources)
public boolean isInvisibleElement(BaseElement element)
public boolean isInvisibleElement(BaseElement element, boolean isTypeFilter)
public boolean isInvisibleElement(BaseElement element, com.nomagic.magicdraw.ui.ElementFilter elementFilter)
public Node getRootNodeOfContainmentTree(boolean startWithPrimaryModel)
startWithPrimaryModel - true to filter only primary model, public Node getRootNodeOfDiagramTree()
public java.util.Collection<com.nomagic.magicdraw.propertygroup.PropertyGroup> getPropertyGroupsByStereotype(Class stereotype)
PropertyGroup by specific stereotype.stereotype - a stereotypePropertyGrouppublic java.util.Set<com.nomagic.magicdraw.propertygroup.PropertyGroup> getPropertyGroupsByElement(Element element, boolean addAlwaysVisible)
PropertyGroup by specific element.element - an elementaddAlwaysVisible - true to use all set stereotypes + all settable showWhenNotApplied stereotypes, false to use only all set stereotypes.PropertyGrouppublic Property getQProperty(Element element, java.lang.String propertyName)
element - an element.propertyName - property namePropertypublic java.util.List<Property> getQProperties(Element element, java.lang.String propertyName)
element - an element.propertyName - property nameProperty