From 6078468e85a960007390933d410625214ac1d354 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Mon, 30 Oct 2023 15:17:57 +0100 Subject: [PATCH] refactor: address JDT warnings "hiding" --- .../addons/docfactory/AsposeDocFactory.java | 170 +++++++++--------- .../ivy/addons/docfactory/BaseDocFactory.java | 131 +++++++------- .../addons/docfactory/DocumentTemplate.java | 18 +- .../aspose/AsposeDocFactoryFileGenerator.java | 16 +- .../aspose/AsposeFieldMergingCallback.java | 10 +- .../docfactory/aspose/DocumentWorker.java | 9 +- .../aspose/MailMergeDataSource.java | 2 +- .../options/DocumentCreationOptions.java | 17 +- 8 files changed, 180 insertions(+), 193 deletions(-) diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/AsposeDocFactory.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/AsposeDocFactory.java index 81477068..b8b3b1dc 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/AsposeDocFactory.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/AsposeDocFactory.java @@ -56,7 +56,6 @@ * ch.ivyteam.ivy.addons.docfactory.BaseDocFactory#successMethodName * */ -@SuppressWarnings("hiding") public class AsposeDocFactory extends BaseDocFactory { private static final String EMPTY_MERGE_FIELDS_MESSAGE_CMS_PATH = "/ch/ivyteam/ivy/addons/docfactory/messages/EmptyMergeFields"; @@ -90,11 +89,11 @@ public AsposeDocFactory() { /** * Set a DocumentWorker for applying one's own logic on the produced * com.aspose.words.Document. {@link DocumentWorker} - * @param documentWorker + * @param worker * @return the AsposeDocFactory containing the given DocumentWorker. */ - public AsposeDocFactory withDocumentWorker(DocumentWorker documentWorker) { - this.documentWorker = documentWorker; + public AsposeDocFactory withDocumentWorker(DocumentWorker worker) { + this.documentWorker = worker; return this; } @@ -104,13 +103,13 @@ public AsposeDocFactory withDocumentWorker(DocumentWorker documentWorker) { * @return the DocumentWorker or null if none has been set. * */ - @SuppressWarnings("unchecked") + @SuppressWarnings("all") @Override public DocumentWorker getDocumentWorker() { - if (!(this.documentWorker instanceof DocumentWorker)) { - return null; + if (this.documentWorker instanceof DocumentWorker worker) { + return worker; } - return (DocumentWorker) this.documentWorker; + return null; } private void parseLicense() { @@ -133,22 +132,21 @@ private void parseLicense() { * java.lang.String, java.lang.String) */ @Override - public FileOperationMessage generateBlankDocument(String outputName, String outputPath, - String outputFormat) { + public FileOperationMessage generateBlankDocument(String outName, String outPath, String outFormat) { this.fileOperationMessage = new FileOperationMessage(); // we check if the given file name is valid - if (!FileUtil.isFileNameValid(outputName)) { + if (!FileUtil.isFileNameValid(outName)) { this.fileOperationMessage = FileOperationMessage .generateErrorTypeFileOperationMessage(Ivy.cms().co(INVALID_FILE_NAME_CMS_MESSAGE_PATH)); handleResponse(true); } - this.setBasicFileName(outputName); + this.setBasicFileName(outName); - setOutputPath(formatGivenPathSetToDefaultIfBlank(outputPath)); - this.setFormat(outputFormat); + setOutputPath(formatGivenPathSetToDefaultIfBlank(outPath)); + this.setFormat(outFormat); String baseDocPath = this.outputPath + this.basicFileName; - int format = getFormatPosition(outputFormat, UNSUPPORTED_FORMAT); + int format = getFormatPosition(outFormat, UNSUPPORTED_FORMAT); try { this.fileOperationMessage = getFileGenerator().exportDocumentToFile(new Document(), baseDocPath, @@ -206,10 +204,10 @@ public FileOperationMessage generateDocument(DocumentTemplate documentTemplate) * String, String, String, List) */ @Override - public FileOperationMessage generateDocument(String templatePath, String outputName, String outputPath, - String outputFormat, List mergeFields) { + public FileOperationMessage generateDocument(String templatePath, String outName, String outPath, + String outFormat, List mergeFields) { // Check the parameters - this.resetAndCheckCommonParameters(templatePath, outputName, outputPath, outputFormat, mergeFields); + this.resetAndCheckCommonParameters(templatePath, outName, outPath, outFormat, mergeFields); if (this.fileOperationMessage.isError()) { handleResponse(true); @@ -219,7 +217,7 @@ public FileOperationMessage generateDocument(String templatePath, String outputN ArrayList templateParamslist = new ArrayList<>(); templateParamslist.addAll(mergeFields); - if (outputName == null || outputName.trim().equalsIgnoreCase("")) { + if (outName == null || outName.trim().equalsIgnoreCase("")) { // if the filename was not indicated, we look if the first mergeField // Object could contain the fileName if (templateParamslist.get(0).getMergeFieldName().trim().equalsIgnoreCase(FILENAME)) { @@ -230,17 +228,17 @@ public FileOperationMessage generateDocument(String templatePath, String outputN this.outputName = DEFAULT_FILE_OUTPUT_PREFIX + System.nanoTime(); } } else { - this.outputName = outputName; + this.outputName = outName; } - if (!FileUtil.isFileNameValid(outputName)) { + if (!FileUtil.isFileNameValid(outName)) { // if the filename contains invalid characters this.fileOperationMessage = FileOperationMessage.generateErrorTypeFileOperationMessage( Ivy.cms().co(INVALID_FILE_NAME_CMS_MESSAGE_PATH)); } else { this.fileOperationMessage = FileOperationMessage.generateSuccessTypeFileOperationMessage( Ivy.cms().co("/ch/ivyteam/ivy/addons/docfactory/messages/serialLetterSuccess")); - this.setFormat(outputFormat); + this.setFormat(outFormat); try { File file = this.doMailMerge(templateParamslist); @@ -456,8 +454,8 @@ public FileOperationMessage generateDocuments(List documentTem * Method to generate one or more documents in the same destination folder
* By convention, the name of each File is given by the first * TemplateMergeField, which key name must be "filename".
- * @param outputPath : where to save the new generated File on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", or ".html" + * @param outPath : where to save the new generated File on the server + * @param outFormat : format ".doc", ".docx", ".pdf", or ".html" * @param documentsTemplateMergeFieldsList : List of List of parameters * (TemplateMergeField objects).
* Each List of TemplateMergeField objects in the primary List will @@ -469,18 +467,18 @@ public FileOperationMessage generateDocuments(List documentTem * String, String, List) */ @Override - public FileOperationMessage generateDocuments(String templatePath, String outputPath, - final String outputFormat, final List> documentsTemplateMergeFieldsList) { + public FileOperationMessage generateDocuments(String templatePath, String outPath, + final String outFormat, final List> documentsTemplateMergeFieldsList) { // series of check to see if no exceptions this.template = new java.io.File(FileUtil.formatPath(templatePath)); - if (!doCheckBeforeDocGeneration(outputFormat, documentsTemplateMergeFieldsList)) { + if (!doCheckBeforeDocGeneration(outFormat, documentsTemplateMergeFieldsList)) { return this.fileOperationMessage; } - this.setOutputPath(formatGivenPathSetToDefaultIfBlank(outputPath)); + this.setOutputPath(formatGivenPathSetToDefaultIfBlank(outPath)); - this.setFormat(outputFormat); - int format = getFormatPosition(outputFormat, PDF_FORMAT); + this.setFormat(outFormat); + int format = getFormatPosition(outFormat, PDF_FORMAT); // reset the fileOperationMessage object this.fileOperationMessage = FileOperationMessage.generateSuccessTypeFileOperationMessage(""); @@ -531,7 +529,7 @@ public FileOperationMessage generateDocuments(String templatePath, String output * By convention, the name of each destination folder is given by the second * TemplateMergeField, which key name must be "destinationPath".
* @param templatePath : where to find the template for the Merging operation - * @param outputFormat : format ".doc", ".docx", or ".html" Each List of + * @param outFormat : format ".doc", ".docx", or ".html" Each List of * TemplateMergeField objects in the primary List will be turned into * a new document. * @return The fileOperationMessage object containing the Type of the message @@ -542,15 +540,15 @@ public FileOperationMessage generateDocuments(String templatePath, String output */ @Override public FileOperationMessage generateDocumentsWithDifferentDestination(String templatePath, - final String outputFormat, + final String outFormat, final List> list) { - if (!doCheckBeforeDocGeneration(outputFormat, list)) { + if (!doCheckBeforeDocGeneration(outFormat, list)) { return this.fileOperationMessage; } - this.setFormat(outputFormat); - int format = getFormatPosition(outputFormat, PDF_FORMAT); + this.setFormat(outFormat); + int format = getFormatPosition(outFormat, PDF_FORMAT); this.fileOperationMessage = FileOperationMessage.generateSuccessTypeFileOperationMessage(""); @@ -612,12 +610,12 @@ public List generateDocumentsWithDifferentDestination(List * With this method all the letters inside the serial letter are done with the * same Template. * @param templatePath : where to find the template for the Merging operation - * @param outputName : the name of the new created letter if null or empty, we + * @param outName : the name of the new created letter if null or empty, we * try to get the first
* MergeField form the first element in the List. If it has the Key * name "filename", we take it, else we take "serialLetter". - * @param outputPath : where to save the new generated File on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", or ".html" + * @param outPath : where to save the new generated File on the server + * @param outFormat : format ".doc", ".docx", ".pdf", or ".html" * @param list : List of List of parameters (TemplateMergeField objects).
* Each List of TemplateMergeField objects in the primary List will * be turned into a new page in the final File. @@ -631,30 +629,30 @@ public List generateDocumentsWithDifferentDestination(List */ @Override public FileOperationMessage generateMultipleDocumentsInOne(String templatePath, - String outputName, String outputPath, String outputFormat, List> list) { + String outName, String outPath, String outFormat, List> list) { // template File this.template = new java.io.File(FileUtil.formatPath(templatePath)); - setOutputPath(formatGivenPathSetToDefaultIfBlank(outputPath)); + setOutputPath(formatGivenPathSetToDefaultIfBlank(outPath)); // set the format - this.setFormat(outputFormat); + this.setFormat(outFormat); // set the output name - if (outputName == null || outputName.trim().equalsIgnoreCase("") - || !FileUtil.isFileNameValid(outputName)) { + if (outName == null || outName.trim().equalsIgnoreCase("") + || !FileUtil.isFileNameValid(outName)) { // fileName parameter is invalid. We take the default name SerialLetter + // System nanoTime String this.outputName = DEFAULT_FILE_OUTPUT_PREFIX + System.nanoTime(); } else { - this.outputName = outputName; + this.outputName = outName; } // series of check to see if no exceptions -> this method checks the // template, the format and if the list is not empty - if (!doCheckBeforeDocGeneration(outputFormat, list)) { + if (!doCheckBeforeDocGeneration(outFormat, list)) { // The inputParameters are not all valid. We return the actual // fileOperationMessage with the error Message return this.fileOperationMessage; } // the input parameters are checked and valid - int format = getFormatPosition(outputFormat, UNSUPPORTED_FORMAT); + int format = getFormatPosition(outFormat, UNSUPPORTED_FORMAT); this.fileOperationMessage = FileOperationMessage.generateSuccessTypeFileOperationMessage(""); // iterator to parse all of the List, each one is a @@ -685,8 +683,8 @@ public FileOperationMessage generateMultipleDocumentsInOne(String templatePath, * String, String, List) */ @Override - public FileOperationMessage generateMultipleDocumentsInOne(String outputPath, - String outputName, String outputFormat, List documentTemplates) { + public FileOperationMessage generateMultipleDocumentsInOne(String outPath, + String outName, String outFormat, List documentTemplates) { // series of check to see if no exceptions if (documentTemplates == null || documentTemplates.isEmpty()) { // the list is empty: the FielOperationMessage Object contains the error @@ -697,17 +695,17 @@ public FileOperationMessage generateMultipleDocumentsInOne(String outputPath, return this.fileOperationMessage; } - setOutputPath(formatGivenPathSetToDefaultIfBlank(outputPath)); + setOutputPath(formatGivenPathSetToDefaultIfBlank(outPath)); // set the output name - if (outputName == null || outputName.trim().equalsIgnoreCase("") - || !FileUtil.isFileNameValid(outputName)) { + if (outName == null || outName.trim().equalsIgnoreCase("") + || !FileUtil.isFileNameValid(outName)) { // fileName parameter is invalid. We take the default name SerialLetter + // System nanoTime String this.outputName = DEFAULT_FILE_OUTPUT_PREFIX + System.nanoTime(); } else { - this.outputName = outputName; + this.outputName = outName; } - this.setFormat(outputFormat); + this.setFormat(outFormat); this.fileOperationMessage = FileOperationMessage.generateSuccessTypeFileOperationMessage(""); @@ -941,12 +939,12 @@ private int getFormatPosition(String format, int defaultFormatPositionIfNotFound /** * returns a String Array containing all the fieldNames in a document - * @param doc the aspose Word Document Object + * @param document the aspose Word Document Object * @return the ArrayList of the MergeFields */ - public String[] getTemplateFields(Document doc) { + public String[] getTemplateFields(Document document) { try { - return doc.getMailMerge().getFieldNames(); + return document.getMailMerge().getFieldNames(); } catch (Exception e) { Ivy.log().error("getTemplateFields error " + e.getMessage(), e); } @@ -1064,11 +1062,11 @@ public void setFormat(String format) { * default values. * @param templatePath the template path to check, this path cannot be null or * empty and must drives to a valid java.io.File. - * @param outputName the outputName to check, if empty or null will be set + * @param outName the outputName to check, if empty or null will be set * with a random generated name. - * @param outputPath the output path to check, if empty or null will be set to + * @param outPath the output path to check, if empty or null will be set to * "ivy_RIA_files". - * @param outputFormat the output format to check, if empty or null will be + * @param outFormat the output format to check, if empty or null will be * set with "doc" * @param mergefields the templateMergeFields parameter to check cannot be * null, may be an empty list. @@ -1078,8 +1076,8 @@ public void setFormat(String format) { * else the type will be * ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.SUCCESS_MESSAGE. */ - private FileOperationMessage resetAndCheckCommonParameters(String templatePath, String outputName, - String outputPath, String outputFormat, List mergefields) { + private FileOperationMessage resetAndCheckCommonParameters(String templatePath, String outName, + String outPath, String outFormat, List mergefields) { this.fileOperationMessage = new FileOperationMessage(); this.fileOperationMessage.emptyFileList(); @@ -1089,15 +1087,15 @@ private FileOperationMessage resetAndCheckCommonParameters(String templatePath, this.setTemplate(null); } - setOutputPath(formatGivenPathSetToDefaultIfBlank(outputPath)); - if (!doCheckBeforeDocGeneration(outputFormat, mergefields)) { + setOutputPath(formatGivenPathSetToDefaultIfBlank(outPath)); + if (!doCheckBeforeDocGeneration(outFormat, mergefields)) { return this.fileOperationMessage; } ArrayList templateParamslist = new ArrayList<>(); templateParamslist.addAll(mergefields); - if (outputName == null || outputName.trim().equalsIgnoreCase("")) { + if (outName == null || outName.trim().equalsIgnoreCase("")) { // if the filename was not indicated, we look if the first mergeField // Object could contain the fileName if (templateParamslist.get(0).getMergeFieldName().trim().equalsIgnoreCase(FILENAME)) { @@ -1108,10 +1106,10 @@ private FileOperationMessage resetAndCheckCommonParameters(String templatePath, this.outputName = DEFAULT_FILE_OUTPUT_PREFIX + System.nanoTime(); } } else { - this.outputName = outputName; + this.outputName = outName; } - if (!FileUtil.isFileNameValid(outputName)) { + if (!FileUtil.isFileNameValid(outName)) { // if the filename contains invalid characters this.fileOperationMessage.setType(ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.ERROR_MESSAGE); this.fileOperationMessage.emptyFileList(); @@ -1122,16 +1120,16 @@ private FileOperationMessage resetAndCheckCommonParameters(String templatePath, this.fileOperationMessage.setType(ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.SUCCESS_MESSAGE); this.fileOperationMessage .setMessage(Ivy.cms().co("/ch/ivyteam/ivy/addons/docfactory/messages/serialLetterSuccess")); - this.setFormat(outputFormat); + this.setFormat(outFormat); return this.fileOperationMessage; } - private String formatGivenPathSetToDefaultIfBlank(String outputPath) { - if (StringUtils.isBlank(outputPath)) { + private String formatGivenPathSetToDefaultIfBlank(String outPath) { + if (StringUtils.isBlank(outPath)) { return DEFAULT_OUTPUT_DIRECTORY_NAME + "/"; } - return FileUtil.formatPathWithEndSeparator(outputPath); + return FileUtil.formatPathWithEndSeparator(outPath); } /** @@ -1156,11 +1154,11 @@ private java.io.File makeFileWithDocument(Document document) throws Exception { @Override public FileOperationMessage generateDocumentWithRegions(String templatePath, - String outputName, String outputPath, String outputFormat, + String outName, String outPath, String outFormat, List mergeFields, Map> tablesNamesAndFieldsmap) { // Check the parameters - this.resetAndCheckCommonParameters(templatePath, outputName, outputPath, outputFormat, mergeFields); + this.resetAndCheckCommonParameters(templatePath, outName, outPath, outFormat, mergeFields); if (this.fileOperationMessage .getType() == ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.ERROR_MESSAGE) {// Check // failed @@ -1201,9 +1199,9 @@ public FileOperationMessage generateDocumentWithRegions(String templatePath, @Override public FileOperationMessage generateDocumentWithRegions(String templatePath, - String outputName, String outputPath, String outputFormat, + String outName, String outPath, String outFormat, List mergeFields, Hashtable hashtable) { - this.resetAndCheckCommonParameters(templatePath, outputName, outputPath, outputFormat, mergeFields); + this.resetAndCheckCommonParameters(templatePath, outName, outPath, outFormat, mergeFields); if (this.fileOperationMessage .getType() == ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.ERROR_MESSAGE) { handleResponse(true); @@ -1241,8 +1239,8 @@ public FileOperationMessage generateDocumentWithRegions(String templatePath, } @Override - public FileOperationMessage generateDocumentWithRegions(String templatePath, String outputName, - String outputPath, String outputFormat, List mergeFields, + public FileOperationMessage generateDocumentWithRegions(String templatePath, String outName, + String outPath, String outFormat, List mergeFields, List tablesNames, List> tablesFieldsNames, List>> tablesRowsValues) { Hashtable hashtable = new Hashtable<>(); @@ -1254,7 +1252,7 @@ public FileOperationMessage generateDocumentWithRegions(String templatePath, Str rs.addAll(tablesRowsValues.get(i)); hashtable.put(tablesNames.get(i), rs); } - this.generateDocumentWithRegions(templatePath, outputName, outputPath, outputFormat, mergeFields, + this.generateDocumentWithRegions(templatePath, outName, outPath, outFormat, mergeFields, hashtable); } catch (Exception ex) { this.fileOperationMessage.setMessage(ex.getMessage()); @@ -1266,11 +1264,11 @@ public FileOperationMessage generateDocumentWithRegions(String templatePath, Str @Override public ch.ivyteam.ivy.addons.docfactory.FileOperationMessage generateDocumentWithNestedRegions( - String templatePath, String outputName, String outputPath, - String outputFormat, List mergeFields, + String templatePath, String outName, String outPath, + String outFormat, List mergeFields, ch.ivyteam.ivy.scripting.objects.List parentDataSource, ch.ivyteam.ivy.scripting.objects.List> childrenDataSources) { - this.resetAndCheckCommonParameters(templatePath, outputName, outputPath, outputFormat, mergeFields); + this.resetAndCheckCommonParameters(templatePath, outName, outPath, outFormat, mergeFields); if (this.fileOperationMessage .getType() == ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.ERROR_MESSAGE) {// Check // failed @@ -1296,10 +1294,10 @@ public ch.ivyteam.ivy.addons.docfactory.FileOperationMessage generateDocumentWit @Override public ch.ivyteam.ivy.addons.docfactory.FileOperationMessage generateDocumentWithNestedRegions( - String templatePath, String outputName, String outputPath, - String outputFormat, List mergeFields, + String templatePath, String outName, String outPath, + String outFormat, List mergeFields, ch.ivyteam.ivy.scripting.objects.List _nestedDataSource) { - this.resetAndCheckCommonParameters(templatePath, outputName, outputPath, outputFormat, mergeFields); + this.resetAndCheckCommonParameters(templatePath, outName, outPath, outFormat, mergeFields); if (this.fileOperationMessage.isError()) { return this.fileOperationMessage; } @@ -1323,10 +1321,10 @@ public ch.ivyteam.ivy.addons.docfactory.FileOperationMessage generateDocumentWit @Override public ch.ivyteam.ivy.addons.docfactory.FileOperationMessage generateDocumentWithNestedRegions( - String templatePath, String outputName, String outputPath, - String outputFormat, List mergefields, + String templatePath, String outName, String outPath, + String outFormat, List mergefields, Tree treeDataSource) { - this.resetAndCheckCommonParameters(templatePath, outputName, outputPath, outputFormat, mergefields); + this.resetAndCheckCommonParameters(templatePath, outName, outPath, outFormat, mergefields); if (this.fileOperationMessage .getType() == ch.ivyteam.ivy.addons.docfactory.FileOperationMessage.ERROR_MESSAGE) {// Check // failed diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/BaseDocFactory.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/BaseDocFactory.java index 2acf0528..3976101a 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/BaseDocFactory.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/BaseDocFactory.java @@ -29,7 +29,6 @@ * Those methods are indicated in the xxxMethodName variables. Those * methods have to be published into the Ivy RD Interface. */ -@SuppressWarnings("hiding") public abstract class BaseDocFactory { private static final String DOCUMENT_FACTORY_IMPLEMENTATION_SYSTEM_PROPERTY = "document.factory"; @@ -41,8 +40,8 @@ public abstract class BaseDocFactory { /** */ private ResponseHandler responseHandler; - /** - * the list of supported formats. Can be different in your implementation + /** + * the list of supported formats. Can be different in your implementation */ public static final String[] SUPPORTED_OUTPUT_FORMATS = new String[] {"doc", "docx", "html", "txt", "pdf", "odt"}; @@ -88,23 +87,23 @@ public BaseDocFactory() { /** * Method to generate a blank document * @param outputName : name of the output File - * @param outputPath : where to save the new generated File on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", or ".html" + * @param outPath : where to save the new generated File on the server + * @param outFormat : format ".doc", ".docx", ".pdf", or ".html" * @return The fileOperationMessage object containing the Type of the message * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and
* the java.io.File generated in case of success, else null.
*/ - public abstract FileOperationMessage generateBlankDocument(String outputName, String outputPath, - String outputFormat); + public abstract FileOperationMessage generateBlankDocument(String outputName, String outPath, + String outFormat); /** * Method to generate one document * @param templatePath the template path that is used as the document model to * merge the fields. * @param fileName the name of the file to be generated - * @param outputPath : where to save the generated file on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", or ".html" + * @param outPath : where to save the generated file on the server + * @param outFormat : format ".doc", ".docx", ".pdf", or ".html" * @param list : List of parameters (TemplateMergeField objects). * @return The fileOperationMessage object containing the type of the message * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
@@ -112,7 +111,7 @@ public abstract FileOperationMessage generateBlankDocument(String outputName, St * the java.io.File generated in case of success, else null.
*/ public abstract FileOperationMessage generateDocument(String templatePath, String fileName, - String outputPath, String outputFormat, List list); + String outPath, String outFormat, List list); /** * Method to generate one document @@ -133,7 +132,7 @@ public abstract FileOperationMessage generateDocument(String templatePath, Strin * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and
* the java.io.File generated in case of success, else null.
- * + * * public abstract fileOperationMessage * generateDocument(List list); */ @@ -206,8 +205,8 @@ public abstract FileOperationMessage generateDocuments(List do * By convention, the name of each file is given by the first * TemplateMergeField. Its name must be "filename". * @param templatePath : where to find the template - * @param outputPath : where to save the generated File on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath : where to save the generated File on the server + * @param outFormat : format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param list : List of List of parameters (TemplateMergeField objects).
* Each List of TemplateMergeField objects in the primary List will * be turned into a new document. @@ -215,8 +214,8 @@ public abstract FileOperationMessage generateDocuments(List do * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and null File Object
*/ - public abstract FileOperationMessage generateDocuments(String templatePath, String outputPath, - String outputFormat, List> list); + public abstract FileOperationMessage generateDocuments(String templatePath, String outPath, + String outFormat, List> list); /** * Method to generate one or more documents. Each one can be saved in a @@ -226,7 +225,7 @@ public abstract FileOperationMessage generateDocuments(String templatePath, Stri * By convention, the name of each destination folder is given by the second * TemplateMergeField, which key name must be "destinationPath".
* @param templatePath : where to save the new generated File on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outFormat : format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param list : List of List of parameters (TemplateMergeField objects).
* Each List of TemplateMergeField objects in the primary List will * be turned into a new document. @@ -235,7 +234,7 @@ public abstract FileOperationMessage generateDocuments(String templatePath, Stri * the text of the message and null File Object
*/ public abstract FileOperationMessage generateDocumentsWithDifferentDestination(String templatePath, - String outputFormat, List> list); + String outFormat, List> list); /** * Method to generate one document with mail merge. Mail Merge with regions @@ -243,8 +242,8 @@ public abstract FileOperationMessage generateDocumentsWithDifferentDestination(S * @param templatePath the template path that is used as document's model for * the fields merging. * @param outputName optional String for the name of the created document - * @param outputPath optional String for the destination folder path - * @param outputFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath optional String for the destination folder path + * @param outFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param mergefields a List of * ch.ivyteam.ivy.addons.docfactory.TemplateMergeField Objects for * "normal" mail merge. @@ -256,7 +255,7 @@ public abstract FileOperationMessage generateDocumentsWithDifferentDestination(S * the text of the message and null File Object
*/ public abstract FileOperationMessage generateDocumentWithRegions(String templatePath, String outputName, - String outputPath, String outputFormat, List mergefields, + String outPath, String outFormat, List mergefields, Map> tablesNamesAndFieldsmap); /** @@ -265,8 +264,8 @@ public abstract FileOperationMessage generateDocumentWithRegions(String template * @param templatePath the template path that is used as document's model for * the fields merging. * @param outputName optional String for the name of the created document - * @param outputPath optional String for the destination folder path - * @param outputFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath optional String for the destination folder path + * @param outFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param mergefields a List of * ch.ivyteam.ivy.addons.docfactory.TemplateMergeField Objects for * "normal" mail merge. @@ -280,7 +279,7 @@ public abstract FileOperationMessage generateDocumentWithRegions(String template * the text of the message and null File Object
*/ public abstract FileOperationMessage generateDocumentWithRegions(String templatePath, String outputName, - String outputPath, String outputFormat, List mergefields, + String outPath, String outFormat, List mergefields, Hashtable hashtable); /** @@ -289,8 +288,8 @@ public abstract FileOperationMessage generateDocumentWithRegions(String template * @param templatePath the template path that is used as document's model for * the fields merging. * @param outputName optional String for the name of the created document - * @param outputPath optional String for the destination folder path - * @param outputFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath optional String for the destination folder path + * @param outFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param mergefields a List of * ch.ivyteam.ivy.addons.docfactory.TemplateMergeField Objects for * "normal" mail merge. @@ -305,7 +304,7 @@ public abstract FileOperationMessage generateDocumentWithRegions(String template * the text of the message and null File Object
*/ public abstract FileOperationMessage generateDocumentWithRegions(String templatePath, String outputName, - String outputPath, String outputFormat, List mergefields, + String outPath, String outFormat, List mergefields, List tablesNames, List> tables_fieldsNames, List>> tables_rowsValues); @@ -314,19 +313,19 @@ public abstract FileOperationMessage generateDocumentWithRegions(String template * @param templatePath the template path that is used as document model for * the merge. * @param outputName optional String for the name of the document generated - * @param outputPath optional String for the destination folder path - * @param outputFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath optional String for the destination folder path + * @param outFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param mergefields a List of * ch.ivyteam.ivy.addons.docfactory.TemplateMergeField Objects for * "normal" mail merge. - * @param childrenDataSources a List of composite objects containing the + * @param childrenDataSources a List of composite objects containing the * TemplateMergeField objects and the regions for (nested) region merge * @return The fileOperationMessage object containing the Type of the message * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and null File Object
- */ + */ public abstract FileOperationMessage generateDocumentWithNestedRegions(String templatePath, - String outputName, String outputPath, String outputFormat, List mergefields, + String outputName, String outPath, String outFormat, List mergefields, ch.ivyteam.ivy.scripting.objects.List parentDataSource, ch.ivyteam.ivy.scripting.objects.List> childrenDataSources); @@ -335,19 +334,19 @@ public abstract FileOperationMessage generateDocumentWithNestedRegions(String te * @param templatePath the template path that is used as document model for * the merge. * @param outputName optional String for the name of the document generated - * @param outputPath optional String for the destination folder path - * @param outputFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath optional String for the destination folder path + * @param outFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param mergefields a List of * ch.ivyteam.ivy.addons.docfactory.TemplateMergeField Objects for * "normal" mail merge. - * @param nestedDataSource a List of composite objects containing the + * @param nestedDataSource a List of composite objects containing the * TemplateMergeField objects for (nested) region merge * @return The fileOperationMessage object containing the Type of the message * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and null File Object
*/ public abstract FileOperationMessage generateDocumentWithNestedRegions(String templatePath, - String outputName, String outputPath, String outputFormat, List mergefields, + String outputName, String outPath, String outFormat, List mergefields, ch.ivyteam.ivy.scripting.objects.List nestedDataSource); /** @@ -355,19 +354,19 @@ public abstract FileOperationMessage generateDocumentWithNestedRegions(String te * @param templatePath the template path that is used as document model for * the merge. * @param outputName optional String for the name of the document generated - * @param outputPath optional String for the destination folder path - * @param outputFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" + * @param outPath optional String for the destination folder path + * @param outFormat format ".doc", ".docx", ".pdf", ".txt" or ".html" * @param mergefields a List of * ch.ivyteam.ivy.addons.docfactory.TemplateMergeField Objects for * "normal" mail merge. - * @param treeDataSource a Tree containing all data fields as TemplateMergeField + * @param treeDataSource a Tree containing all data fields as TemplateMergeField * objects for (nested) region merge * @return The fileOperationMessage object containing the Type of the message * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and null File Object
*/ public abstract FileOperationMessage generateDocumentWithNestedRegions(String templatePath, - String outputName, String outputPath, String outputFormat, List mergefields, + String outputName, String outPath, String outFormat, List mergefields, Tree treeDataSource); /** @@ -403,7 +402,7 @@ public abstract List generateDocumentsWithDifferentDestina * (FileHandler.SUCCESS, ERROR, INFORMATION_MESSAGE),
* the text of the message and
* the java.io.File generated in case of success, else null.
- * + * * public abstract fileOperationMessage * generateMultipleDocumentsInOne(String outputName, String * outputPath, String outputFormat,List> @@ -415,8 +414,8 @@ public abstract List generateDocumentsWithDifferentDestina * @param templatePath : the path leading to the template (document model) * used to produce the letters with mail merging * @param outputName : the name of the generated java.io.File - * @param outputPath : where to save the new generated File on the server - * @param outputFormat : format ".doc", ".docx", ".pdf", or ".html" + * @param outPath : where to save the new generated File on the server + * @param outFormat : format ".doc", ".docx", ".pdf", or ".html" * @param list : List of List of parameters (TemplateMergeField objects).
* Each List of TemplateMergeField objects in the primary List will * be turned into a new page in the final File. @@ -426,17 +425,17 @@ public abstract List generateDocumentsWithDifferentDestina * the java.io.File generated in case of success, else null.
*/ public abstract FileOperationMessage generateMultipleDocumentsInOne(String templatePath, String outputName, - String outputPath, String outputFormat, List> list); + String outPath, String outFormat, List> list); /** * Method to generate multiple documents appended in one File
* Here the template path has to be indicated into the documentTemplate * objects - * @param outputPath : where to save the new generated File on the server (can + * @param outPath : where to save the new generated File on the server (can * have a default like "ivy_RIA_files") * @param outputName : the desired Name for the document (can have a default * like "letter_nanotime") - * @param outputFormat : format ".doc" (can be the default), ".docx", .... + * @param outFormat : format ".doc" (can be the default), ".docx", .... * @param list : List DocumentTemplate Objects. Each one contains the * necessary variables for its output. * @return The fileOperationMessage object containing the Type of the message @@ -445,8 +444,8 @@ public abstract FileOperationMessage generateMultipleDocumentsInOne(String templ * the java.io.File generated in case of success, else null.
* @see DocumentTemplate */ - public abstract FileOperationMessage generateMultipleDocumentsInOne(String outputPath, String outputName, - String outputFormat, List list); + public abstract FileOperationMessage generateMultipleDocumentsInOne(String outPath, String outputName, + String outFormat, List list); /** * returns the list of the Merge Fields names in a template @@ -576,10 +575,10 @@ public static BaseDocFactory getInstance() { * Set the response handler. A ResponseHandler must implement the * handleDocFactoryResponse method accepting a {@link FileOperationMessage} * object. - * @param responseHandler + * @param handler */ - public BaseDocFactory withResponseHandler(ResponseHandler responseHandler) { - this.responseHandler = responseHandler; + public BaseDocFactory withResponseHandler(ResponseHandler handler) { + this.responseHandler = handler; return this; } @@ -593,11 +592,11 @@ protected ResponseHandler getResponsHandler() { * @deprecated Deprecated because of typo in method name. Please use * {@link #withFieldMergingCallBack(Object)} instead. Will be * removed in the future. - * @param fieldMergingCallback + * @param callback */ @Deprecated - public BaseDocFactory withFielMergingCallBack(T fieldMergingCallback) { - return this.withFieldMergingCallBack(fieldMergingCallback); + public BaseDocFactory withFielMergingCallBack(T callback) { + return this.withFieldMergingCallBack(callback); } /** @@ -608,12 +607,12 @@ public BaseDocFactory withFielMergingCallBack(T fieldMergingCallback) { * Note: at the time of the writing of this method, the default * DocFactory is based on Aspose. As there is already a default one, You don't * need to set the fieldMergingCallback unless you really need it. - * @param fieldMergingCallback + * @param callback * @return the baseDocFactory with the given fieldMergingCallback set. */ - public BaseDocFactory withFieldMergingCallBack(T fieldMergingCallback) { - API.checkNotNull(fieldMergingCallback, "fieldMergingCallback"); - this.fieldMergingCallback = fieldMergingCallback; + public BaseDocFactory withFieldMergingCallBack(T callback) { + API.checkNotNull(callback, "callback"); + this.fieldMergingCallback = callback; return this; } @@ -638,11 +637,11 @@ protected T getFieldMergingCallBack() { * For the moment, only implementations of * {@link ch.ivyteam.ivy.addons.docfactory.aspose.DocumentWorker} are * supported. Other kind of object will be ignored. - * @param documentWorker + * @param worker * @return the DocFactory with the DocumentWorker set */ - public BaseDocFactory withDocumentWorker(T documentWorker) { - this.documentWorker = documentWorker; + public BaseDocFactory withDocumentWorker(T worker) { + this.documentWorker = worker; return this; } @@ -652,9 +651,9 @@ public T getDocumentWorker() { } /** - * Allows to define exactly how the document will be cleaned after a simple - * (region-less) mail merge. Use this only if you need to change the way the - * cleanup is done after simple mail merging. By Default, the blank fields + * Allows to define exactly how the document will be cleaned after a simple + * (region-less) mail merge. Use this only if you need to change the way the + * cleanup is done after simple mail merging. By Default, the blank fields * are removed and all the lines containing only blank fields are also removed. * @param simpleMergeCleanupOption cannot be null. * @return the baseDocfactory which simpleMergeCleanupOptions are set. @@ -679,9 +678,9 @@ public abstract BaseDocFactory withSimpleMergeCleanupOption( DocumentCreationOptions documentCreationOptions = DocumentCreationOptions.getInstance(); - public BaseDocFactory withDocumentCreationOptions(DocumentCreationOptions documentCreationOptions) { - API.checkNotNull(documentCreationOptions, "documentCreationOptions"); - this.documentCreationOptions = documentCreationOptions; + public BaseDocFactory withDocumentCreationOptions(DocumentCreationOptions options) { + API.checkNotNull(options, "options"); + this.documentCreationOptions = options; return this; } } diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/DocumentTemplate.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/DocumentTemplate.java index a23b295d..eae4b225 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/DocumentTemplate.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/DocumentTemplate.java @@ -512,16 +512,15 @@ public DocumentTemplate withDocumentWorker(T documentWorker) { /** * Allows specifying a Locale for formatting the Numbers and Dates objects - * @param locale + * @param newLocale * @return The DocumenTemplate which Locale as been set. */ - @SuppressWarnings("hiding") - public DocumentTemplate useLocale(Locale locale) { - if (locale != null) { - this.locale = locale; + public DocumentTemplate useLocale(Locale newLocale) { + if (newLocale != null) { + this.locale = newLocale; } for (TemplateMergeField tmf : this.mergeFields) { - tmf.useLocaleAndResetNumberFormatAndDateFormat(locale); + tmf.useLocaleAndResetNumberFormatAndDateFormat(newLocale); } return this; } @@ -956,10 +955,9 @@ public DocumentCreationOptions getDocumentCreationOptions() { return documentCreationOptions; } - @SuppressWarnings("hiding") - public DocumentTemplate withDocumentCreationOptions(DocumentCreationOptions documentCreationOptions) { - API.checkNotNull(documentCreationOptions, "documentCreationOptions"); - this.documentCreationOptions = documentCreationOptions; + public DocumentTemplate withDocumentCreationOptions(DocumentCreationOptions options) { + API.checkNotNull(options, "options"); + this.documentCreationOptions = options; this.documentFactory.withDocumentCreationOptions(this.documentCreationOptions); return this; } diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeDocFactoryFileGenerator.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeDocFactoryFileGenerator.java index 7d42158b..39af4637 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeDocFactoryFileGenerator.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeDocFactoryFileGenerator.java @@ -40,7 +40,6 @@ * with its generateDocument methods. * */ -@SuppressWarnings("hiding") public class AsposeDocFactoryFileGenerator { private DocumentCreationOptions documentCreationOptions = DocumentCreationOptions.getInstance(); @@ -55,15 +54,14 @@ public static AsposeDocFactoryFileGenerator getInstance() { /** * The DocumentCreationOptions contains diverse options for the final file * generation (e.g should a PDF be editable ...) - * @param documentCreationOptions the DocumentCreationOptions object, cannot + * @param options the DocumentCreationOptions object, cannot * be null. * @return the AsposeDocFactoryFileGenerator object which * DocumentCreationOptions has been set. */ - public AsposeDocFactoryFileGenerator withDocumentCreationOptions( - DocumentCreationOptions documentCreationOptions) { - API.checkNotNull(documentCreationOptions, "documentCreationOptions"); - this.documentCreationOptions = documentCreationOptions; + public AsposeDocFactoryFileGenerator withDocumentCreationOptions(DocumentCreationOptions options) { + API.checkNotNull(options, "options"); + this.documentCreationOptions = options; return this; } @@ -72,14 +70,14 @@ public AsposeDocFactoryFileGenerator withDocumentCreationOptions( * this AsposeDocFactoryFileGenerator. If set the * {@link ch.ivyteam.ivy.addons.docfactory.aspose.DocumentWorker#onGeneratedFile(Document, File)} * logic will be applied after the file has been generated - * @param documentWorker the + * @param worker the * {@link ch.ivyteam.ivy.addons.docfactory.aspose.DocumentWorker} * implementation to set. Null is accepted. * @return the AsposeDocFactoryFileGenerator object which documentWorker has * been set. */ - public AsposeDocFactoryFileGenerator withDocumentWorker(DocumentWorker documentWorker) { - this.documentWorker = documentWorker; + public AsposeDocFactoryFileGenerator withDocumentWorker(DocumentWorker worker) { + this.documentWorker = worker; return this; } diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeFieldMergingCallback.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeFieldMergingCallback.java index 483d064d..d5ab94f5 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeFieldMergingCallback.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/AsposeFieldMergingCallback.java @@ -97,15 +97,13 @@ public AsposeFieldMergingCallback removeNullValuesLines(boolean removeNullValues *
    *
  • displayBooleanValuesAsCheckBox *
- * @param documentCreationOptions the DocumentCreationOptions object. If null + * @param options the DocumentCreationOptions object. If null * throws an IllegalArgumentException * @return the current AsposeFieldMergingCallback object */ - @SuppressWarnings("hiding") - public AsposeFieldMergingCallback withDocumentCreationOptions( - DocumentCreationOptions documentCreationOptions) { - API.checkNotNull(documentCreationOptions, "documentCreationOptions"); - this.documentCreationOptions = documentCreationOptions; + public AsposeFieldMergingCallback withDocumentCreationOptions(DocumentCreationOptions options) { + API.checkNotNull(options, "options"); + this.documentCreationOptions = options; return this; } diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/DocumentWorker.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/DocumentWorker.java index 7efe83d8..a2124a16 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/DocumentWorker.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/DocumentWorker.java @@ -21,9 +21,8 @@ public interface DocumentWorker { * @param document the aspose words Document upon which the mail merge will be * performed. */ - @SuppressWarnings("unused") - default void prepare(Document document) { + default void prepare(@SuppressWarnings("all") Document document) { } /** @@ -33,9 +32,7 @@ default void prepare(Document document) { * @param document the aspose words Document upon which the mail merge has * been performed. */ - @SuppressWarnings("unused") - default void postCreate(Document document) { - + default void postCreate(@SuppressWarnings("all") Document document) { } /** @@ -58,7 +55,7 @@ default void postCreate(Document document) { * the result file must exist (file.isFile() must return true). Else * the DocFactory will throw a DocumentGenerationException. */ - @SuppressWarnings("unused") + @SuppressWarnings("all") default File onGeneratedFile(Document document, File generatedFile) { return generatedFile; } diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/MailMergeDataSource.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/MailMergeDataSource.java index 6ccfc1a8..399987bd 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/MailMergeDataSource.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/aspose/MailMergeDataSource.java @@ -159,7 +159,7 @@ public MailMergeDataSource(java.util.Collection dataSourceObjects) { // makeListOfChildrenDataSourceInComposite(dataSourceObjects); } - @SuppressWarnings("unchecked") + @SuppressWarnings("all") private void makeListOfChildrenDataSourceInComposite(List dataSourceObjects) { this.nestedChildrenDatasources = List.create(MetaType.listOf(MetaType.listOf(CompositeObject.class))); for (int j = 0; j < dataSourceObjects.size(); j++) { diff --git a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/options/DocumentCreationOptions.java b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/options/DocumentCreationOptions.java index f0cf5d4e..a814c94a 100644 --- a/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/options/DocumentCreationOptions.java +++ b/doc-factory/src/ch/ivyteam/ivy/addons/docfactory/options/DocumentCreationOptions.java @@ -3,7 +3,6 @@ import ch.ivyteam.api.API; import ch.ivyteam.ivy.addons.docfactory.pdf.PdfOptions; -@SuppressWarnings("hiding") public class DocumentCreationOptions { private PdfOptions pdfOptions = PdfOptions.getInstance(); @@ -19,11 +18,11 @@ public static DocumentCreationOptions getInstance() { /** * returns the DocumentCreationOptions which {@link PdfOptions} has been set. - * @param pdfOptions the {@link PdfOptions} to set. Cannot be null. + * @param options the {@link PdfOptions} to set. Cannot be null. */ - public DocumentCreationOptions withPdfOptions(PdfOptions pdfOptions) { - API.checkNotNull(pdfOptions, "the pdfOptions"); - this.pdfOptions = pdfOptions; + public DocumentCreationOptions withPdfOptions(PdfOptions options) { + API.checkNotNull(options, "options"); + this.pdfOptions = options; return this; } @@ -48,13 +47,13 @@ public DocumentCreationOptions removeWhiteSpaceInPdfEditableFields( return this; } - public DocumentCreationOptions displayBooleanValuesAsCheckBox(boolean displayBooleanValuesAsCheckBox) { - this.displayBooleanValuesAsCheckBox = displayBooleanValuesAsCheckBox; + public DocumentCreationOptions displayBooleanValuesAsCheckBox(boolean checkbox) { + this.displayBooleanValuesAsCheckBox = checkbox; return this; } - public DocumentCreationOptions removeBlankPages(boolean removeBlankPages) { - this.removeBlankPages = removeBlankPages; + public DocumentCreationOptions removeBlankPages(boolean remove) { + this.removeBlankPages = remove; return this; }