public class UtilScanner extends Object
Modifier and Type | Method and Description |
---|---|
static List<Class<?>> |
allClasses(Type type)
Get all classes and interfaces containing in a Type.
|
static void |
checkLocale() |
static Map<String,Class<?>> |
classIntrospectionFromPackage(String packageName,
Class<?> subTypeClazz,
String runtime)
This method will return a Map k-v where
|
static Map<String,Object> |
classPropertiesSerialization(Class<?> implClass)
Serialize to pojo Setting each properties annotated by JsonProperty (jackson) found in a class
e.g.
|
static String |
defaultGroup(Class<?> clazz) |
static Set<Class<?>> |
filterAbstractInterfaceModifier(Set<Class<?>> elements)
return a new set without any class of type interface or abstract
|
static Set<Class<?>> |
filterApiClass(Set<Class<?>> elements)
Removed any unwanted class from the input set
|
static Set<Class<?>> |
filterRuntimeClass(Set<Class<?>> elements,
String runtime) |
static Set<Class<?>> |
objectToClass(Set<?> elements)
Convert a set of object to Class of type T
|
static String |
simplifyClassName(String type)
Simplify a class name.
|
static List<Class<?>> |
superClassList(Class<?> clazz)
Get all implemented classes and interfaces.
|
static List<String> |
superClassListSimplifiedNames(Class<?> clazz)
Get all implemented classes and interfaces.
|
public static List<Class<?>> superClassList(Class<?> clazz)
clazz
- the scanned classpublic static List<String> superClassListSimplifiedNames(Class<?> clazz)
clazz
- the scanned classpublic static Set<Class<?>> objectToClass(Set<?> elements)
elements
- public static Set<Class<?>> filterAbstractInterfaceModifier(Set<Class<?>> elements)
elements
- public static Set<Class<?>> filterApiClass(Set<Class<?>> elements)
elements
- public static Set<Class<?>> filterRuntimeClass(Set<Class<?>> elements, String runtime)
public static String simplifyClassName(String type)
type
- class name to simplifypublic static void checkLocale()
public static List<Class<?>> allClasses(Type type)
type
- the scanned typepublic static Map<String,Object> classPropertiesSerialization(Class<?> implClass) throws InstantiationException, IllegalAccessException
{user_name=org.thales.punch.pml.scan.pojo.Setting@22ef9844, self_monitoring.activation=org.thales.punch.pml.scan.pojo.Setting@6283d8b8, self_monitoring.period=org.thales.punch.pml.scan.pojo.Setting@3b6ddd1d}Each element of the map has a key "the property name" and value "our Serialized Pojo Setting"
implClass
- InstantiationException
IllegalAccessException
public static Map<String,Class<?>> classIntrospectionFromPackage(String packageName, Class<?> subTypeClazz, String runtime)
key is the class type which inherit PunchBaseNode
value is a map of classes inheriting from PunchBaseNode
an example may look like this:
{org.thales.punch.storm.node.starter.kit.ProcessingNode=class org.thales.punch.storm.node.starter.kit.ProcessingNode, org.thales.punch.storm.node.starter.kit.InputNode=class org.thales.punch.storm.node.starter.kit.InputNode}
packageName
- subTypeClazz
- Copyright © 2022. All rights reserved.