All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.regnosys.rosetta.translate.TranslatorOptionsBuilder Maven / Gradle / Ivy
package com.regnosys.rosetta.translate;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import java.util.*;
import java.util.stream.Collectors;
@Deprecated //- json files in the models are now the source of this data
public class TranslatorOptionsBuilder {
private String name;
private Optional modelId;
private Collection modelClasspath = new ArrayList<>();
private String modelFileDirIncludeRegex;
private Optional modelFileDirExcludeRegex = Optional.empty();
private Collection rosettaClasses = new ArrayList<>();
private String generatedPackage;
private String generatedFactoryName;
private Map xsdFilePaths = new HashMap<>();
private Multimap synonymSources = ArrayListMultimap.create();
private Multimap topLevelTags = ArrayListMultimap.create();
private Map childPackageNames = new HashMap<>();
private boolean verbose = false;
private boolean clean = false;
private boolean json = false;
private String xmlExclusionsFilePath;
private String cdmClassesDir = "";
private Multimap integrationTestRoots = ArrayListMultimap.create();
public static TranslatorOptionsBuilder newBuilder() {
return new TranslatorOptionsBuilder();
}
public TranslatorOptionsBuilder withName(String name) {
this.name = name;
return this;
}
public TranslatorOptionsBuilder withModelId(String modelId) {
this.modelId = Optional.of(modelId);
return this;
}
public TranslatorOptionsBuilder withModelClasspath(String... modelClasspath) {
this.modelClasspath.addAll(Arrays.asList(modelClasspath));
return this;
}
public TranslatorOptionsBuilder withModelFileDirIncludeRegex(String modelFileDirIncludeRegex) {
this.modelFileDirIncludeRegex = modelFileDirIncludeRegex;
return this;
}
public TranslatorOptionsBuilder withModelFileDirExcludeRegex(String modelFileDirExcludeRegex) {
this.modelFileDirExcludeRegex = Optional.of(modelFileDirExcludeRegex);
return this;
}
public TranslatorOptionsBuilder withRosettaClass(String rosettaClass) {
this.rosettaClasses.addAll(Arrays.asList(rosettaClass));
return this;
}
public TranslatorOptionsBuilder withGeneratedPackage(String generatedPackage) {
this.generatedPackage = generatedPackage;
return this;
}
public TranslatorOptionsBuilder withGeneratedFactoryName(String generatedFactoryName) {
this.generatedFactoryName = generatedFactoryName;
return this;
}
public TranslatorOptionsBuilder withXsdFilePath(String rosettaClass, String xsdFilePath) {
this.xsdFilePaths.put(rosettaClass, xsdFilePath);
return this;
}
public TranslatorOptionsBuilder withSynonymSources(String rosettaClass, String... synonymSources) {
for (String synonymSource : synonymSources) {
this.synonymSources.put(rosettaClass, synonymSource);
}
return this;
}
public TranslatorOptionsBuilder withTopLevelTags(String rosettaClass, String... topLevelTags) {
for (String topLevelTag : topLevelTags) {
this.topLevelTags.put(rosettaClass, topLevelTag);
}
return this;
}
public TranslatorOptionsBuilder withChildPackageNames(String rosettaClass, String childPackageName) {
this.childPackageNames.put(rosettaClass, childPackageName);
return this;
}
public TranslatorOptionsBuilder withVerboseCompiler(String verbose) {
this.verbose = Boolean.valueOf(verbose);
return this;
}
public TranslatorOptionsBuilder withClean(boolean clean) {
this.clean = clean;
return this;
}
public TranslatorOptionsBuilder withJson(boolean json) {
this.json = json;
return this;
}
public TranslatorOptionsBuilder withXmlExclusionsFilePath(String xmlExclusionsFilePath) {
this.xmlExclusionsFilePath = xmlExclusionsFilePath;
return this;
}
public TranslatorOptionsBuilder withCdmClassesDir(String cdmClassesDir) {
this.cdmClassesDir = cdmClassesDir;
return this;
}
public TranslatorOptionsBuilder withIntegrationTestRoot(String rosettaClass, String integrationTestRoot) {
this.integrationTestRoots.put(rosettaClass, integrationTestRoot);
return this;
}
public TranslatorOptions build() {
return new TranslatorOptionsImpl(name, modelId, modelClasspath, modelFileDirIncludeRegex,
modelFileDirExcludeRegex, rosettaClasses, generatedPackage, generatedFactoryName,
xsdFilePaths, synonymSources, topLevelTags, childPackageNames, verbose, clean, json, false, xmlExclusionsFilePath, cdmClassesDir,
integrationTestRoots, false, rosettaClasses.stream().collect(Collectors.toMap(c -> c, c -> generatedPackage)), false);
}
}