Examples of ITypeDescription


Examples of com.sun.star.uno.ITypeDescription

                typeClass, typeName, "[Ljava.lang.Object;", zClass, null, null);

        case TypeClass.SEQUENCE_value:
            {
                // assert typeName.startsWith("[]");
                ITypeDescription componentType = getTypeDescription(
                    typeName.substring("[]".length()));
                // assert zClass.getName().startsWith("[");
                return new TypeDescription(
                    typeClass, typeName, "[" + zClass.getName(), zClass, null,
                    componentType);
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

                            + ": entries not ordererd");
                    }
                    String getterName = "get" + info.getName();
                    Method getter = findMethod(methods, getterName);
                    Type t = info.getUnoType();
                    ITypeDescription type = t == null
                        ? getTypeDescription(getter.getReturnType(), info)
                        : getDefinitely(t);
                    directList.add(
                        new MethodDescription(
                            getterName, index++ + methodOffset, false,
                            new ITypeDescription[0], new ITypeDescription[0],
                            type, getter));
                    if (!info.isReadOnly()) {
                        String setterName = "set" + info.getName();
                        Method setter = findMethod(methods, setterName);
                        directList.add(
                            new MethodDescription(
                                setterName, index++ + methodOffset, false,
                                new ITypeDescription[] { type },
                                new ITypeDescription[] { null },
                                getDefinitely(Type.VOID), setter));
                    }
                } else {
                    MethodTypeInfo info = (MethodTypeInfo) infos[i++];
                    if (info.getIndex() != index) {
                        throw new IllegalArgumentException(
                            "Bad UNOTYPEINFO for " + zClass
                            + ": entries not ordererd");
                    }
                    Method method = findMethod(methods, info.getName());
                    Class[] params = method.getParameterTypes();
                    ITypeDescription[] in = new ITypeDescription[params.length];
                    ITypeDescription[] out
                        = new ITypeDescription[params.length];
                    for (int j = 0; j < params.length; ++j) {
                        ParameterTypeInfo p = null;
                        if (i < infoCount
                            && infos[i] instanceof ParameterTypeInfo
                            && ((ParameterTypeInfo) infos[i]).getIndex() == j)
                        {
                            p = (ParameterTypeInfo) infos[i++];
                        }
                        Type pt = p == null ? null : p.getUnoType();
                        ITypeDescription d = pt == null
                            ? getTypeDescription(params[j], p)
                            : getDefinitely(pt);
                        if (p == null || p.isIN()) {
                            in[j] = d;
                        }
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

        if (typeClass != TypeClass.STRUCT && typeClass != TypeClass.EXCEPTION) {
            return null;
        }
        TypeInfo[] infos = getTypeInfo();
        int infoCount = infos == null ? 0 : infos.length;
        ITypeDescription superType = getSuperType();
        IFieldDescription[] superDescs = superType == null
            ? null : superType.getFieldDescriptions();
        int superCount = superDescs == null ? 0 : superDescs.length;
        IFieldDescription[] descs = new IFieldDescription[
            superCount + infoCount];
        if (superCount != 0) {
            System.arraycopy(superDescs, 0, descs, 0, superCount);
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

   
    @param typeName name of a type for which an TypeDescription  object
    is constructed whoose information are printed.
   */
  static public void dumpTypeDescription(String typeName) throws Exception {
    ITypeDescription iTypeDescription = TypeDescription.getTypeDescription(typeName);

    System.err.println("TypeName:" + iTypeDescription.getTypeName());
    System.err.println("ArrayTypeName:" + iTypeDescription.getArrayTypeName());
    System.err.println("SuperType:" + iTypeDescription.getSuperType());
    System.err.println("TypeClass:" + iTypeDescription.getTypeClass());
    System.err.println("ComponentType:" + iTypeDescription.getComponentType());
    System.err.println("Class:" + iTypeDescription.getZClass());
   
    System.err.println("Methods:");
    IMethodDescription iMethodDescriptions[] = iTypeDescription.getMethodDescriptions();
    if(iMethodDescriptions != null)
      for(int i = 0; i < iMethodDescriptions.length; ++ i) {
        System.err.print("Name: " + iMethodDescriptions[i].getName());
        System.err.print(" index: " + iMethodDescriptions[i].getIndex());
        System.err.print(" isOneyWay: " + iMethodDescriptions[i].isOneway());
//          System.err.print(" isConst: " + iMethodDescriptions[i].isConst());
        System.err.print(" isUnsigned: " + iMethodDescriptions[i].isUnsigned());
        System.err.print(" isAny: " + iMethodDescriptions[i].isAny());
        System.err.println("\tisInterface: " + iMethodDescriptions[i].isInterface());

        System.err.print("\tgetInSignature: ");
        ITypeDescription in_sig[] = iMethodDescriptions[i].getInSignature();
        for(int j = 0; j < in_sig.length; ++ j)
          System.err.print("\t\t" + in_sig[j]);
        System.err.println();

        System.err.print("\tgetOutSignature: ");
        ITypeDescription out_sig[] = iMethodDescriptions[i].getOutSignature();
        for(int j = 0; j < out_sig.length; ++ j)
          System.err.print("\t\t" + out_sig[j]);
        System.err.println();

        System.err.println("\tgetReturnSig: " + iMethodDescriptions[i].getReturnSignature());
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

        return new String[] { "test", "testUnsigned",
                              "testGetMethodDescription", "testSequence" };
    }

    public void test() throws Exception {
        ITypeDescription voidTD = TypeDescription.getTypeDescription(
            void.class);
        ITypeDescription stringTD = TypeDescription.getTypeDescription(
            String.class);
        ITypeDescription typeTD = TypeDescription.getTypeDescription(
            Type.class);
        ITypeDescription anyTD = TypeDescription.getTypeDescription(Any.class);
        ITypeDescription interfaceTD = TypeDescription.getTypeDescription(
            XInterface.class);

        MethodSignature sigBuildinSyncTypeToAny = new MethodSignature(
            true, false, new ITypeDescription[] { typeTD },
            new ITypeDescription[1], anyTD);
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

                        (Object[]) ((Object[]) data[4])[i],
                        fds[i].getTypeDescription());
                }
            }

            ITypeDescription supert = description.getSuperType();
            assure(prefix + "; getSuperType",
                   (supert == null) == (data.length < 6));
            if (supert != null && data[5] != null) {
                _superType.test(prefix + "; getSuperType", (Object[]) data[5],
                                supert);
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

                typeClass, typeName, "[Ljava.lang.Object;", zClass, null, null);

        case TypeClass.SEQUENCE_value:
            {
                // assert typeName.startsWith("[]");
                ITypeDescription componentType = getTypeDescription(
                    typeName.substring("[]".length()));
                // assert zClass.getName().startsWith("[");
                return new TypeDescription(
                    typeClass, typeName, "[" + zClass.getName(), zClass, null,
                    componentType);
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

                            + ": entries not ordererd");
                    }
                    String getterName = "get" + info.getName();
                    Method getter = findMethod(methods, getterName);
                    Type t = info.getUnoType();
                    ITypeDescription type = t == null
                        ? getTypeDescription(getter.getReturnType(), info)
                        : getDefinitely(t);
                    directList.add(
                        new MethodDescription(
                            getterName, index++ + methodOffset, false,
                            new ITypeDescription[0], new ITypeDescription[0],
                            type, getter));
                    if (!info.isReadOnly()) {
                        String setterName = "set" + info.getName();
                        Method setter = findMethod(methods, setterName);
                        directList.add(
                            new MethodDescription(
                                setterName, index++ + methodOffset, false,
                                new ITypeDescription[] { type },
                                new ITypeDescription[] { null },
                                getDefinitely(Type.VOID), setter));
                    }
                } else {
                    MethodTypeInfo info = (MethodTypeInfo) infos[i++];
                    if (info.getIndex() != index) {
                        throw new IllegalArgumentException(
                            "Bad UNOTYPEINFO for " + zClass
                            + ": entries not ordererd");
                    }
                    Method method = findMethod(methods, info.getName());
                    Class[] params = method.getParameterTypes();
                    ITypeDescription[] in = new ITypeDescription[params.length];
                    ITypeDescription[] out
                        = new ITypeDescription[params.length];
                    for (int j = 0; j < params.length; ++j) {
                        ParameterTypeInfo p = null;
                        if (i < infoCount
                            && infos[i] instanceof ParameterTypeInfo
                            && ((ParameterTypeInfo) infos[i]).getIndex() == j)
                        {
                            p = (ParameterTypeInfo) infos[i++];
                        }
                        Type pt = p == null ? null : p.getUnoType();
                        ITypeDescription d = pt == null
                            ? getTypeDescription(params[j], p)
                            : getDefinitely(pt);
                        if (p == null || p.isIN()) {
                            in[j] = d;
                        }
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

        if (typeClass != TypeClass.STRUCT && typeClass != TypeClass.EXCEPTION) {
            return null;
        }
        TypeInfo[] infos = getTypeInfo();
        int infoCount = infos == null ? 0 : infos.length;
        ITypeDescription superType = getSuperType();
        IFieldDescription[] superDescs = superType == null
            ? null : superType.getFieldDescriptions();
        int superCount = superDescs == null ? 0 : superDescs.length;
        IFieldDescription[] descs = new IFieldDescription[
            superCount + infoCount];
        if (superCount != 0) {
            System.arraycopy(superDescs, 0, descs, 0, superCount);
View Full Code Here

Examples of com.sun.star.uno.ITypeDescription

        return new String[] { "test", "testUnsigned",
                              "testGetMethodDescription", "testSequence" };
    }

    public void test() throws Exception {
        ITypeDescription voidTD = TypeDescription.getTypeDescription(
            void.class);
        ITypeDescription stringTD = TypeDescription.getTypeDescription(
            String.class);
        ITypeDescription typeTD = TypeDescription.getTypeDescription(
            Type.class);
        ITypeDescription anyTD = TypeDescription.getTypeDescription(Any.class);
        ITypeDescription interfaceTD = TypeDescription.getTypeDescription(
            XInterface.class);

        MethodSignature sigBuildinSyncTypeToAny = new MethodSignature(
            true, false, new ITypeDescription[] { typeTD },
            new ITypeDescription[1], anyTD);
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.