java.lang.Objectucot.ModuleProperties
ucot.input.SimpleInputAdapter
public class SimpleInputAdapter
Input adapter for the simple input format. Reads usecases that are stored in this format:
[name]
Name of the usecase is here
[id]
Id of the usecase (must be unique within file, it is discarded after loading)
[steps]
Steps separated with linebreak. Step can have a sub-usecase, it is marked with (usecaseid) after the steps description and "."-character.
[end]
Use case ends with [end] tag, another usecase can begin with [name] element now
Field Summary | |
---|---|
static java.lang.String |
name
|
Fields inherited from class ucot.ModuleProperties |
---|
properties, propertiesURL |
Constructor Summary | |
---|---|
SimpleInputAdapter()
|
Method Summary | |
---|---|
void |
applyProperties()
Applies current properties for the module. |
boolean |
canRead(java.net.URL url)
Tests if this adapter can read the file. |
java.lang.String |
getName()
Returns the name of this adapter |
java.util.Properties |
loadDefaultProperties()
Method which returns the factory default properties for the module. |
private UseCaseStep |
parseStep(java.lang.String line)
Parses usecase step from given line. |
UseCaseCollection |
read(java.net.URL url)
Reads usecase collection from URL. |
UseCase |
readUseCase(java.io.BufferedReader reader,
java.net.URL url)
Reads a single usecase from given reader, sets it's url to given one |
void |
readUseCases(java.io.BufferedReader reader,
UseCaseCollection collection,
java.net.URL url)
Reads usecases from given reader, stores them to given collection and sets their url to given one. |
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 |
---|
public static final java.lang.String name
Constructor Detail |
---|
public SimpleInputAdapter()
Method Detail |
---|
public java.lang.String getName()
Returns the name of this adapter
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
public void readUseCases(java.io.BufferedReader reader, UseCaseCollection collection, java.net.URL url) throws java.io.IOException
Reads usecases from given reader, stores them to given collection and sets their url to given one.
reader
- reader for the inputstreamcollection
- where all found usecases are storedurl
- url for the usecase
java.io.IOException
public UseCase readUseCase(java.io.BufferedReader reader, java.net.URL url) throws java.io.IOException
Reads a single usecase from given reader, sets it's url to given one
reader
- reader to read usecases withurl
- url for the usecases
java.io.IOException
private UseCaseStep parseStep(java.lang.String line)
Parses usecase step from given line. Also stores relation id
line
-
public boolean canRead(java.net.URL url)
Tests if this adapter can read the file. For now, only test is that the file ends with ".txt"
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 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()
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()