Package com.sun.star.uno

Examples of com.sun.star.uno.ITypeDescription


    _inputStream          = new ByteArrayInputStream(new byte[0]);
    _dataInput            = new DataInputStream(_inputStream);
  }

    Object readAny() {
        ITypeDescription t = readTypeDescription();
        switch (t.getTypeClass().getValue()) {
        case TypeClass.VOID_value:
            return Any.VOID;
        case TypeClass.CHAR_value:
            return readCharacter();
        case TypeClass.BOOLEAN_value:
            return readBoolean();
        case TypeClass.BYTE_value:
            return readByte();
        case TypeClass.SHORT_value:
            return readShort();
        case TypeClass.UNSIGNED_SHORT_value:
            return new Any(Type.UNSIGNED_SHORT, readShort());
        case TypeClass.LONG_value:
            return readInteger();
        case TypeClass.UNSIGNED_LONG_value:
            return new Any(Type.UNSIGNED_LONG, readInteger());
        case TypeClass.HYPER_value:
            return readLong();
        case TypeClass.UNSIGNED_HYPER_value:
            return new Any(Type.UNSIGNED_HYPER, readLong());
        case TypeClass.FLOAT_value:
            return readFloat();
        case TypeClass.DOUBLE_value:
            return readDouble();
        case TypeClass.STRING_value:
            return readString();
        case TypeClass.TYPE_value:
            return new Type(readTypeDescription());
        case TypeClass.ENUM_value:
            return readEnum(t);
        case TypeClass.STRUCT_value:
            return readStruct(t);
        case TypeClass.EXCEPTION_value:
            return readThrowable(t);
        case TypeClass.SEQUENCE_value:
            Object os = readSequence(t);
            ITypeDescription tc = t.getComponentType();
            while (tc.getTypeClass() == TypeClass.SEQUENCE) {
                tc = tc.getComponentType();
            }
            switch (tc.getTypeClass().getValue()) {
            case TypeClass.UNSIGNED_SHORT_value:
            case TypeClass.UNSIGNED_LONG_value:
            case TypeClass.UNSIGNED_HYPER_value:
                return new Any(new Type(t), os);
            default:
View Full Code Here


  ITypeDescription readTypeDescription() {
    int typeClassValue = readunsignedbyte() & 0xff;

    TypeClass typeClass = TypeClass.fromInt(typeClassValue & 0x7f);
    ITypeDescription iTypeDescription = null;

    if(TypeDescription.isTypeClassSimple(typeClass)) // is it a simple type?
      iTypeDescription = TypeDescription.getTypeDescription(typeClass);

    else {
View Full Code Here

      _in_threadId = _unmarshal.readThreadId();
   
    // get the out signature and parameter array of the reply
    Object objects[] = (Object[])removePendingRequest(_in_threadId);
    Object param[] = (Object[])objects[0];
    ITypeDescription signature[] = (ITypeDescription[])objects[1];
    ITypeDescription resultType = (ITypeDescription)objects[2];
   
    exception[0] = (header & EXCEPTION) != 0;
    if(exception[0]) {// Exception? So the reply has an any as the result
      signature = __emptyITypeDescArray;
      resultType = TypeDescription.__any_TypeDescription;
View Full Code Here

    return result;
  }


  private Object []readParams(IMethodDescription iMethodDescription) {
    ITypeDescription in_sig[] = iMethodDescription.getInSignature();
    ITypeDescription out_sig[] = iMethodDescription.getOutSignature();

    Object params[] = new Object[in_sig.length];
   
    for(int i = 0; i < params.length; ++ i) {
      if(in_sig[i] != null) // is it an in parameter?
View Full Code Here

        _marshal.writebyte((byte)(iMethodDescription.getIndex() & 0xff));
      }
    }
   
    // write the in parameters
    ITypeDescription in_sig[] = iMethodDescription.getInSignature();
    ITypeDescription out_sig[] = iMethodDescription.getOutSignature();
    for(int i = 0; i < in_sig.length; ++ i) {
      if(in_sig[i] != null) { // is it an in parameter?
        if(out_sig[i] != null// is it also an out parameter?
          _marshal.writeObject(out_sig[i].getComponentType(), ((Object [])params[i])[0]);
        else // in only
View Full Code Here

    ++ _message_count;

    Object objects[] = (Object[])removePendingReply(threadId);
    Object params[] = (Object[])objects[0];
    ITypeDescription signature[] = (ITypeDescription[])objects[1];
    ITypeDescription resType     = (ITypeDescription)objects[2];
   
    byte header = BIG_HEADER; // big header
   
    if(exception) { // has an exception occurred?
      header |= EXCEPTION;
View Full Code Here

        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

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

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.