Package de.monticore.tf.odrules
Class HierarchyHelper
java.lang.Object
de.monticore.tf.odrules.HierarchyHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomImports(String customImport) Add custom import for code generationgetChangeObjectsWhithoutCreate(ASTReplacement replacements) Get all custom imports for code generationgetInnerLinkObjectsLHS(List<ASTMatchingObject> allMatches, ASTMatchingObject obj) Calculates all inner objects of a given objectgetListChilds(List<ASTMatchingObject> allobjects) Gives all objects in a List in the given list of objects, besides optionalsgetListChilds(List<ASTMatchingObject> allObjects, ASTMatchingObject list) Removes every optional and listChild match-object.getListChildsWithOptionals(List<ASTMatchingObject> allobjects) Gives all objects in a List in the given list of objectsgetListChildsWithOptionals(List<ASTMatchingObject> allobjects, ASTMatchingObject list) Gives all child objects from a given list of objects, including optionalsgetListObjects(List<ASTMatchingObject> allObjects) Removes every mandatory object.getListParent(String object) Gives the ListStructure Name the given objectName lies ingetListTree(String object) Method to get the Treepath the object lies in.getMandatoryChangeObjects(List<ASTChange> allChanges) Removes every Change object with the Optional type.getMandatoryChangeObjectsNoList(List<ASTChange> allChanges) Removes every Change object with the Optional type and the list type.getMandatoryChangeObjectsOnlyList(List<ASTChange> allChanges) Only change objects with the list type.getMandatoryDeleteObjects(List<ASTDeleteOperation> allDeletes) Removes every Delete object with the Optional type.getMandatoryMatchObjects(List<ASTMatchingObject> allMatches) Removes every optional Match object.getMandatoryObjectsWithoutListChilds(List<ASTMatchingObject> allMatches) Removes every listChild match-object.Removes every optional and listChild match-object.getMandatoryObjectsWithoutOptList(List<ASTMatchingObject> allMatches) Removes every optional and list match object.static ASTMatchingObjectgetMatchingObject(List<ASTMatchingObject> allObjects, String name) getObjectByName(List<ASTMatchingObject> allObjects, String name) Gives the Object to a Name in a given List of ObjectsgetOptionalMatchObjects(List<ASTMatchingObject> allMatches) Removes every mandatory Match object.getOptListObjects(List<ASTMatchingObject> allObjects) Removes every normal object.Get package name for code generationbooleanisLhsListChild(ASTMatchingObject object) booleanisLhsListChild(String objectname) booleanisListChild(ASTMatchingObject object) Checks if the given object is in a list.booleanisListChild(String objectname) booleanisListObject(String objectName) Checks whether the object with the given name is a list object.booleanisNoOptionalName(List<ASTMatchingObject> matches, String linkName) Checks if one of the InnerLinkObjects is an Optional objectbooleanisRhsListChild(ASTMatchingObject object) booleanisRhsListChild(String objectname) booleanisWithinListStructure(String objectName) booleanisWithinNegativeStructure(String objectName) Checks if the object with the given name is within an negative structure (not[[..]]-element).booleanisWithinOptionalStructure(String objectName) Checks if the object with the given name is within an optional structure.booleanCheck if package name for code generation is setvoidsetPackageName(String packageName) Set package name for code generation
-
Constructor Details
-
HierarchyHelper
public HierarchyHelper() -
HierarchyHelper
-
-
Method Details
-
isListObject
Checks whether the object with the given name is a list object.- Parameters:
objectName- the name of the object- Returns:
- whether it is a list
-
getPackageName
Get package name for code generation- Returns:
-
setPackageName
Set package name for code generation- Parameters:
packageName-
-
packageisPresentName
public boolean packageisPresentName()Check if package name for code generation is set- Returns:
-
getCustomImports
Get all custom imports for code generation- Returns:
-
addCustomImports
Add custom import for code generation- Parameters:
customImport-
-
getInnerLinkObjectsLHS
public List<ASTMatchingObject> getInnerLinkObjectsLHS(List<ASTMatchingObject> allMatches, ASTMatchingObject obj) Calculates all inner objects of a given object- Parameters:
allMatches- The list of all LHS match elements.obj- The list from which we want the childs.- Returns:
- a List of the names of all (direct) childs from the list.
-
getListObjects
Removes every mandatory object.- Parameters:
allObjects- list of all objects- Returns:
- a list of all found list objects
-
isListChild
Checks if the given object is in a list.- Parameters:
object- The object to be checked- Returns:
- If the object is in a list
-
isListChild
-
isLhsListChild
-
isLhsListChild
-
isRhsListChild
-
isRhsListChild
-
getMandatoryObjectsWithoutOptAndListChilds
public List<ASTMatchingObject> getMandatoryObjectsWithoutOptAndListChilds(List<ASTMatchingObject> allMatches) Removes every optional and listChild match-object.- Parameters:
allMatches- list of all match-objects- Returns:
- a list of match-objects without optional and listChild objects
-
getMandatoryObjectsWithoutListChilds
public List<ASTMatchingObject> getMandatoryObjectsWithoutListChilds(List<ASTMatchingObject> allMatches) Removes every listChild match-object.- Parameters:
allMatches- list of all match-objects- Returns:
- a list of match-objects without listChild objects
-
getListChilds
public List<ASTMatchingObject> getListChilds(List<ASTMatchingObject> allObjects, ASTMatchingObject list) Removes every optional and listChild match-object.- Parameters:
allObjects- list of all match-objects- Returns:
- a list of match-objects without optional and listChild objects
-
getListChildsWithOptionals
public List<ASTMatchingObject> getListChildsWithOptionals(List<ASTMatchingObject> allobjects, ASTMatchingObject list) Gives all child objects from a given list of objects, including optionals- Parameters:
allobjects- the objects to search in- Returns:
- all objects in lists in the given objects
-
getListChilds
Gives all objects in a List in the given list of objects, besides optionals- Parameters:
allobjects- the objects to search in- Returns:
- all objects in lists in the given objects
-
getListChildsWithOptionals
Gives all objects in a List in the given list of objects- Parameters:
allobjects- the objects to search in- Returns:
- all objects in lists in the given objects
-
getListParent
Gives the ListStructure Name the given objectName lies in- Parameters:
object- The name of the object- Returns:
- The name of the list Structure which contains the object
-
getListTree
Method to get the Treepath the object lies in.- Parameters:
object- The Object for which we want to find a path in the List-Structure Tree- Returns:
- A List starting with the root-list and ending with the list containing the given Object.
-
getObjectByName
Gives the Object to a Name in a given List of Objects- Parameters:
allObjects- The List of objects where the object should be found in.name- The given objectname- Returns:
- The object which has the given name, null if no object was found
-
getMandatoryChangeObjects
Removes every Change object with the Optional type.- Parameters:
allChanges- list of all Change objects- Returns:
- a list of Changes without optional objects
-
getMandatoryChangeObjectsNoList
Removes every Change object with the Optional type and the list type.- Parameters:
allChanges- list of all Change objects- Returns:
- a list of Changes without optional objects and list objects
-
getChangeObjectsWhithoutCreate
-
getMandatoryChangeObjectsOnlyList
Only change objects with the list type.- Parameters:
allChanges- list of all Change objects- Returns:
- a list of Changes, which are list objects
-
getMandatoryDeleteObjects
Removes every Delete object with the Optional type.- Parameters:
allDeletes- list of all Delete objects- Returns:
- a list of Deletes without optional objects
-
getMandatoryMatchObjects
Removes every optional Match object.- Parameters:
allMatches- list of all Match objects- Returns:
- a list of Matches without optional objects
-
getMandatoryObjectsWithoutOptList
public List<ASTMatchingObject> getMandatoryObjectsWithoutOptList(List<ASTMatchingObject> allMatches) Removes every optional and list match object.- Parameters:
allMatches- list of all Match objects- Returns:
- a list of Matches without optional and list objects
-
getOptionalMatchObjects
Removes every mandatory Match object.- Parameters:
allMatches- list of all Match objects- Returns:
- a list of optional Match objects
-
isNoOptionalName
Checks if one of the InnerLinkObjects is an Optional object- Parameters:
matches- list of matches to checklinkName- the name of the object to look for- Returns:
true, if the object with the given name is no optional
-
getOptListObjects
Removes every normal object.- Parameters:
allObjects- list of all Match-objects- Returns:
- a list of optional Match objects
-
isWithinOptionalStructure
Checks if the object with the given name is within an optional structure.- Parameters:
objectName- the object name- Returns:
- whether the object is within an optional structure
-
isWithinNegativeStructure
Checks if the object with the given name is within an negative structure (not[[..]]-element).- Parameters:
objectName- the object name- Returns:
- whether the object is within a negative structure
-
isWithinListStructure
-
getMatchingObject
-