Package java.lang

Examples of java.lang.Class.newInstance()


     throws InstantiationException
  {
   try
     {
     Class type = getClass().forName(conceptName);
     Object res = type.newInstance();
     ownedObjects.add(res);
     return res;
     }
    catch( Exception ex )
     {
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

        SystemException sysEx = null;

        try {
            Class clazz = ORBClassLoader.loadClass(exClassName);
            if (message == null) {
                sysEx = (SystemException) clazz.newInstance();
            } else {
                Class[] types = { String.class };
                Constructor constructor = clazz.getConstructor(types);
                Object[] args = { message };
                sysEx = (SystemException)constructor.newInstance(args);
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

         @return Factory - new bean factory instance
         *  @exception Throwable if any error occured
         */
        public Factory instantiateFactory() throws Throwable {
                Class clazz = Class.forName(type);
                Factory factory = (Factory) clazz.newInstance();
                factory.setFactoryMapping( this );
                return factory;
        }

}
View Full Code Here

                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

                Object[] values = null;

                clazz = Class.forName( type )

                if( parameters == null ) {
                      result = clazz.newInstance();
                } else {
                      if( parameters!=null && parameters.length > 0 ) {
                              types = new Class[ parameters.length ];
                              values = new Object[ parameters.length ];
                              ParameterMapping mapping = null;
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

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.