
org.jsonddl.generator.Options Maven / Gradle / Ivy
package org.jsonddl.generator;
/**
* Controls behaviors in the code generator.
*/
@javax.annotation.Generated(value="org.jsonddl.generator.industrial.IndustrialDialect", date="2012-01-01T21:16:59")
public interface Options extends org.jsonddl.JsonDdlObject {
/**
* The list of dialects to execute. If unset, the generator will execute all
* dialects that are found by examining the
* {@code META-INF/services/org.jsonddl.generator.Dialect} resources.
*/
java.util.List getDialects();
/**
* A hook point for providing options to dialects.
*/
java.util.Map getExtraOptions();
/**
* Indicates that the generator should expect normalized input and not the
* usual idiomatic form.
*/
java.lang.Boolean getNormalizedInput();
/**
* The namespace to use when generating output files.
*/
java.lang.String getPackageName();
public static class Builder implements org.jsonddl.JsonDdlObject.Builder, org.jsonddl.impl.Traversable, org.jsonddl.impl.Digested, Options {
private OptionsImpl obj;
public Builder() {this(new OptionsImpl());}
Builder(OptionsImpl instance) {this.obj = instance;}
public Options.Builder builder() { return this; }
public Class getDdlObjectType() { return Options.class;}
public Options.Builder newInstance() { return new Options.Builder(); }
public java.util.Map toJsonObject() { return obj.toJsonObject(); }
public byte[] computeDigest() {
byte[] digest;
org.jsonddl.impl.DigestVisitor v = new org.jsonddl.impl.DigestVisitor(); accept(v); digest = v.getDigest();
return digest;
}
public int hashCode() {
byte[] digest = computeDigest();
return (int)((digest[0] << 3) | (digest[1] << 2) | (digest[18] << 1) | digest[19]);
}
public boolean equals(Object o) {
if (o == this) { return true; }
if (!(o instanceof org.jsonddl.impl.Digested)) { return false; }
byte[] d1 = computeDigest(); byte[] d2 = ((org.jsonddl.impl.Digested)o).computeDigest();
for (int i = 0, j = d1.length; i getDialects() { return obj.Dialects; }
/**
* The list of dialects to execute. If unset, the generator will execute all
* dialects that are found by examining the
* {@code META-INF/services/org.jsonddl.generator.Dialect} resources.
*/
public void setDialects(java.util.List value) { withDialects(value);}
/**
* The list of dialects to execute. If unset, the generator will execute all
* dialects that are found by examining the
* {@code META-INF/services/org.jsonddl.generator.Dialect} resources.
*/
public Options.Builder withDialects(java.util.List value) { obj.Dialects = value;return this;}
public Options.Builder addDialects(java.lang.String element) {
if (obj.Dialects == null) { obj.Dialects = new java.util.ArrayList(); }
obj.Dialects.add(element);
return this;
}
public java.util.Map getExtraOptions() { return obj.ExtraOptions; }
/**
* A hook point for providing options to dialects.
*/
public void setExtraOptions(java.util.Map value) { withExtraOptions(value);}
/**
* A hook point for providing options to dialects.
*/
public Options.Builder withExtraOptions(java.util.Map value) { obj.ExtraOptions = value;return this;}
public Options.Builder putExtraOptions(java.lang.String key,java.lang.String value) {
if (obj.ExtraOptions == null) { obj.ExtraOptions = new java.util.LinkedHashMap(); }
obj.ExtraOptions.put(key, value);
return this;
}
public java.lang.Boolean getNormalizedInput() { return obj.NormalizedInput; }
/**
* Indicates that the generator should expect normalized input and not the
* usual idiomatic form.
*/
public void setNormalizedInput(java.lang.Boolean value) { withNormalizedInput(value);}
/**
* Indicates that the generator should expect normalized input and not the
* usual idiomatic form.
*/
public Options.Builder withNormalizedInput(java.lang.Boolean value) { obj.NormalizedInput = value;return this;}
public java.lang.String getPackageName() { return obj.PackageName; }
/**
* The namespace to use when generating output files.
*/
public void setPackageName(java.lang.String value) { withPackageName(value);}
/**
* The namespace to use when generating output files.
*/
public Options.Builder withPackageName(java.lang.String value) { obj.PackageName = value;return this;}
public Options.Builder accept(org.jsonddl.JsonDdlVisitor visitor) {
obj = new org.jsonddl.impl.ContextImpl.ObjectContext.Builder().withValue(this).withKind(org.jsonddl.model.Kind.DDL).withMutability(true).build().traverse(visitor).builder().obj;
return this;
}
public Options build() {
OptionsImpl toReturn = obj;
obj = null;
toReturn.Dialects = org.jsonddl.impl.Protected.object(toReturn.Dialects);
toReturn.ExtraOptions = org.jsonddl.impl.Protected.object(toReturn.ExtraOptions);
return toReturn;
}
public Options.Builder from(Options from) {
withDialects(from.getDialects());
withExtraOptions(from.getExtraOptions());
withNormalizedInput(from.getNormalizedInput());
withPackageName(from.getPackageName());
return this;}
public Options.Builder from(java.util.Map map){
accept(org.jsonddl.impl.JsonMapVisitor.fromJsonMap(map));
return this;
}
public Options.Builder traverse(org.jsonddl.JsonDdlVisitor visitor) {
withDialects(
new org.jsonddl.impl.ContextImpl.ValueContext.Builder>()
.withKind(org.jsonddl.model.Kind.LIST)
.withNestedKinds(java.util.Arrays.asList(org.jsonddl.model.Kind.STRING))
.withLeafType(java.lang.String.class)
.withMutability(true)
.withProperty("dialects")
.withValue(obj.Dialects)
.build().traverse(visitor));
withExtraOptions(
new org.jsonddl.impl.ContextImpl.ValueContext.Builder>()
.withKind(org.jsonddl.model.Kind.MAP)
.withNestedKinds(java.util.Arrays.asList(org.jsonddl.model.Kind.STRING, org.jsonddl.model.Kind.STRING))
.withLeafType(java.lang.String.class)
.withMutability(true)
.withProperty("extraOptions")
.withValue(obj.ExtraOptions)
.build().traverse(visitor));
withNormalizedInput(
new org.jsonddl.impl.ContextImpl.ValueContext.Builder()
.withKind(org.jsonddl.model.Kind.BOOLEAN)
.withLeafType(java.lang.Boolean.class)
.withMutability(true)
.withProperty("normalizedInput")
.withValue(obj.NormalizedInput)
.build().traverse(visitor));
withPackageName(
new org.jsonddl.impl.ContextImpl.ValueContext.Builder()
.withKind(org.jsonddl.model.Kind.STRING)
.withLeafType(java.lang.String.class)
.withMutability(true)
.withProperty("packageName")
.withValue(obj.PackageName)
.build().traverse(visitor));
return this;
}
}
Builder builder();
Builder newInstance();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy