Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.StructValue


 
  /** @throws Exception */
  @Test
  public void good_scalar() throws Exception
  {
    testgoodvalue( 0, new StructValue( abc, vf ) );
  }
View Full Code Here


    testbadvalue( 0, 5.5f );
    testbadvalue( 0, 6.6 );
    testbadvalue( 0, "" );
    testbadvalue( 0, "abc" );
    testbadvalue( 0, new Object() );
    testbadvalue( 0, new StructValue( new Type( "def" ), vf ) );
    testbadvalue( 0, new Date() );

    testbadvalue( 1, null );
    testbadvalue( 1, false );
    testbadvalue( 1, true );
    testbadvalue( 1, (byte) 1 );
    testbadvalue( 1, (short) 2222 );
    testbadvalue( 1, 333333 );
    testbadvalue( 1, 4444444444444444L );
    testbadvalue( 1, 5.5f );
    testbadvalue( 1, 6.6 );
    testbadvalue( 1, "" );
    testbadvalue( 1, "abc" );
    testbadvalue( 1, new Object() );
    testbadvalue( 1, new StructValue( abc, vf ) );
    testbadvalue( 1, new Date() );
  }
View Full Code Here

    testbadvalue( 0, 5.5f );
    testbadvalue( 0, 6.6 );
    testbadvalue( 0, "" );
    testbadvalue( 0, "abc" );
    testbadvalue( 0, new Object() );
    testbadvalue( 0, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 0, new Date() );

    testbadvalue( 1, null );
    testbadvalue( 1, false );
    testbadvalue( 1, true );
    testbadvalue( 1, (byte) 1 );
    testbadvalue( 1, (short) 2222 );
    testbadvalue( 1, 333333 );
    testbadvalue( 1, 4444444444444444L );
    testbadvalue( 1, 5.5f );
    testbadvalue( 1, 6.6 );
    testbadvalue( 1, "" );
    testbadvalue( 1, "abc" );
    testbadvalue( 1, new Object() );
    testbadvalue( 1, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 1, new Date() );
  }
View Full Code Here

    testbadvalue( 0, 5.5f );
    testbadvalue( 0, 6.6 );
    testbadvalue( 0, "" );
    testbadvalue( 0, "abc" );
    testbadvalue( 0, new Object() );
    testbadvalue( 0, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 0, new Date() );

    testbadvalue( 1, null );
    testbadvalue( 1, false );
    testbadvalue( 1, true );
    testbadvalue( 1, (byte) 1 );
    testbadvalue( 1, (short) 2222 );
    testbadvalue( 1, 333333 );
    testbadvalue( 1, 4444444444444444L );
    testbadvalue( 1, 5.5f );
    testbadvalue( 1, 6.6 );
    testbadvalue( 1, "" );
    testbadvalue( 1, "abc" );
    testbadvalue( 1, new Object() );
    testbadvalue( 1, new StructValue( new Type( "abc" ), vf ) );
    testbadvalue( 1, new Date() );
  }
View Full Code Here

    }
  }

  private StructValue readStruct() throws IOException
  {
    StructValue sv = startStruct();
    readKeysAndValues( sv );
    endStruct( sv );
    return sv;
  }
View Full Code Here

  private StructValue startStruct() throws IOException
  {
    Type t = readType();
    int length = readLength();
   
    return new StructValue( t, vf, length );
  }
View Full Code Here

        writeBytes( ((String) value).getBytes( vf.getStringEncoding() ) );
        return;
     
      case TypeCode.CUSTOM:
      {
        StructValue struct = vf.exportCustomValue( value );
       
        if (struct == null)
          throw new UnsupportedOperationException( "unsupported type "+value.getClass() );
       
        writeStruct( struct );
View Full Code Here

 
  private final Field field;
 
  public StructValue exportValue( ValueFactory vf, Object value )
  {
    StructValue sv = new StructValue( type, vf );
    sv.put( field, value.toString() );
    return sv;
  }
View Full Code Here

 
  private final Field field;

  public StructValue exportValue( ValueFactory vf, Object value )
  {
    StructValue sv = new StructValue( type, vf );
    sv.put( field, value.toString() );
    return sv;
  }
View Full Code Here

   
    Type type = getCustomStructType( clss );
   
    if (type == null && clss == StructValue.class)
    {
      StructValue struct = (StructValue) value;
      type = struct.type();
    }
   
    if (type == null)
    {
      if (Throwable.class.isAssignableFrom( clss ))
View Full Code Here

TOP

Related Classes of etch.bindings.java.msg.StructValue

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.