this class realizes some methods for operations which are performed on an axlang element. More...
Public Member Functions | |
boolean | containsApplicationModel (File file) |
looks inside the content to find out if the file contains a feature model. | |
boolean | containsFeatureModel (File file) |
looks inside the content to find out if the file contains a feature model. | |
boolean | containsIncludedFiles (File file) |
looks inside the content to find out if the file contains a model. | |
boolean | containsModel (File file) |
looks inside the content to find out if the file contains a model. | |
boolean | containsResourceModel (File file) |
looks inside the content to find out if the file contains a feature model. | |
ArrayList< String > | findIncludedTags (File axbenchfile) |
this method realizes the search for the included tags. | |
IAXLangElement | findTheRightStartPoint (IAXLangElement possiblestart, Role myRole) |
searches for the right start point. can be used to have the correct start point for the handleComponentTypeReferenceConstraints method in this class. | |
ArrayList< IAXLangElement > | handleComponentTypeReferenceConstraints (Role[] childroletosearch, IAXLangElement parentelement, Role mainrole, Role secondrole, IAXLangElement startpoint) |
this method searches for the forbidden component type references for a subcomponent. | |
void | reloadOldDependedElementStates (IAXLangElement actualModel, IAXLangElement actualParent, ArrayList< IAXLangElement > oldDependedElements, IAXLangElement clonedModel) |
reloadOldDependedElementStates/// | |
IAXLangElement | searchForComponentOrXORSubComponent (IAXLangElement subcomponent, Class<?> modelclasstosearch, Class<?> elementclasstosearch, Role mainrole, Role subrole, Role referencerole) |
searches for a component or hw component. start point is a subcomponent inside a xor component. aim is to find the subcomponent which have the reference to the current xor component (which is has the ComponentType role). 1.find all components , which are not a xor component 2.check the component, if they have xor subcomponents. 3.check the subcomponents, if they have a reference to the currentxorcomponent. | |
IAXLangElement | searchForElementClass (IAXLangElement element, Class<?> classtosearch, IAXLangElement alternative) |
searches for the defined class via the parent relation- start point is the given element. | |
Static Public Member Functions | |
static AXLangElementUtilities | getInstance () |
Private Member Functions | |
AXLangElementUtilities () | |
boolean | checkForElementError (IAXLangElement element) |
checks if the element has all valid reference, if not the element has or could have an error. e.g. f2p link, and the feature reference couldn't be found. PATH TOO | |
Collection< IAXLangElement > | findAllValidElements (Class<?> theClass, IAXLangElement mainParent) |
finds all valid elements according the given class. | |
boolean | handleSpecialSubComponentConstrain (IAXLangElement componenttypereference, IAXLangElement actualcomponent, Role mainrole, Role secondrole) |
entry point method for the recursive search. | |
void | handleValidElementTypes1 (IAXLangElement theNewElementToCreate, IAXLangElement actualParent, IAXLangElement theActualElementForSearch, IAXLangElement theStartElement, IAXLangElement clonedModel) |
handles the valid element types. Recursive if its a ReferenceKind.CHILD. That means that e.g. a f2amapping will be created with all child mappings (f2p link...) recursively. | |
IAXLangElement | searchForElementInsideModelViaUID (IAXLangElement model, String uid) |
searches for an axbench element inside a model via the uid. | |
IAXLangElement | searchForElementViaUID (ArrayList< IAXLangElement > list, IAXLangElement element) |
searhces for an axbench element inside an arraylist of axbench elements via the uid or if its an instance path via the equal method. | |
boolean | searchForTheComponenttypeReference (IAXLangElement componenttypereference, IAXLangElement actualcomponent, Role mainrole, Role secondrole) |
search for an also existing component type reference. | |
Private Attributes | |
ArrayList< IAXLangElement > | forbiddencomponentypereferences = null |
needed to investigate all forbidden reference for a subcomponent | |
Static Private Attributes | |
static AXLangElementUtilities | axLangElementUtilities = null |
static boolean | debug = false |
to debug possible errors |
this class realizes some methods for operations which are performed on an axlang element.
de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.AXLangElementUtilities | ( | ) | [private] |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.checkForElementError | ( | IAXLangElement | element | ) | [private] |
checks if the element has all valid reference, if not the element has or could have an error. e.g. f2p link, and the feature reference couldn't be found. PATH TOO
element |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.containsApplicationModel | ( | File | file | ) |
looks inside the content to find out if the file contains a feature model.
file |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.containsFeatureModel | ( | File | file | ) |
looks inside the content to find out if the file contains a feature model.
file |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.containsIncludedFiles | ( | File | file | ) |
looks inside the content to find out if the file contains a model.
file |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.containsModel | ( | File | file | ) |
looks inside the content to find out if the file contains a model.
file |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.containsResourceModel | ( | File | file | ) |
looks inside the content to find out if the file contains a feature model.
file |
Collection<IAXLangElement> de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.findAllValidElements | ( | Class<?> | theClass, | |
IAXLangElement | mainParent | |||
) | [private] |
finds all valid elements according the given class.
theClass | ||
mainParent |
ArrayList<String> de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.findIncludedTags | ( | File | axbenchfile | ) |
this method realizes the search for the included tags.
axbenchfile |
IAXLangElement de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.findTheRightStartPoint | ( | IAXLangElement | possiblestart, | |
Role | myRole | |||
) |
searches for the right start point. can be used to have the correct start point for the handleComponentTypeReferenceConstraints method in this class.
possiblestart | ||
the | role to search - it's only for a COMPONENTTYPE or HWCOMPONENTTYPE reference useful. |
static AXLangElementUtilities de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.getInstance | ( | ) | [static] |
ArrayList<IAXLangElement> de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.handleComponentTypeReferenceConstraints | ( | Role[] | childroletosearch, | |
IAXLangElement | parentelement, | |||
Role | mainrole, | |||
Role | secondrole, | |||
IAXLangElement | startpoint | |||
) |
this method searches for the forbidden component type references for a subcomponent.
childroletosearch | - e.g. COMPONENT or HWCOMPONENT | |
parentelement | - e.g. the application model or the resource model | |
mainrole | - e.g. SUBCOMPONENT or HWSUBCOMPONENT | |
secondrole | - e.g. COMPONENTTYPE or HWCOMPONENTTYPE | |
startpoint | - the start point has to be the COMPONENTTYPE of the subcomponent (the method findTheRightStartPoint in this class is useful) |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.handleSpecialSubComponentConstrain | ( | IAXLangElement | componenttypereference, | |
IAXLangElement | actualcomponent, | |||
Role | mainrole, | |||
Role | secondrole | |||
) | [private] |
entry point method for the recursive search.
componenttypereference | ||
actualcomponent | ||
mainrole | - e.g COMPONENT, or HWCOMPONENT | |
secondrole | - e.g. COMPONENTTYPE or HWCOMPONENTTYPE |
void de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.handleValidElementTypes1 | ( | IAXLangElement | theNewElementToCreate, | |
IAXLangElement | actualParent, | |||
IAXLangElement | theActualElementForSearch, | |||
IAXLangElement | theStartElement, | |||
IAXLangElement | clonedModel | |||
) | [private] |
handles the valid element types. Recursive if its a ReferenceKind.CHILD. That means that e.g. a f2amapping will be created with all child mappings (f2p link...) recursively.
theNewElementToCreate | - the new element that has to be created. (e.g. a configuration, a mapping, or a f2p link) | |
actualParent | - the actual parent where the new element will be added | |
theActualElementForSearch | - the actual element where the comparison is handled (always the actual model currently) | |
theStartElement | - the start element which is the "same" element from the old model like the new one which will be created | |
clonedModel | - the clonedModel where the start element comes from |
void de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.reloadOldDependedElementStates | ( | IAXLangElement | actualModel, | |
IAXLangElement | actualParent, | |||
ArrayList< IAXLangElement > | oldDependedElements, | |||
IAXLangElement | clonedModel | |||
) |
reloadOldDependedElementStates///
reloads all elements and their references. e.g. all mapping, and configurations, if the feature model was removed and new added. (needed for pv synchronization)
actualModel | - should be always the actualModel ( the actual element for search) | |
actualParent | - the actual parent, where the new element will be added | |
oldDependedElements | - all elements from the old model which have to be rebuild | |
clonedModel | - the cloned Model from the old model, before changes appears on the old model |
IAXLangElement de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.searchForComponentOrXORSubComponent | ( | IAXLangElement | subcomponent, | |
Class<?> | modelclasstosearch, | |||
Class<?> | elementclasstosearch, | |||
Role | mainrole, | |||
Role | subrole, | |||
Role | referencerole | |||
) |
searches for a component or hw component. start point is a subcomponent inside a xor component. aim is to find the subcomponent which have the reference to the current xor component (which is has the ComponentType role). 1.find all components , which are not a xor component 2.check the component, if they have xor subcomponents. 3.check the subcomponents, if they have a reference to the currentxorcomponent.
subcomponent | - the start point | |
modelclasstosearch | - ApplicationModel.class or ResourceModel.class | |
elementclasstosearch | - XORComponent.class or HWXORComponent.class | |
mainrole | - COMPONENT or HWCOMPONENT | |
subrole | - SUBCOMPONENT or HWSUBCOMPONENT | |
referencerole | - COMPONENTTYPE or HWCOMPONENTTYPE |
IAXLangElement de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.searchForElementClass | ( | IAXLangElement | element, | |
Class<?> | classtosearch, | |||
IAXLangElement | alternative | |||
) |
searches for the defined class via the parent relation- start point is the given element.
element | - the start point | |
classtosearch | - via parent relationship | |
alternative | - if no parent was founded |
IAXLangElement de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.searchForElementInsideModelViaUID | ( | IAXLangElement | model, | |
String | uid | |||
) | [private] |
searches for an axbench element inside a model via the uid.
model | ||
uid |
IAXLangElement de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.searchForElementViaUID | ( | ArrayList< IAXLangElement > | list, | |
IAXLangElement | element | |||
) | [private] |
searhces for an axbench element inside an arraylist of axbench elements via the uid or if its an instance path via the equal method.
list | ||
element |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.searchForTheComponenttypeReference | ( | IAXLangElement | componenttypereference, | |
IAXLangElement | actualcomponent, | |||
Role | mainrole, | |||
Role | secondrole | |||
) | [private] |
search for an also existing component type reference.
componenttypereference | ||
actualcomponent |
true | - if the COMPONENTTYPE is forbidden | |
false | - "" if not |
AXLangElementUtilities de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.axLangElementUtilities = null [static, private] |
boolean de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.debug = false [static, private] |
to debug possible errors
ArrayList<IAXLangElement> de.fraunhofer.isst.axbench.axlang.utilities.AXLangElementUtilities.forbiddencomponentypereferences = null [private] |
needed to investigate all forbidden reference for a subcomponent