ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.app
Class ContactCenterEvalResultsConverter

java.lang.Object
  extended by umontreal.iro.lecuyer.xmlbind.JAXBParamsConverter<ContactCenterEvalResultsParams>
      extended by umontreal.iro.lecuyer.contactcenters.app.ContactCenterEvalResultsConverter

public class ContactCenterEvalResultsConverter
extends JAXBParamsConverter<ContactCenterEvalResultsParams>

Converter for marshalling and unmarshalling objects containing evaluation results.


Constructor Summary
ContactCenterEvalResultsConverter()
           
 
Method Summary
 JAXBContext getContext()
          Constructs and returns the JAXB context used to read parameters.
 Map<String,String> getNamespacePrefixes()
          Returns a map associating prefixes with namespace URI.
 Schema getSchema()
          Constructs and returns a schema for the document type represented by a concrete subclass.
 void marshalEval(ContactCenterEvalResults res, ContentHandler handler)
          Marshals an object containing evaluation results into an XML document, and writes the resulting output to the content handler handler.
 void marshalEval(ContactCenterEvalResults res, File file)
          Similar to marshalEval(ContactCenterEvalResults,ContentHandler), but uses JAXBParamsConverter.marshal(Object,File) for marshalling into a file instead.
 void marshalEval(ContactCenterEvalResults res, Node node)
          Similar to marshalEval(ContactCenterEvalResults,ContentHandler), but uses JAXBParamsConverter.marshal(Object,Node) for marshalling instead.
 void marshalEval(ContactCenterEvalResults res, Result result)
          Similar to marshalEval(ContactCenterEvalResults,ContentHandler), but uses JAXBParamsConverter.marshal(Object,Result) for marshalling instead.
 void marshalEvalAndGZip(ContactCenterEvalResults res, File file)
          Similar to marshalEval(ContactCenterEvalResults,File), but calls JAXBParamsConverter.marshalAndGZip(Object,File).
 void marshalEvalAndGZipOrExit(ContactCenterEvalResults res, File file)
          Similar to marshalEvalOrExit(ContactCenterEvalResults,File), but calls JAXBParamsConverter.marshalAndGZipOrExit(Object,File).
 void marshalEvalOrExit(ContactCenterEvalResults res, File file)
          Similar to marshalEval(ContactCenterEvalResults,File), but uses JAXBParamsConverter.marshalOrExit(Object,File) for marshalling.
 ContactCenterEvalResults unmarshalGZippedToEval(File file)
          Similar to unmarshalToEval(File), but calls JAXBParamsConverter.unmarshalGZipped(File) for unmarshalling.
 ContactCenterEvalResults unmarshalGZippedToEval(File file, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(File,boolean), but calls JAXBParamsConverter.unmarshalGZipped(File) for unmarshalling.
 ContactCenterEvalResults unmarshalGZippedToEval(URL url)
          Similar to unmarshalToEval(URL), but calls JAXBParamsConverter.unmarshalGZipped(URL) for unmarshalling.
 ContactCenterEvalResults unmarshalGZippedToEval(URL url, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(URL,boolean) but calls JAXBParamsConverter.unmarshalGZipped(URL) for unmarshalling.
 ContactCenterEvalResults unmarshalToEval(File file)
          Reads evaluation results from the file file.
 ContactCenterEvalResults unmarshalToEval(File file, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(File), but uses ContactCenterEvalResults.createFromParams(ContactCenterEvalResultsParams,boolean) instead of ContactCenterEvalResults.createFromParams(ContactCenterEvalResultsParams).
 ContactCenterEvalResults unmarshalToEval(Node node)
          Similar to unmarshalToEval(File), with a node instead of a file.
 ContactCenterEvalResults unmarshalToEval(Node node, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(File,boolean) with a node instead of a file.
 ContactCenterEvalResults unmarshalToEval(Source source)
          Similar to unmarshalToEval(File), with a source instead of a file.
 ContactCenterEvalResults unmarshalToEval(Source source, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(File,boolean), with a source instead of a file.
 ContactCenterEvalResults unmarshalToEval(URL url)
          Similar to unmarshalToEval(File), with an URL instead of a file.
 ContactCenterEvalResults unmarshalToEval(URL url, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(File,boolean), with an URL instead of a file.
 ContactCenterEvalResults unmarshalToEvalOrExit(File file)
          Similar to unmarshalToEval(File), but calls JAXBParamsConverter.unmarshalOrExit(File) to perform unmarshalling.
 ContactCenterEvalResults unmarshalToEvalOrExit(File file, boolean reportPropertiesToEvalInfo)
          Similar to unmarshalToEval(File,boolean), but calls JAXBParamsConverter.unmarshalOrExit(File) to perform unmarshalling.
 
Methods inherited from class umontreal.iro.lecuyer.xmlbind.JAXBParamsConverter
getEventHandler, getJAXBObject, getValue, hasErrors, hasFatalErrors, hasWarnings, initMarshaller, initUnmarshaller, isValidating, locatorToString, marshal, marshal, marshal, marshal, marshalAndGZip, marshalAndGZipOrExit, marshalOrExit, readSchema, setEventHandler, setValidating, unmarshal, unmarshal, unmarshal, unmarshal, unmarshalGZipped, unmarshalGZipped, unmarshalOrExit, validationEventsToString, validationEventToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactCenterEvalResultsConverter

public ContactCenterEvalResultsConverter()
Method Detail

getContext

public JAXBContext getContext()
                       throws JAXBException
Description copied from class: JAXBParamsConverter
Constructs and returns the JAXB context used to read parameters. This method should create and return a static instance of the JAXB context since the creation of the context is costly.

Any concrete subclass should define a static field of type JAXBContext. If the field is non-null, the method returns its value. Otherwise, it initializes the field using JAXBContext.newInstance(String), and returns the resulting context. The arguments given to JAXB depends on the JAXB-derived class associated with the concrete subclass.

Specified by:
getContext in class JAXBParamsConverter<ContactCenterEvalResultsParams>
Returns:
the JAXB context to be used.
Throws:
JAXBException - if an error occurs while creating the JAXB context.

getSchema

public Schema getSchema()
                 throws SAXException
Description copied from class: JAXBParamsConverter
Constructs and returns a schema for the document type represented by a concrete subclass. If no schema is used, this method should return null. If an error occurs when reading or parsing the schema, this method should throws a SAX exception.

It is recommended to use SchemaFactory to create the Schema object, and to store it in a static variable for future use, because loading and parsing the schema might be costly. If the schema is stored at the same location as class files, Class.getResourceAsStream(String) can be used to obtain a stream for the schema.

Specified by:
getSchema in class JAXBParamsConverter<ContactCenterEvalResultsParams>
Returns:
the schema object, or null.
Throws:
SAXException - if an error occurred during reading or parsing.

getNamespacePrefixes

public Map<String,String> getNamespacePrefixes()
Description copied from class: JAXBParamsConverter
Returns a map associating prefixes with namespace URI. Each key of the returned map corresponds to a prefix while each value denotes a URI. This map is used while marshalling in order to assign meaningful prefixes to namespace URI rather than the default prefixes. An empty map can be used to disable namespace prefix mapping.

When using namespaces, each XML element and attribute can be qualified with a namespace URI which is referred to, in the XML document, using a prefix. These prefixes, which are not unique in contrast with URIs, can be chosen arbitrarily, but they should be human-readable for clearer documents. However, by default, JAXB generates its own prefix each time it finds a new namespace URI during marshalling; there is no standard way to impose prefixes. This map can be used to bind user-defined prefixes to the URIs used by the XML document. When this method returns a non-empty map, the marshalling mechanism of this class uses the RemappingContentHandler to perform the namespace prefix mapping in a way independent from the JAXB implementation.

Specified by:
getNamespacePrefixes in class JAXBParamsConverter<ContactCenterEvalResultsParams>
Returns:
the map associating namsepace prefixes to URIs.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(File file)
                                         throws JAXBException
Reads evaluation results from the file file. This method uses JAXBParamsConverter.unmarshal(File) to unmarshal the given file to a parameter object, and ContactCenterEvalResults.createFromParams(ContactCenterEvalResultsParams) to create the final object containing results.

Parameters:
file - the input file.
Returns:
the evaluation results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(File file,
                                                boolean reportPropertiesToEvalInfo)
                                         throws JAXBException
Similar to unmarshalToEval(File), but uses ContactCenterEvalResults.createFromParams(ContactCenterEvalResultsParams,boolean) instead of ContactCenterEvalResults.createFromParams(ContactCenterEvalResultsParams).

Parameters:
file - the input file
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the evaluation results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalGZippedToEval

public ContactCenterEvalResults unmarshalGZippedToEval(File file)
                                                throws JAXBException
Similar to unmarshalToEval(File), but calls JAXBParamsConverter.unmarshalGZipped(File) for unmarshalling.

Parameters:
file - the input file.
Returns:
the evaluation results.
Throws:
JAXBException - if an error occurs during the unmarshalling.

unmarshalGZippedToEval

public ContactCenterEvalResults unmarshalGZippedToEval(File file,
                                                       boolean reportPropertiesToEvalInfo)
                                                throws JAXBException
Similar to unmarshalToEval(File,boolean), but calls JAXBParamsConverter.unmarshalGZipped(File) for unmarshalling.

Parameters:
file - the input file
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the evaluation results.
Throws:
JAXBException - if an error occurs during the unmarshalling.

unmarshalGZippedToEval

public ContactCenterEvalResults unmarshalGZippedToEval(URL url)
                                                throws JAXBException
Similar to unmarshalToEval(URL), but calls JAXBParamsConverter.unmarshalGZipped(URL) for unmarshalling.

Parameters:
url - the input URL.
Returns:
the evaluation results.
Throws:
JAXBException - if an error occurs during the unmarshalling.

unmarshalGZippedToEval

public ContactCenterEvalResults unmarshalGZippedToEval(URL url,
                                                       boolean reportPropertiesToEvalInfo)
                                                throws JAXBException
Similar to unmarshalToEval(URL,boolean) but calls JAXBParamsConverter.unmarshalGZipped(URL) for unmarshalling.

Parameters:
url - the input URL.
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the evaluation results.
Throws:
JAXBException - if an error occurs during the unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(URL url)
                                         throws JAXBException
Similar to unmarshalToEval(File), with an URL instead of a file.

Parameters:
url - the URL of the XML data.
Returns:
the constructed object containing results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(URL url,
                                                boolean reportPropertiesToEvalInfo)
                                         throws JAXBException
Similar to unmarshalToEval(File,boolean), with an URL instead of a file.

Parameters:
url - the input URL of the XML data.
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the evaluation results.
Throws:
JAXBException - if an error occurs during unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(Node node)
                                         throws JAXBException
Similar to unmarshalToEval(File), with a node instead of a file.

Parameters:
node - the input node.
Returns:
the constructed object containing results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(Node node,
                                                boolean reportPropertiesToEvalInfo)
                                         throws JAXBException
Similar to unmarshalToEval(File,boolean) with a node instead of a file.

Parameters:
node - the input node.
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the constructed object containing results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(Source source)
                                         throws JAXBException
Similar to unmarshalToEval(File), with a source instead of a file.

Parameters:
source - the input source to read XML from.
Returns:
the constructed object containing results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalToEval

public ContactCenterEvalResults unmarshalToEval(Source source,
                                                boolean reportPropertiesToEvalInfo)
                                         throws JAXBException
Similar to unmarshalToEval(File,boolean), with a source instead of a file.

Parameters:
source - the input source to read XML from.
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the constructed object containing results.
Throws:
JAXBException - if an exception occurs during unmarshalling.

unmarshalToEvalOrExit

public ContactCenterEvalResults unmarshalToEvalOrExit(File file)
Similar to unmarshalToEval(File), but calls JAXBParamsConverter.unmarshalOrExit(File) to perform unmarshalling. This method should be used in simple programs with no graphical user interface, because it can print information on the standard output, and exit the program if an error occurs.

Parameters:
file - the input file.
Returns:
the constructed object containing results.

unmarshalToEvalOrExit

public ContactCenterEvalResults unmarshalToEvalOrExit(File file,
                                                      boolean reportPropertiesToEvalInfo)
Similar to unmarshalToEval(File,boolean), but calls JAXBParamsConverter.unmarshalOrExit(File) to perform unmarshalling.

Parameters:
file - the input file.
reportPropertiesToEvalInfo - determines if report properties are copied to evaluation information.
Returns:
the constructed object containing results.

marshalEval

public void marshalEval(ContactCenterEvalResults res,
                        ContentHandler handler)
                 throws JAXBException
Marshals an object containing evaluation results into an XML document, and writes the resulting output to the content handler handler. This method uses ContactCenterEvalResults.createParams() to create a parameter object from the evaluation results, and uses JAXBParamsConverter.marshal(Object,ContentHandler) to marshal the parameters to XML.

Parameters:
res - the object containing evaluation results.
handler - the target content handler receiving XML events.
Throws:
JAXBException - if an exception occurs during marshalling.

marshalEval

public void marshalEval(ContactCenterEvalResults res,
                        Result result)
                 throws JAXBException
Similar to marshalEval(ContactCenterEvalResults,ContentHandler), but uses JAXBParamsConverter.marshal(Object,Result) for marshalling instead.

Parameters:
res - the object containing evaluation results.
result - the output result for the XML contents.
Throws:
JAXBException - if an error occurs during marshalling.

marshalEval

public void marshalEval(ContactCenterEvalResults res,
                        File file)
                 throws JAXBException
Similar to marshalEval(ContactCenterEvalResults,ContentHandler), but uses JAXBParamsConverter.marshal(Object,File) for marshalling into a file instead.

Parameters:
res - the object containing evaluation results.
file - the output file.
Throws:
JAXBException - if an error occurs during marshalling.

marshalEvalAndGZip

public void marshalEvalAndGZip(ContactCenterEvalResults res,
                               File file)
                        throws JAXBException
Similar to marshalEval(ContactCenterEvalResults,File), but calls JAXBParamsConverter.marshalAndGZip(Object,File).

Parameters:
res - the object to be marshalled.
file - the output file.
Throws:
JAXBException - if an error occurs during the process.

marshalEval

public void marshalEval(ContactCenterEvalResults res,
                        Node node)
                 throws JAXBException
Similar to marshalEval(ContactCenterEvalResults,ContentHandler), but uses JAXBParamsConverter.marshal(Object,Node) for marshalling instead.

Parameters:
res - the object containing evaluation results.
node - the output node.
Throws:
JAXBException - if an error occurs during marshalling.

marshalEvalOrExit

public void marshalEvalOrExit(ContactCenterEvalResults res,
                              File file)
Similar to marshalEval(ContactCenterEvalResults,File), but uses JAXBParamsConverter.marshalOrExit(Object,File) for marshalling. This method should be used in simple programs with no graphical user interface, because it can print information on the standard output, and exit the program if an error occurs.

Parameters:
res -
file -

marshalEvalAndGZipOrExit

public void marshalEvalAndGZipOrExit(ContactCenterEvalResults res,
                                     File file)
Similar to marshalEvalOrExit(ContactCenterEvalResults,File), but calls JAXBParamsConverter.marshalAndGZipOrExit(Object,File).

Parameters:
res - the object to be marshalled.
file - the output file.

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.