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

templates.generic.generic.class.vm Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
#parse("${include}/generic.include.vm")
#set ( $className				="${sourceinfo.shellInterface.simpleName}Abstract")
#set ( $defaultGenericTypes=$sourceinfo.defaultGenericTypes)
$codewriter.setCurrentJavaFilename("$pkg", "${className}.java")
#set ( $IOException     =$CLASS.forName("java.io.IOException"))
#if($sourceinfo.hasRemoteResolveType)
##添加Generic引用
#addIntoImports($TOOL.getAnnotationRemoteClass())
#end
#addIntoImports($IOException)

package $pkg;
#outputImports()
import com.gitee.l0km.com4j.base.BinaryUtils;
#macro(implLocalResolvedMethod $type)
    @Override//$methodCount
    public #typeName($method.genericReturnType) $method.name (#join($method.parameters '#if($sourceinfo.needDeriveParam($method,$e))#typeName($type)#else#typeName($e.type)#end $e.name' ',')) #fillThrows($throwExceptions){
         #RETURN() ${method.name}(#join($method.parameters '#if($sourceinfo.needDeriveParam($method,$e))BinaryUtils.getBytesNotEmpty($e.name)#else$e.name#end' ','));
    }
#end

#macro(implRemoteResolvedMethod $type)
    @Override @#typeName($TOOL.getAnnotationRemoteClass())(primtiveName="$method.name",genericParam={#join($sourceinfo.getDeriveParameterNames($method) '"$e"' ',')})//$methodCount
    public #typeName($method.genericReturnType) ${method.name}By$type.simpleName (#join($method.parameters '#if($sourceinfo.needDeriveParam($method,$e))#typeName($type)#else#typeName($e.type)#end $e.name' ',')) #fillThrows($throwExceptions){
         #RETURN() ${method.name}(#join($method.parameters '$e.name' ','));
    }
#end
/**
 * 实现 {@link #typeName(${sourceinfo.shellInterface})}泛型接口
* $GENERAED_BY
* @author guyadong * */ public abstract class ${className} implements ${sourceinfo.shellInterface.simpleName}{ #set($methodCount = 0 ) #foreach ($method in $TOOL.sortBySignature($methods)) #set($methodCount= $methodCount + 1 ) @Override//$methodCount #set ($declaredExceptions = $TOOL.sortByName($method.genericExceptionTypeSet)) #set ($throwExceptions = $declaredExceptions) #set($tmp=$throwExceptions.add($IOException)) public #typeParametersDefine() #typeName($method.genericReturnType) $method.name (#join($method.parameters '#pamameterType($e) $e.name' ',')) #fillThrows($throwExceptions){ #RETURN() ${method.name}(#join($method.parameters '#if($sourceinfo.needGeneric($e))BinaryUtils.getBytesNotEmpty($e.name)#else$e.name#end' ',')); } #if($sourceinfo.getDeriveMethodAnnotation($method)) #set($deriveAnnotation=$sourceinfo.getDeriveMethodAnnotation($method)) #foreach($type in $deriveAnnotation.localResolvedTypes()) #set($methodCount= $methodCount + 1 ) #implLocalResolvedMethod($type) #end #foreach($type in $deriveAnnotation.remoteResolveTypes()) #set($methodCount= $methodCount + 1 ) #implRemoteResolvedMethod($type) #end #end #end ##删除Generic引用 #removeFromImports($TOOL.getAnnotationRemoteClass()) }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy