|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucot.ModuleProperties
ucot.core.Core
public class Core
This is the implementation of core of the program, the controller of the program.
Field Summary | |
---|---|
private AnalyzeModel |
analyzeModel
|
static java.lang.String |
CANNOT_ADD_SELECTED_USE_CASE_ERROR
|
static java.lang.String |
CANNOT_LOAD_FILES_ERROR
|
private HeuristicInterface |
currentHeuristic
|
private ParserInterface |
currentParser
|
static java.lang.String |
FILE_NOT_FOUND
|
static java.lang.String |
FILE_NOT_SAVED_ERROR
|
static java.lang.String |
FILE_NOT_WRITABLE_ERROR
|
static java.lang.String |
FILEFORMAT_NOT_SUPPORTED_ERROR
|
private java.util.Vector<HeuristicInterface> |
heuristics
|
private InputCollection |
inputs
|
private java.util.logging.Logger |
logger
|
private java.util.Vector<OutputInterface> |
outputs
|
private java.util.Vector<ParserInterface> |
parsers
|
protected static java.util.Vector<java.lang.Runnable> |
parsingThreads
|
private ProgressBarInterface |
progressBar
|
private UseCaseCollection |
useCases
|
private UIInterface |
userInterface
|
Fields inherited from class ucot.ModuleProperties |
---|
properties, propertiesURL |
Constructor Summary | |
---|---|
Core()
Default constructor for UCOT core component. |
Method Summary | |
---|---|
void |
addToAnalyzeModel(java.util.Vector<UseCase> useCases)
Requests core to parse use case, perform heuristic on it and add it to given analyze model. |
void |
addToAnalyzeModel(java.util.Vector<UseCase> useCases,
ParserInterface parser,
HeuristicInterface heuristic)
Requests core to parse use case, perform heuristic on it and add it to given analyze model. |
void |
applyProperties()
Applies current properties for the module. |
void |
clearAnalyzeModel()
Clears the whole current analyze model. |
private HeuristicInterface |
findHeuristic(java.lang.String name)
Helper method for applyProperties to find heuristics by name. |
private ParserInterface |
findParser(java.lang.String name)
Helper method for applyProperties to find parsers by name. |
AnalyzeModel |
getAnalyzeModel()
Returns vector of all analyze models from core. |
HeuristicInterface |
getCurrentHeuristic()
Returns the current heuristic. |
ParserInterface |
getCurrentParser()
Returns the current default parser. |
static java.lang.String |
getFileNotFoundMessage(java.net.URL file)
|
java.util.Vector<HeuristicInterface> |
getHeuristics()
Returns a list of heuristics that are available. |
InputCollection |
getInputs()
Returns InputCollection of inputs. |
java.util.Vector<OutputInterface> |
getOutputs()
Returns a list of output adapters available. |
java.util.Vector<ParserInterface> |
getParsers()
Returns a vector of parsers that are available. |
UseCaseCollection |
getUseCaseCollection()
Returns all loaded use cases. |
void |
loadAnalyzeModel(java.net.URL url)
Loads analyze model from a file. |
java.util.Properties |
loadDefaultProperties()
Method which returns the factory default properties for the module. |
void |
loadProperties()
Loads settings from the current properties XML file. |
void |
loadUseCases(java.net.URL url)
Loads use cases from file. |
static void |
main(java.lang.String[] args)
Main method that starts the UCOT core. |
void |
output(java.net.URL url,
OutputInterface output,
AnalyzeModel model)
Exports given analyze model to given url using given output adapter. |
void |
reloadUseCases(java.net.URL url)
Reloads use cases from file. |
private void |
runParserAndHeuristic(java.lang.Runnable runnable,
java.util.Vector<UseCase> useCases,
ParserInterface parser,
HeuristicInterface heuristic)
This method runs the parser and heuristic in a single thread. |
void |
saveAnalyzeModel(java.net.URL url)
Saves analyze model to a file. |
void |
saveProperties()
Saves current properties to the properties XML file. |
void |
setCurrentHeuristic(HeuristicInterface heuristic)
Sets the default heuristic to use. |
void |
setCurrentParser(ParserInterface parser)
Sets the default parser to use. |
void |
shutdown()
Shuts down the program. |
Methods inherited from class ucot.ModuleProperties |
---|
getProperties, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ucot.ModulePropertyInterface |
---|
getProperties, setProperties |
Field Detail |
---|
public static final java.lang.String FILEFORMAT_NOT_SUPPORTED_ERROR
public static final java.lang.String CANNOT_LOAD_FILES_ERROR
public static final java.lang.String CANNOT_ADD_SELECTED_USE_CASE_ERROR
public static final java.lang.String FILE_NOT_SAVED_ERROR
public static final java.lang.String FILE_NOT_WRITABLE_ERROR
public static final java.lang.String FILE_NOT_FOUND
private InputCollection inputs
private UseCaseCollection useCases
private AnalyzeModel analyzeModel
private java.util.Vector<HeuristicInterface> heuristics
private java.util.Vector<ParserInterface> parsers
private java.util.Vector<OutputInterface> outputs
private UIInterface userInterface
private ParserInterface currentParser
private HeuristicInterface currentHeuristic
private ProgressBarInterface progressBar
private java.util.logging.Logger logger
protected static java.util.Vector<java.lang.Runnable> parsingThreads
Constructor Detail |
---|
public Core()
Method Detail |
---|
public static java.lang.String getFileNotFoundMessage(java.net.URL file)
public static void main(java.lang.String[] args)
args
- Command line arguments.public void shutdown()
ControlInterface
shutdown
in interface ControlInterface
public void loadUseCases(java.net.URL url)
ControlInterface
loadUseCases
in interface ControlInterface
url
- URL of the file.public void loadAnalyzeModel(java.net.URL url) throws java.io.IOException
ControlInterface
loadAnalyzeModel
in interface ControlInterface
url
- URL of the file containing analyze model.
java.io.IOException
- If something goes wrong with loading
use the analyze model from given URL.public UseCaseCollection getUseCaseCollection()
ControlInterface
getUseCaseCollection
in interface ControlInterface
public void clearAnalyzeModel()
ControlInterface
clearAnalyzeModel
in interface ControlInterface
private void runParserAndHeuristic(java.lang.Runnable runnable, java.util.Vector<UseCase> useCases, ParserInterface parser, HeuristicInterface heuristic)
runnable
- Runnable where this thread is running.useCases
- Use cases to be parsed.parser
- Parser to use.heuristic
- Heuristic to use.public void addToAnalyzeModel(java.util.Vector<UseCase> useCases, ParserInterface parser, HeuristicInterface heuristic)
ControlInterface
addToAnalyzeModel
in interface ControlInterface
useCases
- Use case to work magic on.parser
- Parser to use.heuristic
- Heuristic to use.public void addToAnalyzeModel(java.util.Vector<UseCase> useCases)
ControlInterface
addToAnalyzeModel
in interface ControlInterface
useCases
- Use cases to work magic on.public AnalyzeModel getAnalyzeModel()
ControlInterface
getAnalyzeModel
in interface ControlInterface
public java.util.Vector<ParserInterface> getParsers()
ControlInterface
getParsers
in interface ControlInterface
public java.util.Vector<HeuristicInterface> getHeuristics()
ControlInterface
getHeuristics
in interface ControlInterface
public java.util.Vector<OutputInterface> getOutputs()
ControlInterface
getOutputs
in interface ControlInterface
public InputCollection getInputs()
ControlInterface
getInputs
in interface ControlInterface
public void setCurrentParser(ParserInterface parser)
ControlInterface
setCurrentParser
in interface ControlInterface
parser
- Parser to be used by default.public void setCurrentHeuristic(HeuristicInterface heuristic)
ControlInterface
setCurrentHeuristic
in interface ControlInterface
heuristic
- Default heuristic to be used.public ParserInterface getCurrentParser()
ControlInterface
getCurrentParser
in interface ControlInterface
public HeuristicInterface getCurrentHeuristic()
ControlInterface
getCurrentHeuristic
in interface ControlInterface
public void output(java.net.URL url, OutputInterface output, AnalyzeModel model) throws java.lang.Exception
ControlInterface
output
in interface ControlInterface
url
- Destination URL.output
- Output adapter to use.model
- Analyze model to export.
java.lang.Exception
- If something goes wrong with the output, then an
exception is thrown.public void saveAnalyzeModel(java.net.URL url)
ControlInterface
saveAnalyzeModel
in interface ControlInterface
url
- Target file.public void reloadUseCases(java.net.URL url)
ControlInterface
reloadUseCases
in interface ControlInterface
url
- URL of the file to reload.public void applyProperties() throws BadPropertyValueException
ModulePropertyInterface
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()
private ParserInterface findParser(java.lang.String name)
name
- Parser to search.
private HeuristicInterface findHeuristic(java.lang.String name)
name
- Heuristic to search.
public java.util.Properties loadDefaultProperties()
ModulePropertyInterface
loadDefaultProperties
in interface ModulePropertyInterface
loadDefaultProperties
in class ModuleProperties
ModulePropertyInterface.loadDefaultProperties()
public void saveProperties() throws java.io.IOException
ModulePropertyInterface
saveProperties
in interface ModulePropertyInterface
saveProperties
in class ModuleProperties
java.io.IOException
- Exception is thrown if something went wrong.ModulePropertyInterface.saveProperties()
public void loadProperties() throws java.io.IOException
ModulePropertyInterface
loadProperties
in interface ModulePropertyInterface
loadProperties
in class ModuleProperties
java.io.IOException
- Exception is thrown if something went wrong.ModulePropertyInterface.loadProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |