Class ModelElementTypeFinder
java.lang.Object
net.ssehub.easy.varModel.model.AbstractProjectVisitor
net.ssehub.easy.varModel.model.filter.ModelElementTypeFinder
- All Implemented Interfaces:
ICustomDatatypeVisitor,IModelVisitor
This class provides a visitor for providing a
ModelElementTypeFinder.ModelElementDescription of a model element
in a specific Project. The search for the desired model element only requires the name of
that element and the Project the element is located in.- Author:
- kroeher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType descriptions.classThis inner class is used as return type of the outerModelElementTypeFinderthat stores the relevant information (name, type, and class) of the model element found in aProject. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final StringConstant strings that are used to mapModelElementTypeFinder.ClassTypes to a textual representation.Stores the description of the the model element found in a givenProject.private static final Stringprivate static final Stringprivate StringStores the name of the model element for which theModelElementTypeFinder.ModelElementDescriptionshould be found.private ProjectStores theProjectin which the model element is located. -
Constructor Summary
ConstructorsConstructorDescriptionModelElementTypeFinder(Project originProject, FilterType filterType) Constructs a newModelElementTypeFinder. -
Method Summary
Modifier and TypeMethodDescriptionprivate ModelElementTypeFinder.ClassTypegetClassTypeFromFreezable(IFreezable freezable) Returns theModelElementTypeFinder.ClassTypethe givenIFreezableis an instance of.getDatatypeByElementName(String elementName) Returns aModelElementTypeFinder.ModelElementDescriptionof the model element specified by the given element name.static StringReturns the textual representation of aModelElementTypeFinder.ClassType.voidvisitAttribute(Attribute attribute) Method for visiting an attribute.voidvisitAttributeAssignment(AttributeAssignment assignment) Visits an attribute assignment.voidvisitComment(Comment comment) Method for visiting a comment.voidvisitCompound(Compound compound) Method for visiting a compound.voidVisits a compound access statement (may occur in freeze blocks.voidvisitConstraint(Constraint constraint) Method for visiting a constraint.voidThis method is used for visiting a decision variable declaration.voidvisitDerivedDatatype(DerivedDatatype datatype) Method for visiting a derived datatype.voidMethod for visiting an enum.voidvisitEnumLiteral(EnumLiteral literal) Method for visiting an enum literal.voidvisitFreezeBlock(FreezeBlock freeze) Method for visiting a freeze block.voidMethod for visiting an operation definition.voidvisitOrderedEnum(OrderedEnum eenum) Method for visiting an ordered enum.voidMethod for visiting a partial evaluation block.voidMethod for visiting a project interface.voidvisitReference(Reference reference) Method for visiting a reference.voidvisitSequence(Sequence sequence) Method for visiting a sequence.voidMethod for visiting a set.Methods inherited from class net.ssehub.easy.varModel.model.AbstractProjectVisitor
clear, getFilterType, getStartingProject, visitProject, visitProjectImport
-
Field Details
-
DECISION_VARIABLE_TYPE
Constant strings that are used to mapModelElementTypeFinder.ClassTypes to a textual representation.- See Also:
-
ENUM_TYPE
- See Also:
-
COMPOUND_TYPE
- See Also:
-
MAPPING_TYPE
- See Also:
-
elementTypeDescription
Stores the description of the the model element found in a givenProject. -
targetProject
Stores theProjectin which the model element is located. -
searchElementName
Stores the name of the model element for which theModelElementTypeFinder.ModelElementDescriptionshould be found.
-
-
Constructor Details
-
ModelElementTypeFinder
Constructs a newModelElementTypeFinder.- Parameters:
originProject- theProjectin which the model element is locatedfilterType- specifies whether project imports shall be considered or not using aFilterType
-
-
Method Details
-
getDatatypeByElementName
Returns aModelElementTypeFinder.ModelElementDescriptionof the model element specified by the given element name.- Parameters:
elementName- the name of the model element as aStringfor which the description should be created- Returns:
- the
ModelElementTypeFinder.ModelElementDescription. May returnnullif the given model element name is empty, theProjectdoes not exist, or the element could not be found.
-
visitDecisionVariableDeclaration
Description copied from interface:IModelVisitorThis method is used for visiting a decision variable declaration.- Parameters:
decl- One declaration which should be visited.
-
visitAttribute
Description copied from interface:IModelVisitorMethod for visiting an attribute.- Parameters:
attribute- The attribute which should be visited.
-
visitConstraint
Description copied from interface:IModelVisitorMethod for visiting a constraint.- Parameters:
constraint- The constraint which should be visited.
-
visitFreezeBlock
Description copied from interface:IModelVisitorMethod for visiting a freeze block.- Parameters:
freeze- The freeze block which should be visited.
-
getClassTypeFromFreezable
Returns theModelElementTypeFinder.ClassTypethe givenIFreezableis an instance of.- Parameters:
freezable- theIFreezablefor which the actualModelElementTypeFinder.ClassTypeshould be determined- Returns:
- the
ModelElementTypeFinder.ClassTypethe givenIFreezableis an instance of ornullif there is noModelElementTypeFinder.ClassTypefor the actual type of theIFreezabledefined.
-
visitOperationDefinition
Description copied from interface:IModelVisitorMethod for visiting an operation definition.- Parameters:
opdef- The operation definition which should be visited.
-
visitPartialEvaluationBlock
Description copied from interface:IModelVisitorMethod for visiting a partial evaluation block.- Parameters:
block- The partial evaluation block which should be visited.
-
visitProjectInterface
Description copied from interface:IModelVisitorMethod for visiting a project interface.- Parameters:
iface- The interface which should be visited.
-
visitComment
Description copied from interface:IModelVisitorMethod for visiting a comment.- Parameters:
comment- the comment to visit
-
visitAttributeAssignment
Description copied from interface:IModelVisitorVisits an attribute assignment.- Parameters:
assignment- the assignment to visit
-
visitCompoundAccessStatement
Description copied from interface:IModelVisitorVisits a compound access statement (may occur in freeze blocks.- Parameters:
access- the access statement
-
visitEnum
Description copied from interface:ICustomDatatypeVisitorMethod for visiting an enum.- Parameters:
eenum- The enum which should be visited.
-
visitOrderedEnum
Description copied from interface:ICustomDatatypeVisitorMethod for visiting an ordered enum.- Parameters:
eenum- The enum which should be visited.
-
visitCompound
Description copied from interface:ICustomDatatypeVisitorMethod for visiting a compound.- Parameters:
compound- The compound which should be visited.
-
visitDerivedDatatype
Description copied from interface:ICustomDatatypeVisitorMethod for visiting a derived datatype.- Parameters:
datatype- The datatype which should be visited.
-
visitEnumLiteral
Description copied from interface:ICustomDatatypeVisitorMethod for visiting an enum literal.- Parameters:
literal- The literal which should be visited.
-
visitReference
Description copied from interface:ICustomDatatypeVisitorMethod for visiting a reference.- Parameters:
reference- The reference which should be visited.
-
visitSequence
Description copied from interface:ICustomDatatypeVisitorMethod for visiting a sequence.- Parameters:
sequence- The sequence which should be visited.
-
visitSet
Description copied from interface:ICustomDatatypeVisitorMethod for visiting a set.- Parameters:
set- The set which should be visited.
-
toString
Returns the textual representation of aModelElementTypeFinder.ClassType.- Parameters:
type- theModelElementTypeFinder.ClassTypeto be turned into aString- Returns:
- the textual representation of the given
ModelElementTypeFinder.ClassType. May return an emptyStringif the givenModelElementTypeFinder.ClassTypecannot be resolved.
-