Package java.lang

Examples of java.lang.Class.newInstance()


                Class clazz = Class.forName( type );
                DataBean db = null;
                ArrayList store = new ArrayList();

                for( int i = 0; rs.next(); i++ ) {
                        db = (DataBean)clazz.newInstance();
                        db.populateFrom( rs );
                        store.add( db );
                }

                return store;
View Full Code Here


                Class clazz = Class.forName( type );
                DataBean db = null;

                for( int i = 0; i < slide.getOffset() - 1; i++, total++ ) rs.next();
                for( int i = 0; rs.next() && ( i < slide.getSlideLength() ); i++, total++ ) {
                        db = (DataBean)clazz.newInstance();
                        db.populateFrom( rs );
                        store.add( i, db );
                }
                while( rs.next() ) total++;
View Full Code Here

public class JDBCSingleFactory extends JDBCFactory {

        protected Object processResult( ResultSet rs, String type, Parameter[] parameters )
                throws Throwable {
                Class clazz = Class.forName( type );
                DataBean db = (DataBean)clazz.newInstance();
                if( rs.next() )
                        db.populateFrom( rs );
                return db;
        }
View Full Code Here

  Class firstClass = load(rootCl, "First");
  System.out.println("Main: loaded First.");
  Object firstInst = null;
  try {
    System.out.println("Main: first.newInstance(....");
    firstInst = firstClass.newInstance();
    System.out.println("Main: ...)");
  } catch (Exception X) {
      System.out.println("Probably should put First class def'n in `First.java`");
      X.printStackTrace();
  }
View Full Code Here

                    URL[] urls = new URL[1];
                    urls[0] = new URL(factoryJar);
                    ClassLoader loader = new URLClassLoader(urls,
                        BagFactory.class.getClassLoader());
                    Class c = Class.forName(factoryName, true, loader);
                    Object o = c.newInstance();
                    if (!(o instanceof BagFactory)) {
                        throw new RuntimeException("Provided factory " +
                            factoryName + " does not extend BagFactory!");
                    }
                    gSelf = (BagFactory)o;
View Full Code Here

                    URL[] urls = new URL[1];
                    urls[0] = new URL(factoryJar);
                    ClassLoader loader = new URLClassLoader(urls,
                        TupleFactory.class.getClassLoader());
                    Class c = Class.forName(factoryName, true, loader);
                    Object o = c.newInstance();
                    if (!(o instanceof TupleFactory)) {
                        throw new RuntimeException("Provided factory " +
                            factoryName + " does not extend TupleFactory!");
                    }
                    gSelf = (TupleFactory)o;
View Full Code Here

        function = Class.forName(classname);
      }
      else
        function = Class.forName(m_funcName);

      Function func = (Function) function.newInstance();

      return func;
    }
    catch (ClassNotFoundException e)
    {
View Full Code Here

        function = Class.forName(classname);
      }
      else
        function = Class.forName(m_funcName);
     
      Function func = (Function)function.newInstance();
      path.installFunction(m_funcName, m_funcID, func);
      return func.execute(path, execContext, context, opPos, args);
    }
    catch(ClassNotFoundException e)
    {
View Full Code Here

            char first = Character.toUpperCase(methodName.charAt(0));
            String impl = "com.nirima.jenkins.webdav.impl.methods." + first + methodName.substring(1).toLowerCase();

            try {
                Class c = Class.forName(impl);
                IMethod method = (IMethod) c.newInstance();
                //method.init(request, response, null, repo, root);
                return method;
            } catch (Exception e) {
                throw new MethodException("Exception in creating method " + methodName, e);
            }
View Full Code Here

                    URL[] urls = new URL[1];
                    urls[0] = new URL(factoryJar);
                    ClassLoader loader = new URLClassLoader(urls,
                        TupleFactory.class.getClassLoader());
                    Class c = Class.forName(factoryName, true, loader);
                    Object o = c.newInstance();
                    if (!(o instanceof TupleFactory)) {
                        throw new RuntimeException("Provided factory " +
                            factoryName + " does not extend TupleFactory!");
                    }
                    gSelf = (TupleFactory)o;
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.