public class GMFFExportParms extends java.lang.Object implements java.lang.Comparable<GMFFExportParms>
File
object for building relative paths.
It is basically just a data structure with some attached utility functions on the data elements.
During validation however, the GMFFFolders
for the exportDirectory
and modelsDirectory are instantiated and saved for later use.
The reason for creating this class is that GMFF parameter type RunParms are not validated and processed until GMFF is initialized, typically when the user requests an export. So the RunParms are cached until initialization time.
The GMFFExportParms are keyed by exportType.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
charsetEncoding |
static java.util.Comparator<GMFFExportParms> |
EXPORT_TYPE
EXPORT_TYPE sequences by GMFFExportParms.exportType.
|
java.lang.String |
exportDirectory |
java.lang.String |
exportFileType |
GMFFFolder |
exportFolder |
java.lang.String |
exportType |
java.lang.String |
modelId |
java.lang.String |
modelsDirectory |
GMFFFolder |
modelsFolder |
java.lang.String |
onoff |
java.lang.String |
outputFileName |
java.lang.String |
typesetDefKeyword |
Constructor and Description |
---|
GMFFExportParms(java.lang.String exportType,
java.lang.String onoff,
java.lang.String typesetDefKeyword,
java.lang.String exportDirectory,
java.lang.String exportFileType,
java.lang.String modelsDirectory,
java.lang.String modelId,
java.lang.String charsetEncoding,
java.lang.String outputFileName)
A constructor to build a GMFFExportParms object without validating any of
the parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areExportParmsValid(java.io.File filePath,
Messages messages)
Validates Export Parms data.
|
int |
compareTo(GMFFExportParms obj)
Compares GMFFExportParms object based on the primary key, exportType.
|
boolean |
equals(java.lang.Object obj)
Compare for equality with another GMFFExportParms.
|
java.lang.String |
generateAuditReportText()
Converts to Audit Report string for testing purposes.
|
int |
hashCode()
Computes hashcode for this GMFFExportParms
|
static boolean |
isPresentWithNoWhitespace(java.lang.String s)
A GMFF utility to confirm that a given string is not null or empty, and
that it contains no whitespace.
|
java.lang.String |
toString()
converts to String
|
void |
validateCharsetEncoding()
Validates
charsetEncoding . |
GMFFFolder |
validateExportDirectory(java.io.File filePath)
Validates
exportDirectory . |
void |
validateExportFileType()
Validates
exportFileType . |
void |
validateExportType()
Validates
exportType . |
void |
validateModelId()
Validates
modelId . |
GMFFFolder |
validateModelsDirectory(java.io.File filePath)
Validates
modelstDirectory . |
void |
validateOnOff()
Validates
onOff . |
void |
validateOutputFileName()
Validates
outputFileName . |
void |
validateTypesetDefKeyword()
Validates
typesetDefKeyword . |
public final java.lang.String exportType
public java.lang.String onoff
public java.lang.String typesetDefKeyword
public java.lang.String exportDirectory
public java.lang.String exportFileType
public java.lang.String modelsDirectory
public java.lang.String modelId
public java.lang.String charsetEncoding
public java.lang.String outputFileName
public GMFFFolder exportFolder
public GMFFFolder modelsFolder
public static final java.util.Comparator<GMFFExportParms> EXPORT_TYPE
public GMFFExportParms(java.lang.String exportType, java.lang.String onoff, java.lang.String typesetDefKeyword, java.lang.String exportDirectory, java.lang.String exportFileType, java.lang.String modelsDirectory, java.lang.String modelId, java.lang.String charsetEncoding, java.lang.String outputFileName)
See mmj2\doc\GMFFDoc\GMFFRunParms.txt
exportType
- Export Type (e.g. "html" or "althtml")onoff
- OnOff ("ON" or "OFF")typesetDefKeyword
- Metamath $t comment keyword (e.g. "htmldef" or
"althtmldef")exportDirectory
- where output files writtenexportFileType
- File Type including the period (e.g. ".html")modelsDirectory
- Directory where GMFF Models are stored for this
Export TypemodelId
- Model Id for this GMFFExportParms instance.charsetEncoding
- Charset Encoding Name (see doc).outputFileName
- Output File Name minus the file type; if omitted
file name composed using theorem label.
public static boolean isPresentWithNoWhitespace(java.lang.String s)
s
- The string to be validated.public java.lang.String generateAuditReportText()
public boolean areExportParmsValid(java.io.File filePath, Messages messages)
For ease of use, validation does not stop at the first error found. Any errors are accumulated in the Messages object.
However, if onoff
set to "OFF" the following parameters are not
validated.
filePath
- path for building directories. May be null, absolute or
relative.messages
- The Messages object.public void validateExportType() throws GMFFException
exportType
.
GMFFException
- if error found.public void validateOnOff() throws GMFFException
onOff
.
GMFFException
- if error found.public void validateTypesetDefKeyword() throws GMFFException
typesetDefKeyword
.
GMFFException
- if error found.public GMFFFolder validateExportDirectory(java.io.File filePath) throws GMFFException
exportDirectory
.
GMFFFolder
using
exportDirectory
parameter.
filePath
- path for building directory. May be null, absolute or
relative.GMFFException
- if error found.public void validateExportFileType() throws GMFFException
exportFileType
.
GMFFException
- if error found.public GMFFFolder validateModelsDirectory(java.io.File filePath) throws GMFFException
modelstDirectory
.
GMFFFolder
using
modelsDirectory
parameter.
filePath
- path for building directory. May be null, absolute or
relative.GMFFException
- if error found.public void validateModelId() throws GMFFException
modelId
.
GMFFException
- if error found.public void validateCharsetEncoding() throws GMFFException
charsetEncoding
.
Charset.isSupported(charsetEncoding) == true
GMFFException
- if error found.public void validateOutputFileName() throws GMFFException
outputFileName
.
GMFFException
- if error found.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
Equal if and only if the GMFFExportParms exportType strings are equal and the obj to be compared to this object is not null and is a GMFFExportParms as well.
equals
in class java.lang.Object
obj
- another GMFFExportParms -- otherwise will return false.public int compareTo(GMFFExportParms obj)
compareTo
in interface java.lang.Comparable<GMFFExportParms>
obj
- GMFFExportParms object to compare to this GMFFExportParms