All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.dmn2java.common.itemDefinitionClass.ftl Maven / Gradle / Ivy

There is a newer version: 8.7.3
Show newest version
<#if javaPackageName?has_content>
package ${javaPackageName};


import java.util.*;

@javax.annotation.Generated(value = {"itemDefinition.ftl", "${modelRepository.name(itemDefinition)}"})
@com.fasterxml.jackson.annotation.JsonPropertyOrder(alphabetic = true)
public class ${javaClassName} implements ${transformer.itemDefinitionJavaInterfaceName(javaClassName)} {
    <@addFields itemDefinition />

    public ${javaClassName}() {
    }

    public ${javaClassName}(${transformer.itemDefinitionSignature(itemDefinition)}) {
    <@addAssigmentForFields itemDefinition />
    }

    <@addAccessors itemDefinition />
    <@addEqualsAndHashCode itemDefinition />
    <@addToString itemDefinition />
}
<#macro addFields itemDefinition>
    <#list itemDefinition.itemComponent as child>
        <#assign memberName = transformer.itemDefinitionVariableName(child)/>
        <#assign memberType = transformer.itemDefinitionTypeName(child)/>
        private ${memberType} ${memberName};
    


<#macro addAssigmentForFields itemDefinition>
    <#list itemDefinition.itemComponent as child>
        this.${transformer.setter(child)}(${transformer.itemDefinitionVariableName(child)});
    


<#macro addAccessors itemDefinition>
    <#list itemDefinition.itemComponent as child>
        <#assign memberName = transformer.itemDefinitionVariableName(child)/>
        <#assign memberType = transformer.itemDefinitionTypeName(child)/>
    @com.fasterxml.jackson.annotation.JsonGetter("${transformer.escapeInString(modelRepository.displayName(child))}")
    public ${memberType} ${transformer.getter(child)} {
        return this.${memberName};
    }

    @com.fasterxml.jackson.annotation.JsonSetter("${transformer.escapeInString(modelRepository.displayName(child))}")
    public void ${transformer.setter(child)}(${memberType} ${memberName}) {
        this.${memberName} = ${memberName};
    }

    


<#macro addEqualsAndHashCode itemDefinition >
    @Override
    public boolean equals(Object o) {
        return equalTo(o);
    }

    @Override
    public int hashCode() {
        return hash();
    }



<#macro addToString itemDefinition>
    @Override
    public String toString() {
        return asString();
    }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy