Package com.sun.star.uno

Examples of com.sun.star.uno.Type


      for  (int  i = 0 ; i < pValue.length; i++)
      {
    try{
        //System.out.println("\n"+pValue[i].Name+" "+pValue[i].Value);
        if (pValue[i].Name.compareTo("OutputStream")==0){
      xos=(com.sun.star.io.XOutputStream)AnyConverter.toObject(new Type(com.sun.star.io.XOutputStream.class), pValue[i].Value);
      //  System.out.println(pValue[i].Name+" "+xos);
        }
        else if (pValue[i].Name.compareTo("Indent")==0){  //to be changed to new value for indentation from XSLT UI
        indent=(boolean)AnyConverter.toBoolean(pValue[i].Value);
        }
View Full Code Here


            // bootstrap service manager
            XMultiServiceFactory xMgr = RegistryServiceFactory.create( rdb );
            XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xMgr );
            XComponentContext xContext = (XComponentContext)AnyConverter.toObject(
                new Type( XComponentContext.class ), xProps.getPropertyValue( "DefaultContext" ) );
            // insert java loader
            XSet xSet = (XSet)AnyConverter.toObject(
                new Type( XSet.class ), xContext.getServiceManager() );
            xSet.insert( new com.sun.star.comp.loader.JavaLoaderFactory( xMgr ) );
            // get rdb of smgr
            XSimpleRegistry xRDB = (XSimpleRegistry)AnyConverter.toObject(
                new Type( XSimpleRegistry.class ), xProps.getPropertyValue( "Registry" ) );
            // register impl
            XImplementationRegistration xImpReg =
                (XImplementationRegistration)UnoRuntime.queryInterface(
                    XImplementationRegistration.class,
                    xContext.getServiceManager().createInstanceWithContext(
View Full Code Here

        catch (NoSuchFieldException e)
        {
            throw new com.sun.star.uno.RuntimeException("there is no member variable: " + memberName);
        }
        Class cl= propField.getType();
        Type t= new Type(cl);
        if (t.getTypeClass() != TypeClass.UNKNOWN)
        {
            Property p= new Property(propertyName, lastHandle++,  t, attributes);
            registerProperty(p,memberName);
        }
        else
View Full Code Here

        if (ret == null)
        {
            if (prop.Type.getTypeClass() == TypeClass.INTERFACE)
                ret= new Any(prop.Type, null);
            else
                ret= new Any(new Type(void.class), null);
        }
        return ret;
    }
View Full Code Here

                            // We try to get an XInterface of setVal and set an XInterface type.
                            if (setVal instanceof XInterface)  
                            {
                                XInterface xint= (XInterface) UnoRuntime.queryInterface(XInterface.class, setVal);
                                if (xint != null)
                                    convObj= new Any(new Type(XInterface.class), xint);
                            }
                            // The member is an any, and the past in argument was null reference (MAYBEVOID is set)
                            else if (setVal == null)
                            {
                                // if the any member is still null we create a void any
                                if (curVal[0] == null)
                                    convObj= new Any(new Type(), null);
                                else
                                {
                                    //otherwise we create an Any with the same type as a value of null;
                                    convObj= new Any( ((Any)curVal[0]).getType(), null);
                                }
                            }
                            else
                                convObj= new Any(new Type(setVal.getClass()), setVal);
                        }
                    }
                    else
                        convObj= convert(memberClass, setVal);
                    newVal[0]= convObj;
View Full Code Here

        else if (cl.equals(Float.class))
            retVal= new Float(AnyConverter.toFloat(obj));
        else if (cl.equals(Double.class))
            retVal= new Double(AnyConverter.toDouble(obj));
        else if (XInterface.class.isAssignableFrom(cl))
            retVal= AnyConverter.toObject(new Type(cl), obj);
        else if (com.sun.star.uno.Enum.class.isAssignableFrom(cl))
            retVal= AnyConverter.toObject(new Type(cl), obj);
        else
            throw new com.sun.star.lang.IllegalArgumentException("Could not convert the argument");
        return retVal;
    }
View Full Code Here

            new Long(666L),
            new Short((short)444),
            new String("blabla"),
            new Integer(10)// Any as object
            new Integer(10)// Any as object
            new Any(new Type(Integer.class), new Integer(10)), // Any as Any
            new Any(new Type(Integer.class), new Integer(10)), // Any as Any
            null,
            new TestPrimitiveStruct(),
            x, //new TestPrimitiveSeqStruct(),
            new byte[]{1,2,3,4,5,6,7}, // primitive sequence
            new int[]{7,6,5,4,3,2,1}, // primitive sequence
            new Object[]{new Integer(123), new String("hallo")}, // any sequence
            new TestPrimitiveStruct[]{new TestPrimitiveStruct(), new TestPrimitiveStruct()}, // sequence of primitive structs
            new TestPrimitiveSeqStruct[]{new TestPrimitiveSeqStruct(), new TestPrimitiveSeqStruct()}, // sequence of primitive structs
            new TestNestedStruct(),
            new TestNestedSeqStruct(),
            new Type(Void.class),
            new Type(String.class),
            new Type(Object.class),
            new Type(Byte.class),
            new Type(Integer.class),
            new Type(Double.class),
            new Type(Float.class),
            new Type(Character.class),
            new Type(Short.class),
            new Type(Boolean.class),
            new Type(void.class),
            new Type(byte.class),
            new Type(int.class),
            new Type(double.class),
            new Type(float.class),
            new Type(char.class),
            new Type(short.class),
            new Type(boolean.class),
            new Type(Class.forName("[Ljava.lang.String;")),
            new Type(Class.forName("[Ljava.lang.Object;")),
            new Type(Class.forName("[B")),
            new Type(Class.forName("[Z")),
            new Type("boolean"),
            new Type("byte"),
            new Type("char"),
            new Type("short"),
            new Type("long"),
            new Type("hyper"),
            new Type("float"),
            new Type("double"),
            new Type("string"),
            new Type("void"),
            new Type("any"),
            new Type(
                "com.sun.star.lib.uno.protocols.urp.TestEnum", TypeClass.ENUM),
            new Type("[]boolean", TypeClass.SEQUENCE),
            new Type("[][]byte", TypeClass.SEQUENCE),
            new Type("[][][]char", TypeClass.SEQUENCE),
            new Type("[][][][]short", TypeClass.SEQUENCE),
            new Type("[][][][][]any", TypeClass.SEQUENCE),
            new Type("com.sun.star.uno.XInterface", TypeClass.INTERFACE),
            new Type("[]com.sun.star.uno.XInterface", TypeClass.SEQUENCE),
            testObject,
            testObject,
            new TestInterfaceStruct(testObject, null)
        };
View Full Code Here

        PipedOutputStream outB = new PipedOutputStream(inB);
        Endpoint iSender = new Endpoint(iBridge, inA, outB);
        Endpoint iReceiver = new Endpoint(iBridge, inB, outA);

        TestObject testObject = new TestObject();
        String oId = (String)iBridge.mapInterfaceTo(testObject, new Type(XInterface.class));

        testCall(iSender, iReceiver, oId);
        testCallWithInParameter(iSender, iReceiver, oId);
        testCallWithOutParameter(iSender, iReceiver, oId);
        testCallWithInOutParameter(iSender, iReceiver, oId);
View Full Code Here

        try {
            for (; xEnum.hasMoreElements();) {
                XInterface xInt = null;
                try {
                    xInt = (XInterface) AnyConverter.toObject(
                            new Type(XInterface.class), xEnum.nextElement());
                } catch (com.sun.star.lang.IllegalArgumentException iae) {
                    log.println("Can't convert any");
                }
            }
            result = true;
View Full Code Here


    //XTypeProvider
    public com.sun.star.uno.Type[] getTypes(  ) {
      Type[] retValue= new Type[4];
      retValue[0]= new Type( XServiceInfo.class);
      retValue[1]= new Type( XTypeProvider.class);
      retValue[2]= new Type( XTestDialogHandler.class);
      retValue[3]= new Type( XDialogEventHandler.class);
      return retValue;
    }
View Full Code Here

TOP

Related Classes of com.sun.star.uno.Type

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.