org.jomc.tools.templates.jomc-java.Implementation.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jomc-tools Show documentation
Show all versions of jomc-tools Show documentation
Object management and configuration tools.
##
## Copyright (C) Christian Schulte , 2005-206
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## are met:
##
## o Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
##
## o Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimer in
## the documentation and/or other materials provided with the
## distribution.
##
## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
## INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
## AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
## INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
## THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
##
## $JOMC: Implementation.java.vm 5043 2015-05-27 07:03:39Z schulte $
##
## @param model The model declaring the modules of the implementation to render.
## @param modules The modules declaring the implementation to render.
## @param imodel The inheritance model of the modules declaring the implementation to render.
## @param smodel The source file model to render.
## @param implementation The implementation to render.
## @param tool The tool merging the template.
## @param toolName The name of the tool merging the template.
## @param toolVersion The version of the tool merging the template.
## @param toolUrl The URL to the site of the tool merging the template.
## @param calendar A java.util.Calendar instance.
## @param now The current timestamp formatted using the pattern "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
## @param year The current year formatted using the pattern "yyyy".
## @param month The current month formatted using the pattern "MM".
## @param day The current day formatted using the pattern "dd".
## @param hour The current hour formatted using the pattern "HH".
## @param minute The current minute formatted using the pattern "mm".
## @param second The current second formatted using the pattern "ss".
## @param timezone The current timezone formatted using the pattern "Z".
## @param shortDate The current date formatted using a 'SHORT' format style.
## @param mediumDate The current date formatted using a 'MEDIUM' format style.
## @param longDate The current date formatted using a 'LONG' format style.
## @param isoDate The current date formatted using an ISO-8601 format style.
## @param shortTime The current time formatted using a 'SHORT' format style.
## @param mediumTime The current time formatted using a 'MEDIUM' format style.
## @param longTime The current time formatted using a 'LONG' format style.
## @param isoTime The current time formatted using an ISO-8601 format style.
## @param shortDateTime The current date and time formatted using a 'SHORT' format style.
## @param mediumDateTime The current date and time formatted using a 'MEDIUM' format style.
## @param longDateTime The current date and time formatted using a 'LONG' format style.
## @param isoDateTime The current date and time formatted using an ISO-8601 format style.
${tool.getIndentation(0)}${smodel.getHeadComment()} SECTION-START[License Header]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(0)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
#if(!$implementation.getJavaTypeName().isUnnamedPackage())
${tool.getIndentation(0)}package ${implementation.getJavaTypeName().getPackageName()};
#end
${tool.getIndentation(0)}import java.lang.*;
${tool.getIndentation(0)}${smodel.getHeadComment()} SECTION-START[Documentation]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(0)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(0)}${smodel.getHeadComment()} SECTION-START[Annotations]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(0)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(0)}public#if($implementation.isAbstract()) abstract#end class ${implementation.getJavaTypeName().getName(false)}
#set($interfaces = $modules.getImplementedJavaTypeNames($implementation.getIdentifier()))
#if($interfaces)
${tool.getIndentation(1)}implements
#set($i = $interfaces.size())
#foreach($interface in $interfaces)
#set($i = $i - 1)
${tool.getIndentation(1)}$interface.getName(true)#if($i > 0),#end
#end
#end
${tool.getIndentation(0)}{
#if($interfaces)
#foreach($interface in $interfaces)
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-START[$interface.getName(false)]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
#end
#end
#if(!$interfaces || !$interfaces.contains($implementation.getJavaTypeName()))
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-START[${implementation.getJavaTypeName().getName(false)}]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-START[Constructors]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(2)}${smodel.getHeadComment()} SECTION-START[Default Constructor]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(2)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-START[Dependencies]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-START[Properties]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-START[Messages]#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(1)}${smodel.getHeadComment()} SECTION-END#if(${smodel.getTailComment()} && ${smodel.getTailComment().length()} > 0) ${smodel.getTailComment()}#end
${tool.getIndentation(0)}}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy