Klasse ReflectionUtils
java.lang.Object
ch.framedev.simplejavautils.ReflectionUtils
/ This Plugin was Created by FrameDev
/ Package: de.framedev.javautils
/ ClassName ReflectionUtils
/ Date: 26.09.21
/ Project: JavaUtils
/ Copyrighted by FrameDev
This Class can be used for Reflection in Java
Please mention the use of this Class ReflectionUtils
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungThis Class can be used for Java Reflection Please mention the use of this ClassReflectionUtilsReflectionUtils(boolean accessible) This Class can be used for Java Reflection Please mention the use of this ClassReflectionUtils -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetClassName(Class<?> class_) Return the ClassNameConstructor<?> getConstructor(String className) Retrieve the Constructor from the ClassConstructor<?> getConstructor(String className, Class<?>... params) Retrieve the Constructor from the ClassConstructor<?>[]getConstructors(String className) Retrieve the Constructorrs from the ClassgetEnumValue(String className, String of) Return the ClassNameObject[]getEnumValues(String className) Return the Enume ValuesRetrieves you the selected FieldgetFieldAnnotations(String className, String fieldName) Retrieves the Annotations from the FieldgetFieldAnnotationsSuperClass(String className, String fieldName) Retrieves the Annotations from the Field from the Upper ClassField[]Retrieve the Fields from the ClassField[]getFieldsSuperClass(String className) Retrieve the Fields from the Upper ClassgetFieldSuperClass(String className, String fieldName) Retrieves you the selected Field from the Upper ClassgetFieldType(String className, String fieldName) Retrieves the Type of the FieldgetFieldTypeSuperClass(String className, String fieldName) Retrieves the Type of the Field from the Upper ClassgetFieldValue(String className, Object object, String fieldName) Retrieves the Value of a Field in a ClassgetFieldValueSuperClass(String className, Object object, String fieldName) Retrieves the Value of a Field in a Class from the Upper ClassRetrieves the MethodgetMethodAnnotations(String className, String methodName) Retrieves the Method AnnotationsgetMethodAnnotationsSuperClass(String className, String methodName) Retrieves the Method Annotations from the Upper ClassgetMethodSuperClass(String className, String methodName) Retrieves the Method from the Upper ClassgetParameterTypes(String className, String methodName) Retrieves the Method Parameter TypesgetParameterTypesSuperClass(String className, String methodName) Retrieves the Method Parameter Types from the Upper ClassbooleanhasAnnotation(String className, String methodName, Class<? extends Annotation> class__) Retrieves the Method AnnotationsbooleanhasAnnotationSuperClass(String className, String methodName, Class<? extends Annotation> class__) Retrieves the Method Annotations from the Upper ClassbooleanhasClassAnnotation(String className, Class<? extends Annotation> class__) Retrieves if the Class has the AnnotationbooleanhasClassAnnotationSuperClass(String className, Class<? extends Annotation> class__) Retrieves if the Class has the Annotation from the Upper ClassbooleanhasConstructorAnnotation(Constructor<?> constructor, Class<? extends Annotation> class__) Retrieves if the Constructor has the AnnotationbooleanhasFieldAnnotation(String className, String fieldName, Class<? extends Annotation> class__) Retrieves if the Field has the AnnotationbooleanhasFieldAnnotationSuperClass(String className, String fieldName, Class<? extends Annotation> class__) Retrieves if the Field has the Annotation from the Upper ClassbooleanhasMethodArguments(String className, String methodName) Checks if the Method requires ArgumentsbooleanhasMethodArgumentsSuperClass(String className, String methodName) Checks if the Method requires Arguments from the Upper ClassbooleanisVoidMethod(String className, Object object, String methodName) Checks if the Method is a Void MethodbooleanisVoidMethod(String className, Object object, String methodName, Object... args) booleanisVoidMethodSuperClass(String className, Object object, String methodName) booleanisVoidMethodSuperClass(String className, Object object, String methodName, Object... args) newInstance(String className) Create a new Instance from a ClassnewInstance(String className, List<Object> paramsObjects, boolean accessible, Class<?>... params) Create a new Instance from a ClassnewInstance(String className, List<Object> paramsObjects, Class<?>... params) Create a new Instance from a ClassInvokes the MethodInvokes the Method with argumentsrunMethodSupClass(String className, Object object, String methodName, Object... args) Invokes the Method with argumentsrunMethodSuperClass(String className, Object object, String methodName) Invokes the MethodvoidChange the Value of a Field in a ClassvoidsetFieldSuperClass(String className, Object object, String fieldName, Object data) Change the Value of a Field in a Class from the Upper Class
-
Konstruktordetails
-
ReflectionUtils
public ReflectionUtils()This Class can be used for Java Reflection Please mention the use of this ClassReflectionUtils -
ReflectionUtils
public ReflectionUtils(boolean accessible) This Class can be used for Java Reflection Please mention the use of this ClassReflectionUtils
-
-
Methodendetails
-
getClassName
-
getEnumValue
-
getEnumValues
-
getField
-
getFieldSuperClass
-
hasConstructorAnnotation
public boolean hasConstructorAnnotation(Constructor<?> constructor, Class<? extends Annotation> class__) Retrieves if the Constructor has the Annotation- Parameter:
constructor- the Constructorclass__- the Annotation- Gibt zurück:
- return true if the Constructor has the Annotation
-
hasClassAnnotation
Retrieves if the Class has the Annotation- Parameter:
className- the ClassNameclass__- the Annotation- Gibt zurück:
- return true if the Class has the Annotation
-
hasClassAnnotationSuperClass
Retrieves if the Class has the Annotation from the Upper Class- Parameter:
className- the ClassNameclass__- the Annotation- Gibt zurück:
- return true if the Class has the Annotation
-
hasFieldAnnotation
public boolean hasFieldAnnotation(String className, String fieldName, Class<? extends Annotation> class__) Retrieves if the Field has the Annotation- Parameter:
className- the ClassNamefieldName- the Field Nameclass__- the Annotation- Gibt zurück:
- return true if the Field has the Annotation
-
hasFieldAnnotationSuperClass
public boolean hasFieldAnnotationSuperClass(String className, String fieldName, Class<? extends Annotation> class__) Retrieves if the Field has the Annotation from the Upper Class- Parameter:
className- the ClassNamefieldName- the Field Nameclass__- the Annotation- Gibt zurück:
- return true if the Field has the Annotation
-
getFieldAnnotations
Retrieves the Annotations from the Field- Parameter:
className- the ClassNamefieldName- the Field Name- Gibt zurück:
- return the Annotations from the Field
-
getFieldAnnotationsSuperClass
Retrieves the Annotations from the Field from the Upper Class- Parameter:
className- the ClassNamefieldName- the Field Name- Gibt zurück:
- return the Annotations from the Field
-
getMethodAnnotations
Retrieves the Method Annotations- Parameter:
className- the ClassNamemethodName- the Method Name- Gibt zurück:
- return the Method Annotations
-
getMethodAnnotationsSuperClass
Retrieves the Method Annotations from the Upper Class- Parameter:
className- the ClassNamemethodName- the Method Name- Gibt zurück:
- return the Method Annotations
-
hasAnnotation
public boolean hasAnnotation(String className, String methodName, Class<? extends Annotation> class__) Retrieves the Method Annotations- Parameter:
className- the ClassNamemethodName- the Method Nameclass__- the Annotation- Gibt zurück:
- return the Method Annotations
-
hasAnnotationSuperClass
public boolean hasAnnotationSuperClass(String className, String methodName, Class<? extends Annotation> class__) Retrieves the Method Annotations from the Upper Class- Parameter:
className- the ClassNamemethodName- the Method Nameclass__- the Annotation- Gibt zurück:
- return the Method Annotations
-
getMethod
-
getMethodSuperClass
-
getParameterTypes
-
getParameterTypesSuperClass
-
runMethod
Invokes the Method with arguments- Parameter:
className- the fully qualified name of the class containing the methodobject- the instance of the class on which to invoke the methodmethodName- the name of the method to invokeargs- the arguments to pass to the method- Gibt zurück:
- the result of the method invocation, or null if an error occurs
-
runMethodSupClass
Invokes the Method with arguments- Parameter:
className- the fully qualified name of the class containing the methodobject- the instance of the class on which to invoke the methodmethodName- the name of the method to invokeargs- the arguments to pass to the method- Gibt zurück:
- the result of the method invocation, or null if an error occurs
-
runMethod
Invokes the Method- Parameter:
className- the fully qualified name of the class containing the methodobject- the instance of the class on which to invoke the methodmethodName- the name of the method to invoke- Gibt zurück:
- the result of the method invocation, or null if an error occurs
-
runMethodSuperClass
Invokes the Method- Parameter:
className- the fully qualified name of the class containing the methodobject- the instance of the class on which to invoke the methodmethodName- the name of the method to invoke- Gibt zurück:
- the result of the method invocation, or null if an error occurs
-
isVoidMethod
-
isVoidMethodSuperClass
-
isVoidMethod
-
isVoidMethodSuperClass
-
hasMethodArguments
-
hasMethodArgumentsSuperClass
Checks if the Method requires Arguments from the Upper Class- Parameter:
className- the ClassName as example [de.framedev.javaproject.main.Main]methodName- the Method name to check- Gibt zurück:
- return true if the Method requires Arguments
-
setField
Change the Value of a Field in a Class- Parameter:
className- the selected Class to change a Fieldobject- the Class Object for the FieldfieldName- the FieldName to change the valuedata- the new Value for the Field
-
setFieldSuperClass
Change the Value of a Field in a Class from the Upper Class- Parameter:
className- the selected Class to change a Fieldobject- the Class Object for the FieldfieldName- the FieldName to change the valuedata- the new Value for the Field
-
getFieldValue
Retrieves the Value of a Field in a Class- Parameter:
className- the selected Class to get a Field as example [de.framedev.javaproject.main.Main]object- the Class Object for the FieldfieldName- the FieldName to get the value- Gibt zurück:
- return the Value of the Field
-
getFieldValueSuperClass
Retrieves the Value of a Field in a Class from the Upper Class- Parameter:
className- the selected Class to get a Field as example [de.framedev.javaproject.main.Main]object- the Class Object for the FieldfieldName- the FieldName to get the value- Gibt zurück:
- return the Value of the Field
-
getFieldType
-
getFieldTypeSuperClass
Retrieves the Type of the Field from the Upper Class- Parameter:
className- the selected Class as example [de.framedev.javaproject.main.Main]fieldName- the selected Field name to get the Type from it- Gibt zurück:
- return the Type of the Field
-
newInstance
public Object newInstance(String className, List<Object> paramsObjects, boolean accessible, Class<?>... params) Create a new Instance from a Class- Parameter:
className- the selected Class Name as example [de.framedev.javaproject.main.Main]paramsObjects- the Parameters for the Constructoraccessible- the Accessible for the Constructorparams- the Parameters for the Constructor- Gibt zurück:
- return the new Instance from the Class
-
newInstance
Create a new Instance from a Class- Parameter:
className- the selected Class Name as example [de.framedev.javaproject.main.Main]paramsObjects- the Parameters for the Constructorparams- the Parameters for the Constructor- Gibt zurück:
- return the new Instance from the Class
-
newInstance
-
getConstructors
Retrieve the Constructorrs from the Class- Parameter:
className- the selected Class Name as example [de.framedev.javaproject.main.Main]- Gibt zurück:
- return the Constructors from the Class
-
getConstructor
Retrieve the Constructor from the Class- Parameter:
className- the selected Class Name as example [de.framedev.javaproject.main.Main]params- the Parameters for the Constructor- Gibt zurück:
- return the Constructor from the Class
-
getConstructor
Retrieve the Constructor from the Class- Parameter:
className- the selected Class Name as example [de.framedev.javaproject.main.Main]- Gibt zurück:
- return the Constructor from the Class
-
getFields
-
getFieldsSuperClass
-