Questions tagged [reflections]

For questions about the Java Reflections library (org.reflections.reflections) by ronmamo, which performs Java runtime metadata analysis, in the spirit of Scannotations.

Official GitHub Repository: https://github.com/ronmamo/reflections

155 questions
0
votes
0 answers

Reflection: Get values from Scanned Class with Annotation

So Im trying to get the file with the searched annotation, like this: package com.nikita.Nikitos; import java.util.Set; import org.reflections.Reflections; public class Main { public static void main(String[] args) { Reflections…
Nikita
  • 477
  • 4
  • 14
0
votes
1 answer

Getting `java.lang.ClassNotFoundException: org.apache.commons.pool.PoolableObjectFactory` when using Java reflection

I am trying to invoke a function using java reflection. My initial program is written in Ballerina which is given below. import ballerina/http; function __getQueryResults() returns error|string{ http:Client myClient = check…
0
votes
3 answers

Calling generic method recursively with type change in c#

I using the following library to do the Bulk insert. enter link description here i am trying to bulk insert a huge amount of data with its related items the solution is working fine with the first level but not inserting the children. So, I have the…
Mohamed Salah
  • 959
  • 10
  • 40
0
votes
0 answers

Resource scanning with Java Reflections (upgrading from 0.9.x to 0.10.x)

I use the Reflections library to list resources located in Java packages and I have the following code based on Reflections 0.9.x which works perfectly: Reflections r = new Reflections("com.example.so", new ResourcesScanner()); Set set =…
Robert Hume
  • 1,129
  • 2
  • 14
  • 25
0
votes
0 answers

How to get values of current method without using reflection in java

I would like to create new annotation for logging method name and method's parameter value. I'm using the below code to retrieve the method parameter information without using 'java reflection'(because its too costly). public void method1(String…
Harshad Panmand
  • 410
  • 5
  • 19
0
votes
0 answers

Is it possible to copy a KClass and change it's properties?

What I'd like to do is use Kotlin reflection to make a copy of a class and set all of it's properties optional/nullable. E.g. fun looseClass(schema: KClass<*>): KClass<*> { val props = schema.memberProperties.map { …
godzsa
  • 2,105
  • 4
  • 34
  • 56
0
votes
1 answer

Mirror material doesn't show reflections correctly

I hope you all having good day. To the point, I placed two mirrors, as shown below, but there is something wrong with the reflections, the reflection of front mirror and its image doesn't appear in the left hand mirror. I tried "Light Path" node but…
0
votes
1 answer

return a class implementing an interface using reflections

I'm using reflections to find all classes implementing IAnimal Interface. but how do I return a class instance using the animals set in the below code: Reflections reflections = new Reflections(IAnimal.class); Set>…
Mosaelee
  • 27
  • 1
  • 7
0
votes
1 answer

Pattern matching a file in a specific directory that may be nested inside that directory

I'm using reflections library. Trying to match a page with ID MyPage inside a directory called demo…
bobbyrne01
  • 6,295
  • 19
  • 80
  • 150
0
votes
0 answers

Micro Focus Reflection SFTP.exe unable to connect issue

Currently having an issue in SQL Server Agent batch jobs running the Reflections SFTP.exe command. Upon execution we are continually receiving the unable to connect to host Ext code 43. The account running the batch job has the permissions defined…
0
votes
1 answer

Is it possible to instantiate a DAO class dynamically at runtime?

So I've looked a little bit around but still couldn't find anything that could help me. So this is my code: public ExtendedBaseDAO getCorrespondingDAO(String tableName) throws DAOException { log.info("BaseService.getCorrespondingDAO(...):…
L_Cleo
  • 1,073
  • 1
  • 10
  • 26
0
votes
2 answers

How can I find Annotated methods in Scala/Java on Runtime

I want to use Runtime Reflection with Scala annotations (could also be a Java annoations if necessary, but I would prefer to limit pure Java code) I want to implement something like: /** print all methods that implement a specific annotation */ …
Leandro Libarona
  • 147
  • 2
  • 11
0
votes
2 answers

Unusual syntax used for object construction

I'm new to Java programming. While reading through the code of an open source project, I came across a line of code which I can't understand: final Type typeOfMap = new TypeToken>() {}.getType(); My questions are: I usually call…
megamonium
  • 463
  • 3
  • 7
0
votes
2 answers

I can use org.reflection to get package classes using wildcard?

I was using Reflections reflections = new Reflections("com.mypackage.root", new MethodAnnotationsScanner()); But with this aproach i get back a lot of annotations in packages level that i don't need... What i really want for, is something like…
Knautiluz
  • 354
  • 3
  • 14
0
votes
1 answer

Guava Google using Reflections in java

I am trying to use Reflections in my Java project (also using Spring boot), and I have to get all the classes of a package that implements an interface. public static Object[] getClasses(String packageName) throws IOException { Reflections r…
ourobor93
  • 372
  • 1
  • 7
  • 21