Package java.lang.reflect

Examples of java.lang.reflect.Member


    /**
     * Called by the evaluator after the extension is loaded.
     */
    public static void init(Scriptable scope) {
        Method[] methods = XmlRpcObject.class.getDeclaredMethods();
        Member ctorMember = null;
        for (int i=0; i<methods.length; i++) {
            if ("xmlrpcObjectConstructor".equals(methods[i].getName())) {
                ctorMember = methods[i];
                break;
            }
View Full Code Here


    public static void init(Scriptable scope) {
        Method[] methods = FileObject.class.getDeclaredMethods();
        ScriptableObject proto = new FileObject();
        proto.setPrototype(getObjectPrototype(scope));
        Member ctorMember = null;
        for (int i=0; i<methods.length; i++) {
            if ("fileObjCtor".equals(methods[i].getName())) {
                ctorMember = methods[i];
                break;
            }
View Full Code Here

     */
    public static void init(Scriptable scope, Properties props) {
        Method[] methods = MailObject.class.getDeclaredMethods();
        MailObject proto = new MailObject(props);
        proto.setPrototype(getObjectPrototype(scope));
        Member ctorMember = null;
        for (int i=0; i<methods.length; i++) {
            if ("mailObjCtor".equals(methods[i].getName())) {
                ctorMember = methods[i];
                break;
            }
View Full Code Here

    /**
     * Called by the evaluator after the extension is loaded.
     */
    public static void init(Scriptable scope) {
        Method[] methods = ImageObject.class.getDeclaredMethods();
        Member ctorMember = null;
        for (int i=0; i<methods.length; i++) {
            if ("imageCtor".equals(methods[i].getName())) {
                ctorMember = methods[i];
                break;
            }
View Full Code Here

    public static void init(Scriptable scope) {
        Method[] methods = FtpObject.class.getDeclaredMethods();
        ScriptableObject proto = new FtpObject();
        proto.setPrototype(getObjectPrototype(scope));
        Member ctorMember = null;
        for (int i=0; i<methods.length; i++) {
            if ("ftpObjCtor".equals(methods[i].getName())) {
                ctorMember = methods[i];
                break;
            }
View Full Code Here

        String v = getCookieValue(cookieName, ip);
        if (t.equals(String.class)) {
            return v;
        }
        try {
            Member converter = ext.getConverterMember(t);
            return converter instanceof Constructor ? ((Constructor<?>) converter).newInstance(v) : ((Method) converter)
                    .invoke(null, v);
        }
        // TODO should at least debug we couldn't convert the value
        catch (Exception e) {
View Full Code Here

        Class<?> t = PrimitiveTypes.box(resolveExpectedType(ip));
        if (t.equals(String.class)) {
            return v;
        }
        try {
            Member converter = ext.getConverterMember(t);
            return converter instanceof Constructor ? ((Constructor<?>) converter).newInstance(v) : ((Method) converter)
                    .invoke(null, v);
        }
        // TODO should at least debug we couldn't convert the value
        catch (Exception e) {
View Full Code Here

        Class<?> t = PrimitiveTypes.box(resolveExpectedType(ip));
        if (t.equals(String.class)) {
            return v;
        }
        try {
            Member converter = ext.getConverterMember(t);
            return converter instanceof Constructor ? ((Constructor<?>) converter).newInstance(v) : ((Method) converter)
                    .invoke(null, v);
        }
        // TODO should at least debug we couldn't convert the value
        catch (Exception e) {
View Full Code Here

                        if (targetClass.equals(String.class)
                                || (paramAnnotationType.equals(CookieParam.class) && targetClass.equals(Cookie.class))) {
                            // no converter needed
                        } else {
                            targetClass = PrimitiveTypes.box(targetClass);
                            Member converter = null;

                            if (targetClass.isEnum()) {
                                converter = targetClass.getMethod("valueOf", String.class);
                            } else if (Date.class.isAssignableFrom(targetClass)) {
                                converter = TemporalConverters.class.getMethod("parseDate", String.class);
View Full Code Here

            logger.log( Level.FINEST, "generated name of proxy class: " + proxyName );

            // pre-check if the requested method is a constructor
            boolean isConstructor = tClass.getSimpleName().equals( mName );
            Class[] realTypes = new Class[types.length];
            Member targetMtd = null;

            /*
             * try to find a method/constructor in the target class which: 1. has the same name 2. takes the given
             * paramter types or their primitive or wrapper counterparts
             */
 
View Full Code Here

TOP

Related Classes of java.lang.reflect.Member

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.