java method方法_Java Method.getTypeParameters方法代碼示例
import java.lang.reflect.Method; //導入方法依賴的package包/類
private void validateRuleMethod(MethodRuleDefinition, ?> ruleDefinition, Method ruleMethod, RuleSourceValidationProblemCollector problems) {
if (Modifier.isPrivate(ruleMethod.getModifiers())) {
problems.add(ruleMethod, "A rule method cannot be private");
}
if (Modifier.isAbstract(ruleMethod.getModifiers())) {
problems.add(ruleMethod, "A rule method cannot be abstract");
}
if (ruleMethod.getTypeParameters().length > 0) {
problems.add(ruleMethod, "Cannot have type variables (i.e. cannot be a generic method)");
}
// TODO validations on method: synthetic, bridge methods, varargs, abstract, native
ModelType> returnType = ModelType.returnType(ruleMethod);
if (returnType.isRawClassOfParameterizedType()) {
problems.add(ruleMethod, "Raw type " + returnType + " used for return type (all type parameters must be specified of parameterized type)");
}
for (int i = 0; i < ruleDefinition.getReferences().size(); i++) {
ModelReference> reference = ruleDefinition.getReferences().get(i);
if (reference.getType().isRawClassOfParameterizedType()) {
problems.add(ruleMethod, "Raw type " + reference.getType() + " used for parameter " + (i + 1) + " (all type parameters must be specified of parameterized type)");
}
if (reference.getPath() != null) {
try {
ModelPath.validatePath(reference.getPath().getPath());
} catch (Exception e) {
problems.add(ruleDefinition, "The declared model element path '" + reference.getPath().getPath() + "' used for parameter " + (i + 1) + " is not a valid path", e);
}
}
}
}
java method方法_Java Method.getTypeParameters方法代碼示例相关推荐
- java try finally connectoin close_Java SocketChannel類代碼示例
本文整理匯總了Java中io.netty.channel.socket.SocketChannel類的典型用法代碼示例.如果您正苦於以下問題:Java SocketChannel類的具體用法?Java ...
- java file.canexecute_Java File canExecute()用法及代碼示例
canExecute()函數是Java中File類的一部分.此函數確定程序是否可以執行由抽象路徑名表示的指定文件.如果文件路徑存在並且允許應用程序執行文件,則此方法將返回true.否則它將返回fals ...
- java中getfield_Java Class getField()用法及代碼示例
java.lang.Class類的getField()方法用於獲取此類的指定字段,該字段是公共字段及其成員.該方法以Field對象的形式返回此類的指定字段. 用法: public Field getF ...
- java bidi_Java Bidi類代碼示例
本文整理匯總了Java中java.text.Bidi類的典型用法代碼示例.如果您正苦於以下問題:Java Bidi類的具體用法?Java Bidi怎麽用?Java Bidi使用的例子?那麽恭喜您, 這 ...
- java中reject方法作用_Java BindingResult.rejectValue方法代碼示例
本文整理匯總了Java中org.springframework.validation.BindingResult.rejectValue方法的典型用法代碼示例.如果您正苦於以下問題:Java Bind ...
- java fileitem 识别图片大小_Java FileItem.getSize方法代碼示例
本文整理匯總了Java中org.apache.commons.fileupload.FileItem.getSize方法的典型用法代碼示例.如果您正苦於以下問題:Java FileItem.getSi ...
- java touch创建文件_Java FileUtils.touch方法代碼示例
本文整理匯總了Java中org.apache.commons.io.FileUtils.touch方法的典型用法代碼示例.如果您正苦於以下問題:Java FileUtils.touch方法的具體用法? ...
- java使用drawtext重叠_Java Graphics.drawText方法代碼示例
本文整理匯總了Java中org.eclipse.draw2d.Graphics.drawText方法的典型用法代碼示例.如果您正苦於以下問題:Java Graphics.drawText方法的具體用法 ...
- java getitem方法_Java Datasource.getItem方法代碼示例
本文整理匯總了Java中com.haulmont.cuba.gui.data.Datasource.getItem方法的典型用法代碼示例.如果您正苦於以下問題:Java Datasource.getI ...
- java nio keyiterator.remove()_Java SelectionKey.isValid方法代碼示例
本文整理匯總了Java中java.nio.channels.SelectionKey.isValid方法的典型用法代碼示例.如果您正苦於以下問題:Java SelectionKey.isValid方法 ...
最新文章
- Winform中导出Excel数据量百万级的处理办法-导出为csv文件
- 第八十八期:4000万程序员最爱开源项目和编程语言排名出炉!
- JBPM4.4整合SSH2项目
- oracle 客户端连接数_转载:查看Oracle连接数
- 开发一款浏览器内核需要学习哪些方面的知识?
- bzoj 1055: [HAOI2008]玩具取名(区间DP)
- c语言 异或_C语言位逻辑运算符的四种逻辑:取反,并,或,异或
- Litestar 4D:道路照明
- [渝粤教育] 武汉大学 自然科学经典导引 参考 资料
- 网易发起“疾风”智造IoT联盟,深化“互联网+先进制造业”发展
- 应对Flash中国版流氓后台偷窥的解决方法
- 二项式定理学习笔记(详解)
- xls与csv文件区别
- 数字化时代:电梯广告的喜与忧
- 配色工具Material Design
- 微信小程序踩坑-Cookie登陆失败
- 键盘Ctrl键坏了,用注册表来修
- SharpDevelop学习笔记(4)——SharpDevelop的核心
- 反色(顺序)C C++
- 虚拟机服务器校园网访问设置,配置VMware虚拟机用绕过校园网达到无线上网配置方法...
热门文章
- JBoss BRMS 5.3 –添加了业务活动监视(BAM)报告
- Solr:创建拼写检查器
- idea连接mysql数据库时连接显示错误caching_sha2_password
- python排序sorted_sorted排序的两个方法 - Python
- java velocity详解_[velocity] velocity详解
- 【WebRTC---入门篇】(十六)端对端1V1传输基本流程
- background 互联网图片_cssbackground-image和layer-background-image的区别
- 骚操作:利用强弱符号制作插件库
- a标签跳到另一个页面指定选项卡_HTML常用标签
- java8方法引用符合_Java8 方法引用和构造方法引用