jeudi 27 juin 2019

How call a method in java using reflection?

I have a scenario where I instantiate a class and call a method method like the one given below using java reflection mechanism.

    WorkerObjectType workerObjectType = new WorkerObjectType();
    WorkerObjectIDType workerObjectIdType = new WorkerObjectIDType();
    workerObjectIdType.setType("Employee_ID");
    workerObjectIdType.setValue("102");
    workerObjectType.getID().add(workerObjectIdType);
    workerReqReferenceType.getWorkerReference().add(workerObjectType);

Particularly in the following scenario:

workerObjectType.getID().add(workerObjectIdType);
workerReqReferenceType.getWorkerReference().add(workerObjectType);





Aucun commentaire:

Enregistrer un commentaire