private fun fieldsWithAnnotation(cls: Class<*>): Iterable<Field?>? { synchronized(mux) { var fields: MutableList<Field?>? = fieldCache.get(cls) if (fields == null) { fields = ArrayList() for (field in cls.declaredFields) { val ann: Annotation = field.getAnnotation(annCls) if (ann != null || needsRecursion(field)) fields!!.add(field) } if (!fields!!.isEmpty()) fieldCache.put(cls, fields) } return fields } }
Gets all entries from the specified class or its super-classes that have been annotated with annotation provided .