java.lang.Objectucot.ModuleProperties
ucot.input.ProcessMLInputAdapter
public class ProcessMLInputAdapter
This InputInterface reads ProcessMl-files and parses usecases from them. References to sub-usecase is stored to usecase's steps. If sub-usecase has no references to it, it is currently discarded.
Field Summary | |
---|---|
private java.util.logging.Logger |
logger
|
Fields inherited from class ucot.ModuleProperties |
---|
properties, propertiesURL |
Constructor Summary | |
---|---|
ProcessMLInputAdapter()
|
Method Summary | |
---|---|
void |
applyProperties()
Applies current properties for the module. |
boolean |
canRead(java.net.URL url)
Tests if this adapter can read the file. |
private org.w3c.dom.Element |
getCorrectAbstraction(org.w3c.dom.NodeList abstractions)
Goes throguh a nodelist containing "abstraction"-named elements and returns the one which has level 0 |
java.util.Properties |
loadDefaultProperties()
Method which returns the factory default properties for the module. |
private void |
ParseInstanceDetails(org.w3c.dom.Element processInstance,
UseCase usecase)
Parses processInstance's id and adds it to usecase, also checks if this usecase is a subusecase |
private UseCaseStep |
ParseStep(org.w3c.dom.Node node)
Parses usecase step from given node and returns it, or null if acceptable one wasn't found |
private boolean |
ParseSteps(UseCase usecase,
org.w3c.dom.NodeList steps)
Parses steps from given nodelist, stores them to given usecase |
UseCaseCollection |
read(java.net.URL url)
Reads usecase collection from URL. |
java.lang.String |
toString()
Returns inputs name as a String |
Methods inherited from class ucot.ModuleProperties |
---|
getProperties, loadProperties, saveProperties, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ucot.ModulePropertyInterface |
---|
getProperties, loadProperties, saveProperties, setProperties |
Field Detail |
---|
private java.util.logging.Logger logger
Constructor Detail |
---|
public ProcessMLInputAdapter()
Method Detail |
---|
public UseCaseCollection read(java.net.URL url) throws java.io.IOException
InputInterface
Reads usecase collection from URL.
read
in interface InputInterface
url
- URL where input is loaded from
java.io.IOException
private org.w3c.dom.Element getCorrectAbstraction(org.w3c.dom.NodeList abstractions)
Goes throguh a nodelist containing "abstraction"-named elements and returns the one which has level 0
abstractions
- list of elements with the name abstraction (from processml)
private boolean ParseSteps(UseCase usecase, org.w3c.dom.NodeList steps)
Parses steps from given nodelist, stores them to given usecase
usecase
- where steps are storedsteps
- nodelist containing the "step"-elements
private UseCaseStep ParseStep(org.w3c.dom.Node node)
Parses usecase step from given node and returns it, or null if acceptable one wasn't found
node
- xml-element that contains a step
private void ParseInstanceDetails(org.w3c.dom.Element processInstance, UseCase usecase)
Parses processInstance's id and adds it to usecase, also checks if this usecase is a subusecase
processInstance
- xml-element to parse the details fromusecase
- usecase that was created from processInstance attributepublic boolean canRead(java.net.URL url)
Tests if this adapter can read the file. For now, only test is that the file ends with ".xml" If we're adding more xml based inputs, we could verify that the file matches processml.dtd. I didn't implement this, because it could slow down loading (other types of) files a bit.
canRead
in interface InputInterface
url
- url of the file to test
public java.lang.String toString()
InputInterface
toString
in interface InputInterface
toString
in class java.lang.Object
public void applyProperties() throws BadPropertyValueException
ModulePropertyInterface
Applies current properties for the module.
applyProperties
in interface ModulePropertyInterface
applyProperties
in class ModuleProperties
BadPropertyValueException
- In this case exception
is thrown only if either the given parser or heuristic
does not exist.ModulePropertyInterface.applyProperties()
public java.util.Properties loadDefaultProperties()
ModulePropertyInterface
Method which returns the factory default properties for the module.
loadDefaultProperties
in interface ModulePropertyInterface
loadDefaultProperties
in class ModuleProperties
ModulePropertyInterface.loadDefaultProperties()