In Java Lang Tutorial you will learn handy features of classes from java.lang package! Java Lang Classes Java Objects equals hashcode Shows how to use (new in Java 7) Objects to implement equals and hashcode. Java null check Shows how to validate input using (new in Java 7) Objects class. Java external process How to …
Continue reading Java Lang Tutorialjava-lang
Problem: How to find annotated classes in Java? JDK by itself doesn’t provide such mechanism, but there are libraries that can do that. One of them is Reflections, which is used in the following example.
Continue reading Java find annotated classesProblem: How to find annotated classes using Spring and read metadata from them? Sometimes you may want to attach metadata to your classes using custom annotations. Here’s an example how you can leverage Spring‘s classpath scanning mechanism to do that.
Continue reading Spring find annotated classesProblem: How to use Java Reflection to find annotated fields and/or methods? java.lang.reflect provides means to do it fairly easily as can be seen in the following example.
Continue reading Java reflection annotated fields/methodsProblem: How to get Java generic type parameter using reflection in runtime? Java doesn’t make it easy with type erasure, but it’s possible. See how.
Continue reading Java Reflection Generic Type