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

templates.java.InterfaceImpl.vsl Maven / Gradle / Ivy

Go to download

Produces generic Java code, such as: value objects, enumerations, exceptions, interfaces, etc.

The newest version!
#if ($umlUtils.shouldOutput($interface))
#set ($className = $interface.interfaceImplementationName)
#set ($generatedFile = "${className}.java")
// license-header java merge-point
/* Autogenerated by AndroMDA Java cartridge (InterfaceImpl.vsl) - do not edit */
#if ($stringUtils.isNotBlank($interface.packageName))
package $interface.packageName;
#set ($generatedFile = "${stringUtils.replace($interface.packageName,'.','/')}/${generatedFile}")
#end

/**
 * The default implementation of {@link $interface.name}
 */
public#if ($interface.abstractInterfaceImplementation) abstract#end class $className
    implements $interface.name
{

#if ($serializable)
    /** The serial version UID of this class. Needed for serialization. */
    private static final long serialVersionUID = ${interface.serialVersionUID}L;

#end
#foreach($attribute in $interface.getAttributes(true))
#if ($attribute.visibility == "public")
#if (!$attribute.static)
    private $attribute.getterSetterTypeName $attribute.name#if ($attribute.defaultValuePresent) = $attribute.defaultValue#end;

    /**
     * @see ${interface.fullyQualifiedName}${esc.hash}${attribute.getterName}()
     */
    public $attribute.getterSetterTypeName ${attribute.getterName}()
    {
        return this.${attribute.name};
    }

## - always generate setter on impl (so that the value can be populated
    /**
#if (!$attribute.readOnly)
     * @see ${interface.fullyQualifiedName}${esc.hash}${attribute.setterName}($attribute.getterSetterTypeName)
#else
$attribute.getDocumentation("     * ")
     * @param ${attribute.name}In $attribute.getterSetterTypeName
#if($generateChainedSetters)
     * @return this $className
#end
#end
     */
    public#if($generateChainedSetters) $className#else void#end ${attribute.setterName}($attribute.getterSetterTypeName ${attribute.name}In)
    {
        this.${attribute.name} = ${attribute.name}In;
#if($generateChainedSetters)
        return this;
#end
    }

#end
#end
#end
#foreach ($associationEnd in $interface.getNavigableConnectingEnds(true))
    private $associationEnd.getterSetterTypeName $associationEnd.name;

    /**
     * @see ${interface.fullyQualifiedName}${esc.hash}${associationEnd.getterName}()
     */
    public $associationEnd.getterSetterTypeName ${associationEnd.getterName}()
    {
        return this.${associationEnd.name};
    }

## - always generate setter on impl (so that the value can be populated)
    /**
#if (!$associationEnd.readOnly)
     * @see ${interface.fullyQualifiedName}${esc.hash}${associationEnd.setterName}($associationEnd.getterSetterTypeName)
#else
$associationEnd.getDocumentation("     * ")
     * @param ${associationEnd.name}In $associationEnd.getterSetterTypeName
#if($generateChainedSetters)
     * @return this ${class.name}
#end
#end
     */
    public#if($generateChainedSetters) $className#else void#end ${associationEnd.setterName}($associationEnd.getterSetterTypeName ${associationEnd.name}In)
    {
        this.${associationEnd.name} = ${associationEnd.name}In;
#if($generateChainedSetters)
        return this;
#end
    }

#end
#foreach ($operation in $interface.operations)
#if ($operation.visibility == "public")
    /**
     * @see ${interface.fullyQualifiedName}${esc.hash}${operation.getSignature(false)}
     */
#if ($operation.exceptionsPresent)
    public abstract $operation.getterSetterReturnTypeName $operation.signature
        throws $operation.exceptionList;
#else
    public abstract $operation.getterSetterReturnTypeName $operation.signature;
#end

#end
#end
}
#end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy