Package java.lang.reflect

Examples of java.lang.reflect.Constructor.newInstance()


         e.printStackTrace();
         System.out.println( "Dumping available constructors on " + soughtClass.getName() + "\n" + ExternalUtility.dumpConstructors( soughtClass ) );

         throw e;
      }
      Object gradleUI = constructor.newInstance( interaction );
      return (DualPaneUIVersion1) gradleUI;
   }

}
View Full Code Here


                if (DEBUG)
                    Debug.output(" - got constructor");

                // Create component
                obj = constructor.newInstance(constructorArgs);
                if (DEBUG)
                    Debug.output(" - got object");

            } catch (NoSuchMethodException nsmei) {
                /*
 
View Full Code Here

            if (good) {
                if (DEBUG) {
                    Debug.debugging(" - creating object");
                }
                Object obj = constructor.newInstance(constructorArgs);
                if (DEBUG) {
                    Debug.debugging(" - created object");
                }
                return obj;
            }
View Full Code Here

                        try {
                            cons.setAccessible(true);
                        } catch (Exception e) { /* deliberately left empty */ }
                        Object[] args = new Object[1];
                        args[0] = m_defaultText;
                        m_default = cons.newInstance(args);
                       
                    } else {
                       
                        // invoke deserializer to convert default value
                        String mname = m_deserializerItem.getName();
View Full Code Here

       * If Class.valueOf(String) doesn't exist, try a direct constructor
       * Class<T>(String)
       */
     
      Constructor constructor = c.getDeclaredConstructor(String.class);
      return (T)constructor.newInstance(propertyValue);
    }
    res = valueOf.invoke(/* This is a static method obj=null */null, propertyValue);
   
    return (T) res;
  }
View Full Code Here

            return new DefaultLayerAdapter(layer);
        }
        IWmsLayer wmsLayer = null;
        try {
            Constructor constructor = wmsLayerClass.getConstructor(new Class[] { Layer.class });
            wmsLayer = (IWmsLayer) constructor.newInstance(new Object[] { layer });
        } catch (Exception ex) {
            Debug.message("ms", "Problem calling constructor for class "
                    + wmsLayerClass.getName() + ":" + ex.getMessage());
        }
        if (wmsLayer == null) {
View Full Code Here

        try {
          Constructor constructor = info.cla.getDeclaredConstructor(new Class[] {
            String.class
          });
          TableColumnCore column = (TableColumnCore) constructor.newInstance(new Object[] {
            tableID
          });
          return column;
        } catch (Exception e) {
          Debug.out(e);
View Full Code Here

        for (int i = 0; i < parameterNames.length; i++)
        {
          final String name = parameterNames[i];
          params[i] = parameters.get(name);
        }
        return (TableModel) c.newInstance(params);
      }
      catch (Exception e)
      {
        throw new ReportDataFactoryException
            ("Unable to instantiate class for non static call.", e); //$NON-NLS-1$
View Full Code Here

      for (int i = 0; i < parameterNames.length; i++)
      {
        final String name = parameterNames[i];
        constrParams[i] = parameters.get(name);
      }
      final Object o = c.newInstance(constrParams);

      final Object[] methodParams = new Object[methodParameterNames.length];
      for (int i = 0; i < methodParameterNames.length; i++)
      {
        final String name = methodParameterNames[i];
View Full Code Here

        method.invoke(null, new Object[] { "alloy.licenseCode", licenseCode });

        Constructor constructor =
          lnfClass.getConstructor(new Class[] { Class.forName("com.incors.plaf.alloy.AlloyTheme")});
        LookAndFeel lnfInstance =
          (LookAndFeel) constructor.newInstance(new Object[] { Class.forName(themeClass).newInstance()});

        return lnfInstance;
      } catch (Exception e) {
        throw new GUIException("Error while setting theme", e);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.