Class StereotypeApplicationListener
- java.lang.Object
-
- org.palladiosimulator.simulizar.measuringpoint.create.StereotypeApplicationListener
-
- All Implemented Interfaces:
EventListener
,IResourceChangeListener
public class StereotypeApplicationListener extends Object implements IResourceChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLIED_TO_ELEMENT_TAG_NAME
static String
HREF_ATTRIBUTE_NAME
static String
MEASURING_POINT_FILE_EXTENSION
static String
MEASURING_POINT_STEREOTYPE_APPLICATION_FILE_EXTENSION
static String
RESOURCE_URI_ATTRIBUTE_NAME
-
Constructor Summary
Constructors Constructor Description StereotypeApplicationListener(Set<String> currentIds)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createMeasuringPoint(String resourceURI)
Creating a ResourceURIMeasuringPoint file with the specified file name and the resourceURI of the element for which we want to create a measuring point.static Document
getParsedDocument(IResource r)
Parses the document represented by the resource.void
resourceChanged(IResourceChangeEvent event)
Responding to the change of a resource.
-
-
-
Field Detail
-
RESOURCE_URI_ATTRIBUTE_NAME
public static final String RESOURCE_URI_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
APPLIED_TO_ELEMENT_TAG_NAME
public static final String APPLIED_TO_ELEMENT_TAG_NAME
- See Also:
- Constant Field Values
-
HREF_ATTRIBUTE_NAME
public static final String HREF_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
MEASURING_POINT_FILE_EXTENSION
public static final String MEASURING_POINT_FILE_EXTENSION
- See Also:
- Constant Field Values
-
MEASURING_POINT_STEREOTYPE_APPLICATION_FILE_EXTENSION
public static final String MEASURING_POINT_STEREOTYPE_APPLICATION_FILE_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
resourceChanged
public void resourceChanged(IResourceChangeEvent event)
Responding to the change of a resource. In this case we find all the profile application files concerning measuring point stereotypes. We create a measuring point per measuring point stereotype application.- Specified by:
resourceChanged
in interfaceIResourceChangeListener
-
getParsedDocument
public static Document getParsedDocument(IResource r) throws ParserConfigurationException, SAXException, IOException
Parses the document represented by the resource.- Parameters:
r
- the resource that represents the document which should be parsed.- Returns:
- parsed document.
- Throws:
ParserConfigurationException
- exception thrown if the document could not be parsed.SAXException
- an exception thrown by the SAX.IOException
- an exception indicating some IO operation on the resource could not be performed correctly.
-
createMeasuringPoint
public void createMeasuringPoint(String resourceURI) throws IOException
Creating a ResourceURIMeasuringPoint file with the specified file name and the resourceURI of the element for which we want to create a measuring point.- Parameters:
fileName
- name of the file to created that represents the measuring point.resourceURI
- resourceURI of the element for which we create a measuring point.- Throws:
IOException
- indicates that there was a problem with saving the resource.
-
-