arrow_back history picture_as_pdf This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ~~NOTRANS~~ ~~Title: Using Reflective~~ JVx' Reflective class allows you to create class instances or call methods via reflection but without directly using java.lang.reflect. == How it works? == We have a short example for you. Our class: <file java MyClient.java> package com.sibvisions.app; public class MyClient { public Result doUpload(String pKey, String pValue) { ... } public Result doDownload(String pPath) { ... } public Result doDownload(File pFile) { ... } } </file> A simple method call: <file java> Object oClient = Reflective.construct("com.sibvisions.app.MyClient"); Reflective.call(oClient, "doUpload", "Key", "Value"); </file> Now we call ''doDownload'': <file java> Object oClient = Reflective.construct("com.sibvisions.app.MyClient"); //no problem Reflective.call(oClient, "doDownload", "file.txt"); //without Parameter, maybe we call the wrong method Reflective.call(oClient, "doDownload", new Reflective.Parameter(String.class, null)); </file> As you can see, we use the class Reflective.Parameter. It is useful if you have methods with the same name, same number of parameters but with different parameter types. Without this class, it is not guaranteed that the desired method is called.