gov.llnl.babel.config
public class Configuration extends java.lang.Object
Configuration
contains configuration information
from the machine configuration database for the Babel compiler. It
defines the languages supported by the Babel compiler, the valid
configuration profiles for each language, and the parameter choices
for each option. An optional Metadata
object may be
provided to validate the correctness of the configuration information.Constructor and Description |
---|
Configuration()
The constructor for the
Configuration class
initializes the profile database. |
Modifier and Type | Method and Description |
---|---|
java.util.Map |
getConfiguration(java.lang.String language,
java.lang.String profile_name)
Return the configuration information associated with a language
and a profile name.
|
java.util.Set |
getLanguages()
Return the languages supported by the Babel compiler as a set of
strings.
|
Profile |
getProfile(java.lang.String language,
java.lang.String profile_name)
Return the profile associated with a language and a profile
name.
|
java.util.Set |
getProfileNames(java.lang.String language)
Given a particular language, return the valid profile names
available for that language.
|
void |
readConfiguration(java.lang.String uri)
Parse the specified XML document to retrieve machine configuration
information.
|
void |
setMetadataDescription(Metadata metadata)
Profide the metadata description that will be used to validate
the configuration input file.
|
void |
setMetadataDescription(java.lang.String URI)
Provide the metadata description that will be used to validate
the configuration input file.
|
void |
validateProfile(Profile profile)
Validate the profile against the metadata description set by a
previous call to
setMetadataDescription . |
public Configuration()
Configuration
class
initializes the profile database. Machine configuration
profiles are read into the configuration object using method
readConfiguration
.public java.util.Set getLanguages()
public java.util.Set getProfileNames(java.lang.String language)
public Profile getProfile(java.lang.String language, java.lang.String profile_name)
public java.util.Map getConfiguration(java.lang.String language, java.lang.String profile_name)
public void setMetadataDescription(java.lang.String URI) throws java.io.IOException, org.xml.sax.SAXException
IOException
will be thrown if
the URI is invalid and a SAXException
will be thrown
if a parse error occurs while reading the XML metadata file.java.io.IOException
org.xml.sax.SAXException
public void setMetadataDescription(Metadata metadata)
public void validateProfile(Profile profile) throws InvalidConfiguration
setMetadataDescription
. If no
previous metadata profile was set, then no validation will be
performed. If the profile is invalid, then an exception of type
InvalidConfigutation
will be thrown.InvalidConfiguration
public void readConfiguration(java.lang.String uri) throws java.io.IOException, InvalidConfiguration
validateProfile
.java.io.IOException
InvalidConfiguration