Package breitband.util
Class Config
- java.lang.Object
-
- breitband.util.Config
-
public class Config extends java.lang.Object
A config that is created by parsing and validating XML config files according to the Breitband requirements.- Author:
- Luna Otte
-
-
Constructor Summary
Constructors Constructor Description Config(java.io.Reader r)
Creates a new config by reading and validating a config file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CableConfig[]
getCableConfigs()
Returns all cables that were found in the config fileContractPool
getContractPool()
Returns a HashMap with all contracts that were found in the config filejava.lang.String
getCountryCode()
Gets the configured country codejava.lang.String
getCountryName()
Gets the configured country namejava.lang.String
getDescription()
Gets the configured descriptionMapCredits
getMapCredits()
Gets the configured map creditsRegion[]
getRegions()
Returns a Vector with all regions that were found in the config filestatic java.lang.String
getVersion()
Gets the configured config versionjava.lang.String
toString()
Returns a string representation of the config, for debugging purposes.
-
-
-
Constructor Detail
-
Config
public Config(java.io.Reader r) throws javax.xml.stream.XMLStreamException, ConfigReaderException
Creates a new config by reading and validating a config file. After instantiation, use the various getters to get the information that was parsed.- Parameters:
r
- A reader to the XML file- Throws:
javax.xml.stream.XMLStreamException
- If an error occurs while parsingConfigReaderException
-
-
Method Detail
-
getVersion
public static java.lang.String getVersion()
Gets the configured config version- Returns:
- The config version
-
getCountryName
public java.lang.String getCountryName()
Gets the configured country name- Returns:
- The country name
-
getCountryCode
public java.lang.String getCountryCode()
Gets the configured country code- Returns:
- The country code
-
getDescription
public java.lang.String getDescription()
Gets the configured description- Returns:
- The description
-
getMapCredits
public MapCredits getMapCredits()
Gets the configured map credits- Returns:
- The map credits
-
getContractPool
public ContractPool getContractPool()
Returns a HashMap with all contracts that were found in the config file- Returns:
- All contracts
-
getRegions
public Region[] getRegions()
Returns a Vector with all regions that were found in the config file- Returns:
- All regions
-
getCableConfigs
public CableConfig[] getCableConfigs()
Returns all cables that were found in the config file- Returns:
- All cables
-
toString
public java.lang.String toString()
Returns a string representation of the config, for debugging purposes.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation
-
-