Top "Reflection" questions

What could cause java.lang.reflect.InvocationTargetException?

Well, I've tried to understand and read what could cause it but I just can't get it: I have this …

java exception reflection invoke
How do I invoke a Java method when given the method name as a string?

If I have two variables: Object obj; String methodName = "getName"; Without knowing the class of obj, how can I call …

java reflection invoke
What is reflection and why is it useful?

What is reflection, and why is it useful? I'm particularly interested in Java, but I assume the principles are the …

java reflection terminology
How to create a generic array in Java?

Due to the implementation of Java generics, you can't have code like this: public class GenSet<E> { private …

java arrays generics reflection instantiation
Get property value from string using reflection

I am trying implement the Data transformation using Reflection1 example in my code. The GetSourceValue function has a switch comparing …

c# reflection properties
How to list all functions in a Python module?

I have a python module installed on my system and I'd like to be able to see what functions/classes/…

python reflection module inspect
How do I get the path of the assembly the code is in?

Is there a way to get the path for the assembly in which the current code resides? I do not …

c# .net reflection mbunit
Get generic type of class at runtime

How can I achieve this? public class GenericClass<T> { public Type getMyType() { //How do I return the type …

java generics reflection
How to create a new object instance from a Type

One may not always know the Type of an object at compile-time, but may need to create an instance of …

c# .net performance reflection types
How to get the list of properties of a class?

How do I get a list of all the properties of a class?

c# .net reflection properties