Package com.sun.star.lib.uno.typeinfo

Examples of com.sun.star.lib.uno.typeinfo.ParameterTypeInfo


                    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;
                        }
                        if (p != null && p.isOUT()) {
                            out[j] = d;
                        }
                    }
                    Type t = info.getUnoType();
                    directList.add(
View Full Code Here


                    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;
                        }
                        if (p != null && p.isOUT()) {
                            out[j] = d;
                        }
                    }
                    Type t = info.getUnoType();
                    directList.add(
View Full Code Here

                    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;
                        }
                        if (p != null && p.isOUT()) {
                            out[j] = d;
                        }
                    }
                    Type t = info.getUnoType();
                    directList.add(
View Full Code Here

                    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;
                        }
                        if (p != null && p.isOUT()) {
                            out[j] = d;
                        }
                    }
                    Type t = info.getUnoType();
                    directList.add(
View Full Code Here

   * @param  methodName  the method name
   * @param  index       the parameter index
   * @see                com.sun.star.lib.uno.ParameterTypeInfo
   */
  static private ParameterTypeInfo __findParameterTypeInfo(TypeInfo typeInfos[], String methodName, int index) {
    ParameterTypeInfo parameterTypeInfo = null;

    if(typeInfos != null)
      for(int i = 0; i < typeInfos.length; ++ i) {
        if(typeInfos[i] instanceof ParameterTypeInfo
        && (index == ((ParameterTypeInfo)typeInfos[i]).getIndex())
View Full Code Here

    int superOffset = 0;

    if(_class == com.sun.star.uno.XInterface.class) { // take special care for xinterface
        MethodDescription queryInterface = new MethodDescription("queryInterface", 0, TypeInfo.ANY);
      queryInterface.init(new Class[]{Type.class}, new ParameterTypeInfo[]{new ParameterTypeInfo(null, "queryInterface", 0, 0)},
                          Object.class);

      MethodDescription acquire = new MethodDescription("acquire", 1, TypeInfo.ONEWAY);
      acquire.init(new Class[0], null, Void.class);

      MethodDescription release = new MethodDescription("release", 2, TypeInfo.ONEWAY);
      release.init(new Class[0], null, Void.class);

      methodDescriptionsByName.put("queryInterface", queryInterface);
      methodDescriptionsByName.put("acquire", acquire);
      methodDescriptionsByName.put("release", release);

      _offset = 3;
    }
    else {
      if(_superType != null) // do we have a supertype (we don't have one, if we are not derived of XInterface)
        superOffset = _superType._offset;

      TypeInfo typeInfos[] = __getTypeInfos(_class);
      Method methods[] = _class.getMethods();
     
      for(int i = 0; i < methods.length; ++ i) {
        Class parameters[] = methods[i].getParameterTypes();
        ParameterTypeInfo parameterTypeInfos[] = new ParameterTypeInfo[parameters.length];
       
        MethodTypeInfo methodTypeInfo = __findMethodTypeInfo(typeInfos, methods[i].getName());
        MethodDescription methodDescription = null;

        if(methodTypeInfo != null) { // this is a idl method
          methodDescription = new MethodDescription(methodTypeInfo);

          for(int j = 0; j < parameters.length; ++ j)
            parameterTypeInfos[j] = __findParameterTypeInfo(typeInfos, methods[i].getName(), j);
        }
        else {
          AttributeTypeInfo attributeTypeInfo = __findAttributeTypeInfo(typeInfos, methods[i].getName().substring(3));
         
          if(attributeTypeInfo != null) {
            if(methods[i].getName().substring(0, 3).equals("get")) // is the current a get method?
              methodDescription = new MethodDescription(methods[i].getName(), attributeTypeInfo.getIndex(), attributeTypeInfo.getFlags());
           
            else {
              methodDescription = new MethodDescription(methods[i].getName(), attributeTypeInfo.getIndex() + 1, 0);
              parameterTypeInfos = new ParameterTypeInfo[]{new ParameterTypeInfo("", methods[i].getName(), 0, attributeTypeInfo.getFlags())};
            }
          }
        }
       
        if(methodDescription != null) {
View Full Code Here

                    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;
                        }
                        if (p != null && p.isOUT()) {
                            out[j] = d;
                        }
                    }
                    Type t = info.getUnoType();
                    directList.add(
View Full Code Here

   * @param  methodName  the method name
   * @param  index       the parameter index
   * @see                com.sun.star.lib.uno.ParameterTypeInfo
   */
  static private ParameterTypeInfo __findParameterTypeInfo(TypeInfo typeInfos[], String methodName, int index) {
    ParameterTypeInfo parameterTypeInfo = null;

    if(typeInfos != null)
      for(int i = 0; i < typeInfos.length; ++ i) {
        if(typeInfos[i] instanceof ParameterTypeInfo
        && (index == ((ParameterTypeInfo)typeInfos[i]).getIndex())
View Full Code Here

    int superOffset = 0;

    if(_class == com.sun.star.uno.XInterface.class) { // take special care for xinterface
        MethodDescription queryInterface = new MethodDescription("queryInterface", 0, TypeInfo.ANY);
      queryInterface.init(new Class[]{Type.class}, new ParameterTypeInfo[]{new ParameterTypeInfo(null, "queryInterface", 0, 0)},
                          Object.class);

      MethodDescription acquire = new MethodDescription("acquire", 1, TypeInfo.ONEWAY);
      acquire.init(new Class[0], null, Void.class);

      MethodDescription release = new MethodDescription("release", 2, TypeInfo.ONEWAY);
      release.init(new Class[0], null, Void.class);

      methodDescriptionsByName.put("queryInterface", queryInterface);
      methodDescriptionsByName.put("acquire", acquire);
      methodDescriptionsByName.put("release", release);

      _offset = 3;
    }
    else {
      if(_superType != null) // do we have a supertype (we don't have one, if we are not derived of XInterface)
        superOffset = _superType._offset;

      TypeInfo typeInfos[] = __getTypeInfos(_class);
      Method methods[] = _class.getMethods();
     
      for(int i = 0; i < methods.length; ++ i) {
        Class parameters[] = methods[i].getParameterTypes();
        ParameterTypeInfo parameterTypeInfos[] = new ParameterTypeInfo[parameters.length];
       
        MethodTypeInfo methodTypeInfo = __findMethodTypeInfo(typeInfos, methods[i].getName());
        MethodDescription methodDescription = null;

        if(methodTypeInfo != null) { // this is a idl method
          methodDescription = new MethodDescription(methodTypeInfo);

          for(int j = 0; j < parameters.length; ++ j)
            parameterTypeInfos[j] = __findParameterTypeInfo(typeInfos, methods[i].getName(), j);
        }
        else {
          AttributeTypeInfo attributeTypeInfo = __findAttributeTypeInfo(typeInfos, methods[i].getName().substring(3));
         
          if(attributeTypeInfo != null) {
            if(methods[i].getName().substring(0, 3).equals("get")) // is the current a get method?
              methodDescription = new MethodDescription(methods[i].getName(), attributeTypeInfo.getIndex(), attributeTypeInfo.getFlags());
           
            else {
              methodDescription = new MethodDescription(methods[i].getName(), attributeTypeInfo.getIndex() + 1, 0);
              parameterTypeInfos = new ParameterTypeInfo[]{new ParameterTypeInfo("", methods[i].getName(), 0, attributeTypeInfo.getFlags())};
            }
          }
        }
       
        if(methodDescription != null) {
View Full Code Here

                    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;
                        }
                        if (p != null && p.isOUT()) {
                            out[j] = d;
                        }
                    }
                    Type t = info.getUnoType();
                    directList.add(
View Full Code Here

TOP

Related Classes of com.sun.star.lib.uno.typeinfo.ParameterTypeInfo

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.