public class MapPrinter
extends java.lang.Object
| Constructor and Description |
|---|
MapPrinter() |
| Modifier and Type | Method and Description |
|---|---|
Configuration |
getConfiguration() |
OutputFormat |
getOutputFormat(PJsonObject specJson)
Get the object responsible for printing to the correct output format.
|
java.util.Set<java.lang.String> |
getOutputFormatsNames()
Return the available format ids.
|
static PJsonObject |
parseSpec(java.lang.String spec)
Parse the JSON string and return the object.
|
void |
print(java.lang.String jobId,
PJsonObject specJson,
java.io.OutputStream out)
Start a print.
|
void |
printClientConfig(org.json.JSONWriter json)
Use by /info.json to generate its returned content.
|
void |
setConfiguration(java.io.File newConfigFile)
Set the configuration file and update the configuration for this printer.
|
void |
setConfiguration(java.net.URI newConfigFile,
byte[] configFileData)
Set the configuration file and update the configuration for this printer.
|
public final void setConfiguration(java.io.File newConfigFile)
throws java.io.IOException
newConfigFile - the file containing the new configuration.java.io.IOExceptionpublic final void setConfiguration(java.net.URI newConfigFile,
byte[] configFileData)
throws java.io.IOException
newConfigFile - the file containing the new configuration.configFileData - the config file data.java.io.IOExceptionpublic final Configuration getConfiguration()
public final void printClientConfig(org.json.JSONWriter json)
throws org.json.JSONException
json - the writer for outputting the config specificationorg.json.JSONExceptionpublic static PJsonObject parseSpec(java.lang.String spec)
spec - the JSON formatted string.public final OutputFormat getOutputFormat(PJsonObject specJson)
specJson - the request json from the clientpublic final void print(java.lang.String jobId,
PJsonObject specJson,
java.io.OutputStream out)
throws java.lang.Exception
jobId - the job IDspecJson - the client json request.out - the stream to write to.java.lang.Exceptionpublic final java.util.Set<java.lang.String> getOutputFormatsNames()