|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.xmlconfig.AbstractParam
public abstract class AbstractParam
Provides common attributes for parameter objects. This class pvovides the id attribute which can be used to identify an element in the XML file. The xref attribute can be used to reference an identified element. Both attributes are of type string.
<element id="element-id"/>
<element xref="element-id"/>
Constructor Summary | |
---|---|
AbstractParam()
|
Method Summary | |
---|---|
void |
check()
Verifies that every needed parameter was specified. |
static Document |
createDocument(ClassFinder finder,
StorableParam par,
String rootName,
int spc)
Constructs a DOM document from the storable parameter object par, using the class finder finder to resolve simple class names, with root element with name rootName, and with spc spaces of indentation. |
String |
getId()
Returns the identifier associated with this element. |
String |
getXref()
Returns the identifier of the referenced element. |
void |
setId(String id)
Sets the identifier of this parameter element to id. |
void |
setXref(String xref)
Sets the referenced identifier to xref. |
String |
toString()
|
static void |
write(ClassFinder finder,
File file,
StorableParam par,
String rootName,
int spc)
Same as String, StorableParam, String, int) ,
for a file object rather than a file name. |
static void |
write(ClassFinder finder,
OutputStream out,
StorableParam par,
String rootName,
int spc)
Same as String, StorableParam, String, int) ,
but writes the XML contents to the output stream out. |
static void |
write(ClassFinder finder,
String fileName,
StorableParam par,
String rootName,
int spc)
Convenience method to write the parameters par into an XML file file, with a root element name rootName and spc spaces for each needed indentation level. |
static void |
write(ClassFinder finder,
Writer out,
StorableParam par,
String rootName,
int spc)
Same as String, StorableParam, String, int) ,
but writes the XML contents to the writer out. |
static void |
write(File file,
StorableParam par,
String rootName,
int spc)
Equivalent to File, StorableParam, String, int)
write (new ClassFinder(), file, par, rootName, spc) . |
static void |
write(OutputStream out,
StorableParam par,
String rootName,
int spc)
Equivalent to OutputStream, StorableParam, String, int) write
(new ClassFinder(), out, par, rootName, spc) . |
static void |
write(String fileName,
StorableParam par,
String rootName,
int spc)
Equivalent to String, StorableParam, String, int) write (new
ClassFinder(), fileName, par, rootName, spc) . |
static void |
write(Writer out,
StorableParam par,
String rootName,
int spc)
Equivalent to Writer, StorableParam, String, int) write (new
ClassFinder(), out, par, rootName, spc) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractParam()
Method Detail |
---|
public String getId()
public void setId(String id)
id
- the new identifier of the element.
NullPointerException
- if id is null.public String getXref()
public void setXref(String xref)
xref
- the new referenced identifier.
NullPointerException
- if xref is null.public void check()
ParamReadException
in case of missing parameters.
ParamReadException
- if some parameters are missing or invalid.public String toString()
toString
in class Object
public static void write(String fileName, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
String, StorableParam, String, int) write (new
ClassFinder(), fileName, par, rootName, spc)
.
IOException
ParserConfigurationException
TransformerException
public static void write(ClassFinder finder, String fileName, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
Class
objects into simple names. This method
uses an XML transformer to write the document obtained using the
createDocument(umontreal.iro.lecuyer.util.ClassFinder, umontreal.iro.lecuyer.xmlconfig.StorableParam, java.lang.String, int)
method to an XML file.
finder
- the class finder used to format class names.fileName
- the name of the output file.par
- the parameter object to be stored.rootName
- the name of the root element of the XML file.spc
- the number of spaces per indentation level.
IOException
- if an I/O error occurs.
ParserConfigurationException
- if the XML document builder could not be created.
TransformerException
- if the XML transformer could not be created properly.public static void write(File file, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
File, StorableParam, String, int)
write (new ClassFinder(), file, par, rootName, spc)
.
IOException
ParserConfigurationException
TransformerException
public static void write(ClassFinder finder, File file, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
String, StorableParam, String, int)
,
for a file object rather than a file name.
finder
- the class finder used to format class names.file
- the object representing the output file.par
- the parameter object to be stored.rootName
- the name of the root element of the XML file.spc
- the number of spaces per indentation level.
IOException
- if an I/O error occurs.
ParserConfigurationException
- if the XML document builder could not be created.
TransformerException
- if the XML transformer could not be created properly.public static void write(OutputStream out, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
OutputStream, StorableParam, String, int) write
(new ClassFinder(), out, par, rootName, spc)
.
IOException
ParserConfigurationException
TransformerException
public static void write(ClassFinder finder, OutputStream out, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
String, StorableParam, String, int)
,
but writes the XML contents to the output stream out.
finder
- the class finder used to format class names.out
- the output stream for the XML contents.par
- the parameter object to be stored.rootName
- the name of the root element of the XML file.spc
- the number of spaces per indentation level.
IOException
- if an I/O error occurs.
ParserConfigurationException
- if the XML document builder could not be created.
TransformerException
- if the XML transformer could not be created properly.public static void write(Writer out, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
Writer, StorableParam, String, int) write (new
ClassFinder(), out, par, rootName, spc)
.
IOException
ParserConfigurationException
TransformerException
public static void write(ClassFinder finder, Writer out, StorableParam par, String rootName, int spc) throws IOException, ParserConfigurationException, TransformerException
String, StorableParam, String, int)
,
but writes the XML contents to the writer out.
finder
- the class finder used to format class names.out
- the writer for the XML contents.par
- the parameter object to be stored.rootName
- the name of the root element of the XML file.spc
- the number of spaces per indentation level.
IOException
- if an I/O error occurs.
ParserConfigurationException
- if the XML document builder could not be created.
TransformerException
- if the XML transformer could not be created properly.public static Document createDocument(ClassFinder finder, StorableParam par, String rootName, int spc) throws ParserConfigurationException
finder
- the class finder used to resolve simple class names.par
- the parameter object to write.rootName
- the name of the root element.spc
- the number of spaces of indentation.
ParserConfigurationException
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |