Package java.lang.reflect

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


      Class xniStdConfigClass=ObjectFactory.findProviderClass(
                            "com.sun.org.apache.xerces.internal.parsers.StandardParserConfiguration",
                            ObjectFactory.findClassLoader(), true);
      fPullParserConfig=xniStdConfigClass.newInstance();
      Object[] args2={fPullParserConfig};
      fIncrementalParser = (SAXParser)ctor.newInstance(args2);
     
      // Preload all the needed the configuration methods... I want to know they're
      // all here before we commit to trying to use them, just in case the
      // API changes again.
      Class fXniInputSourceClass=ObjectFactory.findProviderClass(
View Full Code Here


        Class[] classes = new Class[]{String.class, SourceLocator.class, PrefixResolver.class, int.class,
                ErrorListener.class, FunctionTable.class};
        Object[] objects = new Object[]{str, null, prefixResolver, new Integer(XPath.SELECT), null, _funcTable};
        try {
            Constructor constructor = XPath.class.getConstructor(classes);
            xpath = (XPath) constructor.newInstance(objects);
        } catch (Throwable t) {
        }
        if (xpath == null) {
            xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null);
        }
View Full Code Here

      }
      try {
    if (ctor == null) {
        editor = cls.newInstance();
    } else {
        editor = ctor.newInstance(new Object[] { bean });
    }
      } catch (Exception ex) {
    // A serious error has occured.
    // Proably due to an invalid property editor.
    throw new RuntimeException("PropertyEditor not instantiated",
View Full Code Here

      return parent;
  }

  c = Class.forName(cls, true, parent);
  ctor = c.getDeclaredConstructor(cp);
  sys = (ClassLoader) ctor.newInstance(params);
  Thread.currentThread().setContextClassLoader(sys);
  return sys;
    }
}
View Full Code Here

    private static MethodHandle createCompiledMethodHandle(Method method, ClassLoaderForClassArtifacts loader) {
        try {
          Constructor c = compileMethodHandle(method, loader);
          if (c != null)
            return (MethodHandle) c.newInstance();
        } catch (Throwable e) { //
        }
        return new ReflectiveMethodHandle(method);
    }
View Full Code Here

                }
            }
   
            if (constr!=null) {
                try {
                    return (CallSite) constr.newInstance(site, metaClass, this, params, constr);
                } catch (Error e) {
                    skipCompiled=true;
                    throw e;
                } catch (Throwable e) {
                    skipCompiled=true;
View Full Code Here

                }
            }
   
            if (constr!=null) {
                try {
                    return (CallSite) constr.newInstance(site, metaClass, this, params, constr);
                } catch (Error e) {
                    skipCompiled=true;
                    throw e;
                } catch (Throwable e) {
                    skipCompiled=true;
View Full Code Here

                }
            }
   
            if (constr!=null) {
                try {
                    return (CallSite) constr.newInstance(site, metaClass, this, params, constr);
                } catch (Error e) {
                    skipCompiled=true;
                    throw e;
                } catch (Throwable e) {
                    skipCompiled=true;
View Full Code Here

            if(type.equals("javax.management.ObjectName")){
                Class clazz = Class.forName(type, true,
                        appConfig.getApplicationClassLoader());
                try {
                    Constructor ctor = clazz.getConstructor(new Class[]{String.class});
                    return ctor.newInstance(new Object[]{value});
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
View Full Code Here

            Constructor constructorObjectName =
                classObjectName.getConstructor( new Class[] {String.class} );
            Method methodRegisterMBean = classMBeanServer.getMethod(
                "registerMBean", new Class[] {Object.class, classObjectName} );
            Object mbs = methodGetPlatformMBeanServer.invoke( (Object)null, (Object[])null );
            Object oName = constructorObjectName.newInstance( new Object[] {name} );
            methodRegisterMBean.invoke( mbs, new Object[] {mbean, oName} );
           
            if ( m_debug )
            {
                m_outDebug.println( getRes().getString( "Registered MBean with Platform MBean Server: {0}",  name ) );
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.