Examples of XIdlClass


Examples of com.sun.star.reflection.XIdlClass

        while (undoAmbiguous || undoDefaulted || undoOptional) {
            String typeName = AnyConverter.getType(value).getTypeName();
            if (undoAmbiguous
                && typeName.startsWith("com.sun.star.beans.Ambiguous<"))
            {
                XIdlClass ambiguous = getReflection(typeName);
                try {
                    isAmbiguous = AnyConverter.toBoolean(
                        ((XIdlField2) UnoRuntime.queryInterface(
                            XIdlField2.class,
                            ambiguous.getField("IsAmbiguous"))).get(value));
                    value = ((XIdlField2) UnoRuntime.queryInterface(
                                 XIdlField2.class,
                                 ambiguous.getField("Value"))).get(value);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    throw new RuntimeException(
                        "unexpected"
                        + " com.sun.star.lang.IllegalArgumentException: "
                        + e.getMessage());
                }
                undoAmbiguous = false;
            } else if (undoDefaulted
                       && typeName.startsWith("com.sun.star.beans.Defaulted<"))
            {
                XIdlClass defaulted = getReflection(typeName);
                try {
                    isDefaulted = AnyConverter.toBoolean(
                        ((XIdlField2) UnoRuntime.queryInterface(
                            XIdlField2.class,
                            defaulted.getField("IsDefaulted"))).get(value));
                    value = ((XIdlField2) UnoRuntime.queryInterface(
                                 XIdlField2.class,
                                 defaulted.getField("Value"))).get(value);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    throw new RuntimeException(
                        "unexpected"
                        + " com.sun.star.lang.IllegalArgumentException: "
                        + e.getMessage());
                }
                undoDefaulted = false;
            } else if (undoOptional
                       && typeName.startsWith("com.sun.star.beans.Optional<"))
            {
                XIdlClass optional = getReflection(typeName);
                try {
                    boolean present = AnyConverter.toBoolean(
                        ((XIdlField2) UnoRuntime.queryInterface(
                            XIdlField2.class,
                            optional.getField("IsPresent"))).get(value));
                    if (!present) {
                        value = Any.VOID;
                        break;
                    }
                    value = ((XIdlField2) UnoRuntime.queryInterface(
                                 XIdlField2.class,
                                 optional.getField("Value"))).get(value);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    throw new RuntimeException(
                        "unexpected"
                        + " com.sun.star.lang.IllegalArgumentException: "
                        + e.getMessage());
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

    * interface that was passed as parameter in the method call and if returned
    * type is equal to <code>com.sun.star.uno.TypeClass.INTERFACE</code>. <p>
    */
    public void _forName() {
        boolean result = true;
        XIdlClass cls = oObj.forName(typeName);

        if (cls != null) {
            log.println("Class name: " + cls.getName());
            result &= cls.getTypeClass() == TypeClass.INTERFACE;
            result &= typeName.equals(cls.getName());
        } else {
            log.println("Method returned null");
            result = false;
        }

View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

            result = false;
            log.println("Object wasn't created !");
            tRes.tested("getType()", false);
        }

        XIdlClass cls = oObj.getType(obj);

        log.println("The name is " + cls.getName());

        tRes.tested("getType()", cls != null);
    }
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

        while (undoAmbiguous || undoDefaulted || undoOptional) {
            String typeName = AnyConverter.getType(value).getTypeName();
            if (undoAmbiguous
                && typeName.startsWith("com.sun.star.beans.Ambiguous<"))
            {
                XIdlClass ambiguous = getReflection(typeName);
                try {
                    isAmbiguous = AnyConverter.toBoolean(
                        UnoRuntime.queryInterface(
                            XIdlField2.class,
                            ambiguous.getField("IsAmbiguous")).get(value));
                    value = UnoRuntime.queryInterface(
                        XIdlField2.class,
                        ambiguous.getField("Value")).get(value);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    throw new RuntimeException(
                        "unexpected"
                        + " com.sun.star.lang.IllegalArgumentException: "
                        + e.getMessage());
                }
                undoAmbiguous = false;
            } else if (undoDefaulted
                       && typeName.startsWith("com.sun.star.beans.Defaulted<"))
            {
                XIdlClass defaulted = getReflection(typeName);
                try {
                    isDefaulted = AnyConverter.toBoolean(
                        UnoRuntime.queryInterface(
                            XIdlField2.class,
                            defaulted.getField("IsDefaulted")).get(value));
                    value = UnoRuntime.queryInterface(
                        XIdlField2.class,
                        defaulted.getField("Value")).get(value);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    throw new RuntimeException(
                        "unexpected"
                        + " com.sun.star.lang.IllegalArgumentException: "
                        + e.getMessage());
                }
                undoDefaulted = false;
            } else if (undoOptional
                       && typeName.startsWith("com.sun.star.beans.Optional<"))
            {
                XIdlClass optional = getReflection(typeName);
                try {
                    boolean present = AnyConverter.toBoolean(
                        UnoRuntime.queryInterface(
                            XIdlField2.class,
                            optional.getField("IsPresent")).get(value));
                    if (!present) {
                        value = Any.VOID;
                        break;
                    }
                    value = UnoRuntime.queryInterface(
                        XIdlField2.class,
                        optional.getField("Value")).get(value);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    throw new RuntimeException(
                        "unexpected"
                        + " com.sun.star.lang.IllegalArgumentException: "
                        + e.getMessage());
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

        String sParameters = "";
        String sStandardMethodDisplayText = m_xIdlMethod.getReturnType().getName() + " " + m_xIdlMethod.getName() + " (" + sParameters + " )";
        if (Introspector.isValid(paramInfo)) {
            //  get all parameters with type and mode
            for ( int i = 0; i < paramInfo.length; i++ ) {
                XIdlClass xIdlClass = paramInfo[ i ].aType;
                if ( i == 0 ) {
                    //  the first parameter has no leading comma
                    sParameters += "[" + getParamMode(paramInfo[ i ].aMode ) + "] " + xIdlClass.getName();
                }
                else {
                    //  all other parameters are separated with comma
                    sParameters += ", [" + getParamMode(paramInfo[ i ].aMode ) + "] " + xIdlClass.getName();
                }
            }
        }
        return sParameters;
    }
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

        }
        return( toReturn );
    }
   
    public TypeClass getTypeClass(){
        XIdlClass xIdlClass = m_xIdlMethod.getReturnType();
        return xIdlClass.getTypeClass();
    }
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

    }
       

    protected XIdlMethod[] getMethodsOfInterface(Type _aType){
    try{
        XIdlClass xIdlClass = mxIdlReflection.forName(_aType.getTypeName());           
        return xIdlClass.getMethods();
    }
    catch( Exception e ) {
        System.err.println( e );
        return null;
    }}         
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

    }}         


    protected XIdlField[] getFieldsOfType(Type _aType){
    try{
        XIdlClass xIdlClass = mxIdlReflection.forName(_aType.getTypeName());           
        return xIdlClass.getFields();
    }
    catch( Exception e ) {
        System.err.println( e );
        return null;
    }}         
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

   
    private UnoObjectDefinition getUnoObjectDefinition(XTreePathProvider _xTreePathProvider, XUnoMethodNode _oUnoMethodNode, int _nindex){
        XUnoNode oUnoNode = null;
        Object oUnoReturnObject = null;
        Object[] oParamObjects = null;
        XIdlClass xIdlClass = _oUnoMethodNode.getXIdlMethod().getReturnType();
        String sTypeName = xIdlClass.getName();
        TypeClass aTypeClass = xIdlClass.getTypeClass();
        if (aTypeClass.getValue() != TypeClass.VOID_value){
            if (_xTreePathProvider.getPathCount() > _nindex + 1){
                oUnoNode = _xTreePathProvider.getPathComponent(_nindex + 1);
                oUnoReturnObject = oUnoNode.getUnoObject();
            }
View Full Code Here

Examples of com.sun.star.reflection.XIdlClass

                    ParamInfo[] paramInfo = mMethods[ n ].getParameterInfos();
                    String stringParameters = "";
                    if ( paramInfo != null ) {
                        //  get all parameters with type and mode
                        for ( int i = 0; i < paramInfo.length; i++ ) {
                            XIdlClass xIdlClass = paramInfo[ i ].aType;
                            if ( i == 0 ) {
                                //  the first parameter has no leading comma
                                stringParameters += "[" + this.getParamMode( paramInfo[ i ].aMode ) + "] " +  xIdlClass.getName();
                            }
                            else {
                                //  all other parameters are separated with comma
                                stringParameters += ", [" + this.getParamMode( paramInfo[ i ].aMode ) + "] " +  xIdlClass.getName();
                            }
                        }
                    }
                   
                    //  add the method with name, return type, and parameters to the tree
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.