public class BeagleConfiguration extends Object
The configuration has two states: A set up state, during which values may
be modified and a finalised state, in which the configuration is immutable and
can only be used to obtain values. The transition from the set up state to the
finalised state is done through finalise()
. The inverse transition is
not possible. Trying to perform an action that is not allowed for the momentary state
results in an IllegalStateException
being thrown.
Constructor and Description |
---|
BeagleConfiguration(List<String> elements,
File repositoryFile,
File sourceStatementLinkFile,
org.eclipse.jdt.core.IJavaProject javaProject)
Constructs a new
BeagleConfiguration using elements as the default
elements to be measured. |
Modifier and Type | Method and Description |
---|---|
void |
finalise()
Finalises this configuration, thus transitioning it into the finalised
state.
|
List<String> |
getElements()
Returns the elements to be measured or
null to indicate that everything in
the repository file should be analysed. |
org.eclipse.jdt.core.IJavaProject |
getJavaProject()
Gives the
IJavaProject to analyse. |
Set<LaunchConfiguration> |
getLaunchConfigurations()
Returns the LaunchConfigurations to use for the
analysis.
|
File |
getRepositoryFile()
Returns the repository file that contains all elements that shall be analysed.
|
File |
getSourceStatementLinkFile()
Returns the file containing the model linking PCM elements to their positions in
the source code.
|
Timeout |
getTimeout()
Returns the timeout to be used.
|
boolean |
isFinal()
Queries whether this configuration is in the finalised state.
|
void |
setElements(List<String> elements)
Sets the elements to be measured to
elements . |
void |
setLaunchConfigurations(Set<LaunchConfiguration> launchConfigurations)
Sets the LaunchConfigurations to use for the
analysis.
|
void |
setRepositoryFile(File repositoryFile)
Sets the repository file containing the elements Beagle shall analyse.
|
void |
setSourceStatementLinkFile(File sourceStatementLinkFile)
Sets the file containing the model linking PCM elements to their positions in the
source code.
|
void |
setTimeout(Timeout timeout)
Sets the timeout to be used to
timeout . |
public BeagleConfiguration(List<String> elements, File repositoryFile, File sourceStatementLinkFile, org.eclipse.jdt.core.IJavaProject javaProject)
BeagleConfiguration
using elements
as the default
elements to be measured.elements
- The elements to be measured or null
to indicate that
everything in repositoryFile
should be analysed.repositoryFile
- The repository file to use. Must not be null
.sourceStatementLinkFile
- The xml file containing the PCM Element Source
Statement Link Model.javaProject
- the IJavaProject
to analyse. Must not be null
.public org.eclipse.jdt.core.IJavaProject getJavaProject()
IJavaProject
to analyse.IJavaProject
to analyse.public List<String> getElements()
null
to indicate that everything in
the repository file should be analysed.null
to indicate that everything in
the repository file should be analysed.public void setElements(List<String> elements)
elements
. null
indicates that
everything in the repository file should be
analysed. This operation is only allowed in the set up state.elements
- The elements to be measured or null
to indicate that
everything in the repository file
should be analysed.IllegalStateException
- If this configuration is not in the set up
state.getElements()
public Timeout getTimeout()
public void setTimeout(Timeout timeout)
timeout
. The timeout describes the minimum
time Beagle shall keep trying to find results while no perfect results were found.
This operation is only allowed in the set up state.timeout
- The timeout to be used by Beagle.IllegalStateException
- If this configuration is not in the set up
state.public Set<LaunchConfiguration> getLaunchConfigurations()
public void setLaunchConfigurations(Set<LaunchConfiguration> launchConfigurations)
launchConfigurations
- The LaunchConfigurations to use for the analysis.IllegalStateException
- If this configuration is not in the set up
state.public File getRepositoryFile()
public void setRepositoryFile(File repositoryFile)
repositoryFile
- The pcm repository file containing all elements Beagle shall
analyse. Must not be null
.IllegalStateException
- If this configuration is not in the set up
state.public void setSourceStatementLinkFile(File sourceStatementLinkFile)
sourceStatementLinkFile
- The XML file containing the PCM Source Statement
Links Model.public File getSourceStatementLinkFile()
public boolean isFinal()
true
if this configuration is in the finalised state,
false
if it’s in the set up state.public void finalise()