Package java.lang

Examples of java.lang.Class


         * @param className the name of the class for which a
         * validator class is to be found
         * @return the class which is to be used for validation
         **/
    Class getValidatorClass(final String className, String testPackage){
        Class c;
        final String cn = testPackage+className+"Test";
            try {
            c= Class.forName(cn);
        }
        catch (ClassNotFoundException cnfe2){
            c = GenericValidator.class;
        }
        _logger.log(Level.CONFIG, "validator using class \""+c.getName()+"\" to validate \""+cn+"\"");
        return c;
    }
View Full Code Here


        String message, ORBUtilSystemException wrapper)
    {
        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);
            }
        } catch (Exception someEx) {
            throw wrapper.badSystemExceptionInReply(
View Full Code Here

   protected void enableSubProp( String name ){
      int index = getSubPropNameIndex( name );
      if ( index < 0 ) {
         throw new RuntimeException("Attemtp to enable subProp: " + name + "\n\tname must be qualified\n");
      }
      Class tClass = BasicStringProperty.class;
      try {
         if ( index == MAX_LEN ) {
            setSubPropEval( index , evalMaxLenClosed );
            setSubPropMerge( index , Helpers . maxMethod );
         } else if ( index == MIN_LEN ) {
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

         *  any other algorithm.
         *  @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

public class JDBCArrayFactory extends JDBCFactory {

        protected Object processResult( ResultSet rs, String type, Parameter[] parameters )
                throws Throwable {

                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

                Integer length = (Integer)parameters[2].getValue();

                int total = 0;
                ArrayList store = new ArrayList();
                Slide slide = new Slide( length.intValue(), offset.intValue(), store );
                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 Object create( String type, Parameter[] parameters )
                throws Throwable {
               
                Object result = null;
                Class clazz = null;
                Class[] types = null;
                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;
                              for( int i = 0; i < parameters.length; i++ ) {
                                        mapping = parameters[ i ].getMapping();
                                        types[ i ] = Class.forName( mapping.getType() );
                                        values[ i ] = parameters[ i ].getValue();
                              }
                      }
                      Constructor constructor = clazz.getConstructor( types );
                      result = constructor.newInstance( values );
                }

                return result;
        }
View Full Code Here

     * @param config configuration for this component
     */
    private void load_component( ExcaliburComponentSelector selector, Object hint,
                                 String classURL, Configuration config ) throws Exception {

        Class clazz = null;
        //FIXME(GP): Is it true that a class name containing a colon should be an URL?
        if (classURL.indexOf(':') > 1) {
            URL url = urlFactory.getURL(classURL);
            byte[] b = getByteArrayFromStream(url.openStream());
            clazz = ((RepositoryClassLoader)ClassUtils.getClassLoader()).defineClass(b);
View Full Code Here

                try {
                    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

Related Classes of java.lang.Class

Copyright © 2018 www.massapicom. 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.