Java-Null-pointer-checker:输入对象不再导致 java 空指针异常

上传者: 42123296 | 上传时间: 2022-05-11 18:18:49 | 文件大小: 36KB | 文件类型: ZIP
Java 空指针检查器 输入复杂对象不再导致 java 空指针异常 这个怎么运作: 使用 Java 反射,我们构造了包含所有字段的对象图(如果类扩展了父类,则继承)。 我们使用深度优先搜索遍历,应用模板和访问者设计模式,我们定义在访问每个不同类型的属性(对象图的节点)时要执行的特定操作。 此实用程序检测循环并防止无限处理,因此可能有一个包含属性 B 的对象 A 包含另一个属性 A (A->B->C->A) 易于扩展,只需扩展 FunctorIF,并实现处理每个属性类型所需的任何逻辑,遍历器将相应地调用访问和处理方法 定义: 原始对象:一个不包含其他对象的简单对象,在 Java 中它可以是 String、Integer、BigDecimal、Date、Double、Boolean、... 复杂对象:包含任意数量属性的对象,这些属性可以是原始对象或集合(现在是列表),和/或另一个复杂

文件下载

资源详情

[{"title":"( 34 个子文件 36KB ) Java-Null-pointer-checker:输入对象不再导致 java 空指针异常","children":[{"title":"Java-Null-pointer-checker-master","children":[{"title":".gitignore <span style='color:#111;'> 196B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"main","children":[{"title":"java","children":[{"title":"com","children":[{"title":"mrfawy","children":[{"title":"npc","children":[{"title":"populator","children":[{"title":"ComplexNullifyPopulator.java <span style='color:#111;'> 3.39KB </span>","children":null,"spread":false},{"title":"PrimitiveNullifyPopulator.java <span style='color:#111;'> 1016B </span>","children":null,"spread":false},{"title":"DefaultValuePopulator.java <span style='color:#111;'> 698B </span>","children":null,"spread":false},{"title":"BlankPopulator.java <span style='color:#111;'> 890B </span>","children":null,"spread":false}],"spread":true},{"title":"nullify","children":[{"title":"PrimitiveNullifyFunctor.java <span style='color:#111;'> 2.66KB </span>","children":null,"spread":false},{"title":"ComplexCountFunctor.java <span style='color:#111;'> 883B </span>","children":null,"spread":false},{"title":"PrimitiveCounterFunctor.java <span style='color:#111;'> 1.62KB </span>","children":null,"spread":false},{"title":"NullifyObjectAtIndexFunctor.java <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"PrimitiveCounter.java <span style='color:#111;'> 1.46KB </span>","children":null,"spread":false}],"spread":true},{"title":"App.java <span style='color:#111;'> 2.22KB </span>","children":null,"spread":false},{"title":"objects","children":[{"title":"TestObjB.java <span style='color:#111;'> 656B </span>","children":null,"spread":false},{"title":"TestObjC.java <span style='color:#111;'> 411B </span>","children":null,"spread":false},{"title":"TestObjD.java <span style='color:#111;'> 392B </span>","children":null,"spread":false},{"title":"TestObjA.java <span style='color:#111;'> 795B </span>","children":null,"spread":false}],"spread":true},{"title":"populate","children":[{"title":"DefaultValueFunctor.java <span style='color:#111;'> 8.96KB </span>","children":null,"spread":false},{"title":"BlankFunctor.java <span style='color:#111;'> 3.44KB </span>","children":null,"spread":false}],"spread":true},{"title":"compare","children":[{"title":"ReflectiveCompareObject.java <span style='color:#111;'> 13.15KB </span>","children":null,"spread":false},{"title":"CILTestUtil.java <span style='color:#111;'> 857B </span>","children":null,"spread":false}],"spread":true},{"title":"common","children":[{"title":"FunctorIF.java <span style='color:#111;'> 354B </span>","children":null,"spread":false},{"title":"JSONUtil.java <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false}],"spread":false},{"title":"traverse","children":[{"title":"EnumTest.java <span style='color:#111;'> 74B </span>","children":null,"spread":false},{"title":"ReflectiveTraverser.java <span style='color:#111;'> 4.61KB </span>","children":null,"spread":false},{"title":"ObjectInfo.java <span style='color:#111;'> 712B </span>","children":null,"spread":false},{"title":"ClassUtil.java <span style='color:#111;'> 8.62KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"mrfawy","children":[{"title":"npc","children":[{"title":"AppTest.java <span style='color:#111;'> 642B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".classpath <span style='color:#111;'> 996B </span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":".settings","children":[{"title":"org.eclipse.m2e.core.prefs <span style='color:#111;'> 86B </span>","children":null,"spread":false},{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 115B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 723B </span>","children":null,"spread":false}],"spread":true},{"title":"pom.xml <span style='color:#111;'> 867B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 5.24KB </span>","children":null,"spread":false},{"title":".project <span style='color:#111;'> 532B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明