Package com4j.tlbimp.def

Examples of com4j.tlbimp.def.IMethod


    @Override
    protected final void generateExtends(IndentingWriter o) {
        boolean hasEnum = false;
        for( int j=0; j<t.countMethods() && !hasEnum; j++ ) {
            IMethod m = t.getMethod(j);
            hasEnum = MethodBinder.isEnum(m);
        }

        List<String> baseTypes = getBaseTypes();
        if(baseTypes.isEmpty()) {
View Full Code Here


        /**
         * Generates a method that uses {@link ReturnValue#defaultPropertyThrough()}
         * if applicable, or otherwise no-op.
         */
        final void generateDefaultInterfaceFacade( IndentingWriter o ) throws BindingException {
            IMethod m = method;
            List<IType> intermediates = new ArrayList<IType>();

            while(true) {
                MethodBinderImpl mb = createMethodBinder(m);
                // only handle methods of the form "HRESULT foo([out,retval]IFoo** ppOut);
                if (m.getParamCount() != 1 || mb.retParam != 0 || mb.params[mb.retParam].isIn())
                    break;

                // we expect it to be an interface pointer.
                IPtrType pt = mb.returnType.queryInterface(IPtrType.class);
                IDispInterfaceDecl di = null;
                IInterfaceDecl ii = null;
                if (pt != null) {
                    IType t = pt.getPointedAtType();
                    di = t.queryInterface(IDispInterfaceDecl.class);
                    ii = t.queryInterface(IInterfaceDecl.class);
                }

                if (di == null && ii == null)
                    break;

                IInterface intf;
                if (ii != null) {
                    intf = ii;
                } else {
                    if(di.isDual())
                        intf = di.getVtblInterface();
                    else
                        break;
                }

                // does this target interface has a default method?
                IMethod dm = g.dmf.getDefaultMethod(intf);
                if (dm == null)
                    return;

                // recursively check...
                m = dm;
View Full Code Here

    public IMethod getDefaultMethod(IInterface intf) {
        GUID guid = intf.getGUID();
        if(cache.containsKey(guid))
            return cache.get(guid);

        IMethod r = doGetDefaultMethod(intf);
        cache.put(guid,r);
        return r;
    }
View Full Code Here

    }

    private IMethod doGetDefaultMethod(IInterface intf) {
        int len = intf.countMethods();
        for( int i=0; i<len; i++ ) {
            IMethod m = intf.getMethod(i);
            if(m.getDispId()==0)
                return m;
        }
        return null;
    }
View Full Code Here

        // we'll use this to keep track of what we generated.
        // TODO: what was the difference between propput and propputref?
        Set<String> putMethods = new HashSet<String>();

        for( int j=0; j<t.countMethods(); j++ ) {
            IMethod m = t.getMethod(j);
            InvokeKind kind = m.getKind();
            if(kind== InvokeKind.PROPERTYPUT || kind== InvokeKind.PROPERTYPUTREF) {
                if(!putMethods.add(m.getName()))
                    continue;   // already added
            }
            try {
                o.startBuffering();
                generateMethod(m,o);
                o.commit();
            } catch( BindingException e ) {
                o.cancel();
                e.addContext("interface "+t.getName());
                g.el.error(e);
            }
            m.dispose();
        }

        o.out();
        o.println("}");
View Full Code Here

TOP

Related Classes of com4j.tlbimp.def.IMethod

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.