|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.profiling.OptionsPackage
public class OptionsPackage
An OptionsPackage
contains a collection of Options
, and
defines a complete configuration of a STANDUP system.
The current implementation of OptionsPackage
is rather hard-coded to
include one each of OptionsCloudFrontend
,
OptionsJokeGeneration
, and OptionsLexicon
. Given more time,
it would have been nice to allow arbitrary collections of Options
implementations...
Field Summary | |
---|---|
static String[] |
optionClassNames
|
private Hashtable<String,Options> |
optionsHashtable
Contains a cache of instantiated options. |
Constructor Summary | |
---|---|
OptionsPackage()
Constructor for a new "default" options package. |
|
OptionsPackage(Element element)
Constructor for an options package from the given XML Element . |
|
OptionsPackage(File optionsFile)
Constructor for an options package that contains settings and values obtained from the given File . |
|
OptionsPackage(Set<Options> optionsSet)
Constructor for an options package from an existing set of Options. |
|
OptionsPackage(URL optionsURL)
Constructor for an options package that contains settings and values obtained from the given URL. |
Method Summary | |
---|---|
Collection<Options> |
getAllOptions()
Returns all Options in this OptionsPackage . |
Options |
getOptions(String xmlTag)
|
static void |
main(String[] args)
|
private static Options |
reflectionDefaultInstance(String optionsClassName)
|
private static Options |
reflectionElementInstance(String optionsClassName,
Element element)
|
void |
save(File file)
This method saves the necessary information contained within an instance to an XML file. |
void |
setOptions(Options options)
Adds the given Options to this OptionsPackage . |
void |
writeXML(Writer out,
String indent)
This method writes the necessary information contained within an instance to an XML file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final transient Hashtable<String,Options> optionsHashtable
public static final String[] optionClassNames
Constructor Detail |
---|
public OptionsPackage() throws ProfileException
ProfileManager.getDefaultOptionsPackage()
.
ProfileException
public OptionsPackage(Element element)
Element
.
NOTE: this method may possibly instantiate an incomplete
OptionsPackage, i.e. if the given Element contains a definition for an
Options that is not known, it will not load it. For example, if the
Options contains an
public OptionsPackage(URL optionsURL)
optionsURL
- public OptionsPackage(File optionsFile)
File
.
optionsFile
- public OptionsPackage(Set<Options> optionsSet)
optionsCloudFrontend
- optionsJokeGeneration
- optionsLexicon
- Method Detail |
---|
public Options getOptions(String xmlTag)
public Collection<Options> getAllOptions()
Options
in this OptionsPackage
.
public void setOptions(Options options)
Options
to this OptionsPackage
. If an
Options
of the same type already currently exists, it will be
replaced.
options
- private static Options reflectionDefaultInstance(String optionsClassName)
private static Options reflectionElementInstance(String optionsClassName, Element element)
public static void main(String[] args) throws Exception
Exception
public void save(File file) throws XMLException
XMLsaveable
file
,XMLizable.writeXML(java.io.Writer, String)
, and
save
in interface XMLsaveable
file
- The file to be saved.
XMLException
public void writeXML(Writer out, String indent) throws IOException, XMLException
XMLizable
writeXML
in interface XMLizable
out
- The output stream for the XML file, which is assumed to be
already opened and writable.indent
- A string to be prepended before every line written by this
method. If passed appropriate white space, e.g.
XMLUtils.xmlIndent
, it can be used to control
indentation.
IOException
XMLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |