com.regnosys.rosetta.translate.TranslatorOptionsImpl Maven / Gradle / Ivy
package com.regnosys.rosetta.translate;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import java.util.StringJoiner;
public class TranslatorOptionsImpl implements TranslatorOptions {
private final String name;
private final Optional modelId;
private final Collection modelClasspath;
private final String modelFileDirIncludeRegex;
private final Optional modelFileDirExcludeRegex;
private final Collection rosettaClasses;
private final String generatedPackage;
private final String generatedFactoryName;
private final Map xsdFilePaths;
private final Multimap synonymSources;
private final Multimap topLevelTags;
private final Map childPackageName;
private final Map fullClassnames;
private final boolean verbose;
private final boolean clean;
private final boolean json;
private final String xmlExclusionsFilePath;
private final String cdmClassesDir;
private final Multimap integrationTestRoots;
private final boolean isDefault;
private final boolean isCoreIgnored;
private final boolean preProcessJson;
@JsonCreator
public TranslatorOptionsImpl(@JsonProperty("name") String name, @JsonProperty("modelId") Optional modelId, @JsonProperty("modelClasspath") Collection modelClasspath,
@JsonProperty("modelFileDirIncludeRegex") String modelFileDirIncludeRegex, @JsonProperty("modelFileDirExcludeRegex") Optional modelFileDirExcludeRegex,
@JsonProperty("rosettaClasses") Collection rosettaClasses, @JsonProperty("generatedPackage") String generatedPackage, @JsonProperty("generatedFactoryName") String generatedFactoryName,
@JsonProperty("xsdFilePaths") Map xsdFilePaths,
@JsonProperty("synonymSources") Multimap synonymSources, @JsonProperty("topLevelTags") Multimap topLevelTags,
@JsonProperty("childPackageNames") Map childPackageNames, @JsonProperty("verbose") boolean verbose,
@JsonProperty("clean") boolean clean, @JsonProperty("json") boolean json,
@JsonProperty(value = "preProcessJson", defaultValue = "false") boolean preProcessJson,
@JsonProperty("xmlExclusionsFilePath") String xmlExclusionsFilePath,
@JsonProperty("cdmClassesDir") String cdmClassesDir,
@JsonProperty("integrationTestRoots") Multimap integrationTestRoots,
@JsonProperty("default") boolean isDefault, @JsonProperty("fullClassNames") Map fullClassNames,
@JsonProperty("coreIgnored") boolean coreIgnored) {
this.name = name;
this.modelId = modelId;
this.modelClasspath = modelClasspath;
this.modelFileDirIncludeRegex = modelFileDirIncludeRegex;
this.modelFileDirExcludeRegex = modelFileDirExcludeRegex;
this.rosettaClasses = rosettaClasses;
this.generatedPackage = generatedPackage;
this.generatedFactoryName = generatedFactoryName;
this.xsdFilePaths = xsdFilePaths;
this.synonymSources = synonymSources;
this.topLevelTags = topLevelTags;
this.childPackageName = childPackageNames;
this.verbose = verbose;
this.clean = clean;
this.json = json;
this.preProcessJson = preProcessJson;
this.xmlExclusionsFilePath = xmlExclusionsFilePath;
this.cdmClassesDir = cdmClassesDir;
this.integrationTestRoots = integrationTestRoots;
this.isDefault = isDefault;
fullClassnames = fullClassNames;
isCoreIgnored = coreIgnored;
}
@Override
public String getName() {
return name;
}
@Override
public Optional getModelId() {
return modelId;
}
@Override
public Collection getModelClasspath() {
return modelClasspath;
}
@Override
public String getModelFileDirIncludeRegex() {
return modelFileDirIncludeRegex;
}
@Override
public Optional getModelFileDirExcludeRegex() {
return modelFileDirExcludeRegex;
}
@Override
public Collection getRosettaClasses() {
return rosettaClasses;
}
@Override
public String getGeneratedPackage() {
return generatedPackage;
}
@Override
public String getXsdFilePath(String rosettaClassName) {
return xsdFilePaths.get(rosettaClassName);
}
@Override
public String getXmlExclusionsFilePath() {
return xmlExclusionsFilePath;
}
@Override
public Collection getSynonymSources(String rosettaClassName) {
return synonymSources.get(rosettaClassName);
}
@Override
public Collection getTopLevelTags(String rosettaClassName) {
return topLevelTags.get(rosettaClassName);
}
@Override
public String getGeneratedFactoryName() {
return generatedFactoryName;
}
@Override
public String getChildPackageName(String rosettaClassName) {
return childPackageName.get(rosettaClassName);
}
@Override
public boolean isVerbose() {
return verbose;
}
@Override
public boolean clean() {
return clean;
}
@Override
public boolean isJson() {
return json;
}
@Override
public boolean isCoreIgnored() {
return isCoreIgnored;
}
@Override
public String getCdmClassesDir() {
return cdmClassesDir;
}
@Override
public Collection getIntegrationTestRoots(String rosettaClassName) {
return integrationTestRoots.get(rosettaClassName);
}
@Override
public String getFullClassname(String rosettaClassName) {
return fullClassnames.get(rosettaClassName);
}
public boolean isDefault() {
return isDefault;
}
public Map getXsdFilePaths() {
return xsdFilePaths;
}
public Multimap getSynonymSources() {
return synonymSources;
}
public Multimap getTopLevelTags() {
return topLevelTags;
}
public Map getChildPackageName() {
return childPackageName;
}
public boolean isClean() {
return clean;
}
public Multimap getIntegrationTestRoots() {
return integrationTestRoots;
}
public Map getFullClassnames() {
return fullClassnames;
}
@Override
public boolean preProcessJson() {
return preProcessJson;
}
@Override
public String toString() {
return new StringJoiner(", ", TranslatorOptionsImpl.class.getSimpleName() + "[", "]")
.add("name='" + name + "'")
.add("modelId='" + modelId + "'")
.add("modelClasspath=" + modelClasspath)
.add("modelFileDirIncludeRegex='" + modelFileDirIncludeRegex + "'")
.add("modelFileDirExcludeRegex=" + modelFileDirExcludeRegex)
.add("rosettaClasses=" + rosettaClasses)
.add("generatedPackage='" + generatedPackage + "'")
.add("generatedFactoryName='" + generatedFactoryName + "'")
.add("xsdFilePaths=" + xsdFilePaths)
.add("synonymSources=" + synonymSources)
.add("topLevelTags=" + topLevelTags)
.add("childPackageName=" + childPackageName)
.add("verbose=" + verbose)
.add("clean=" + clean)
.add("json=" + json)
.add("xmlExclusionsFilePath='" + xmlExclusionsFilePath + "'")
.add("cdmClassesDir='" + cdmClassesDir + "'")
.add("integrationTestRoots=" + integrationTestRoots + " ")
.add("isDefault=" + isDefault)
.toString();
}
}