Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.Field


   * @param type
   * @param class2type
   */
  public static void init( Type type, Class2TypeMap class2type )
  {
    Field field = type.getField( FIELD_NAME );
    class2type.put( URL.class, type );
    type.setComponentType( URL.class );
    type.setImportExportHelper( new URLSerializer( type, field ) );
    type.putValidator( field, Validator_string.get( 0 ) );
    type.lock();
View Full Code Here


   * @param type
   * @param class2type
   */
  public static void init( Type type, Class2TypeMap class2type )
    {
    Field field = type.getField( FIELD_NAME );
    class2type.put( StrIntHashMap.class, type );
    type.setComponentType( StrIntHashMap.class );
    type.setImportExportHelper( new StrIntHashMapSerializer( type, field ) );
    type.putValidator( field, Validator_object.get( 1 ) );
    type.lock();
View Full Code Here

//    Log.report( "KeepAliveInstalled",
//      "delay", delay, "count", count, "server", server );
   
    vf = (ValueFactory) resources.get( Transport.VALUE_FACTORY );

    mf_delay = new Field( "delay" );
    mf_count = new Field( "count" );
   
    mt_request = new Type( "_Etch_KeepAliveReq" );
    mt_request.putValidator( mf_delay, Validator_int.get( 0 ) );
    mt_request.putValidator( mf_count, Validator_int.get( 0 ) );
    vf.addType( mt_request );
View Full Code Here

   * @param type
   * @param class2type
   */
  public static void init( Type type, Class2TypeMap class2type )
  {
    Field field = type.getField( FIELD_NAME );
    class2type.put( _Etch_AuthException.class, type );
    type.setComponentType( _Etch_AuthException.class );
    type.setImportExportHelper( new AuthExceptionSerializer( type, field ) );
    type.putValidator( field, Validator_string.get( 0 ) );
    type.lock();
View Full Code Here

   */
  @Test public void test_add() throws Exception
  {
    Type add = vf.getType( "add" );
   
    Field x = new Field( "x" );
    add.putValidator( x, Validator_int.get( 0 ) );
   
    Field y = new Field( "y" );
    add.putValidator( y, Validator_int.get( 0 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    add.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0102030405060708L;
   
//    System.out.printf( "add.id() = %04x\n", add.getId() );
View Full Code Here

   * @throws Exception */
  @Test public void test_add_in() throws Exception
  {
    Type add = vf.getType( "add" );
   
    Field x = new Field( "x" );
    add.putValidator( x, Validator_int.get( 0 ) );
   
    Field y = new Field( "y" );
    add.putValidator( y, Validator_int.get( 0 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    add.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0123456789abcdefL;

    byte[] buf =
View Full Code Here

   * @throws Exception */
  @Test public void test_add_perf() throws Exception
  {
    Type add = vf.getType( "add" );
   
    Field x = new Field( "x" );
    add.putValidator( x, Validator_int.get( 0 ) );
   
    Field y = new Field( "y" );
    add.putValidator( y, Validator_int.get( 0 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    add.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0123456789abcdefL;
   
//    System.out.printf( "add.id() = %04x\n", add.getId() );
View Full Code Here

   * @throws Exception */
  @Test public void test_sum_perf() throws Exception
  {
    Type sum = vf.getType( "sum" );
   
    Field values = new Field( "values" );
    sum.putValidator( values, Validator_int.get( 1 ) );
   
    Field _mf__messageId = DefaultValueFactory._mf__messageId;
    sum.putValidator( _mf__messageId, Validator_long.get( 0 ) );
   
    long msgid = 0x0123456789abcdefL;
   
//    System.out.printf( "add.id() = %04x\n", add.getId() );
View Full Code Here

  }
 
  private void assertValueToBytes( Object value, byte[] expectedBytes ) throws Exception
  {
    Type t = new Type( 1, "a" );
    Field f = new Field( 2, "b" );
    t.putValidator( f, Validator_object.get( 0 ) );
   
    Message msg = new Message( t, vf );
    msg.put( f, value );
//    System.out.println( "msg = "+msg );
View Full Code Here

   * @param type
   * @param class2type
   */
  public static void init( Type type, Class2TypeMap class2type )
    {
    Field field = type.getField( FIELD_NAME );
   
    // quick lookup to serialize this class.
    class2type.put( HashMap.class, type );
   
    // type for arrays.
View Full Code Here

TOP

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

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.