public class SingletonVerifier extends Object
| Constructor and Description |
|---|
SingletonVerifier(String... basePackages)
Instantiates a new Singleton verifier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
failOnInstanceFields()
Fail on instance fields.
|
protected Collection<Class<? extends Annotation>> |
getAnnotations()
Annotations for Spring Bean
|
Set<Field> |
getInstanceFields()
Gets instance fields.
|
Set<Field> |
getInstanceFields(Class<?> service)
Gets instance fields.
|
protected boolean |
isInstance(Field field)
Hook to add more validations.
|
static boolean |
isServiceInterface(String[] basePackages,
Class<?> type)
Is service interface boolean.
|
static boolean |
isTestClass(Class<?> service)
Is test class boolean.
|
static boolean |
isTestClass(File folder,
String fileName,
int depth)
Is test class boolean.
|
static void |
populateFields(Class<?> clazz,
Set<Field> fields)
Populate fields.
|
public SingletonVerifier(String... basePackages)
basePackages - the base backageprotected Collection<Class<? extends Annotation>> getAnnotations()
public void failOnInstanceFields()
public Set<Field> getInstanceFields()
public static boolean isTestClass(Class<?> service)
service - the servicepublic static boolean isTestClass(File folder, String fileName, int depth)
folder - the folderfileName - the file namedepth - the depthpublic static void populateFields(Class<?> clazz, Set<Field> fields)
clazz - the clazzfields - the fieldspublic static boolean isServiceInterface(String[] basePackages, Class<?> type)
basePackages - the base packagestype - the typepublic Set<Field> getInstanceFields(Class<?> service)
service - the serviceprotected boolean isInstance(Field field)
field - the fieldCopyright © 2021. All rights reserved.