Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.Type


  public void put( Class<?> c, Type t )
  {
    if (locked)
      throw new IllegalStateException( "locked" );
   
    Type x = c2t.get( c );
    if (x != null)
    {
      if (!x.equals( t ))
        throw new IllegalArgumentException( String.format(
          "type %s: class %s is already mapped to type %s",
          t, c, x ) );
     
      // x.equals( t ) therefore our work is finished.
View Full Code Here


  }

  private void readKeysAndValues( StructValue sv )
    throws IOException
  {
    Type t = sv.type();
    while (true)
    {
      Field key = readField( t );
      if (key == null)
        break;
     
      Validator v = t.getValidator( key );
      if (v != null)
      {
        sv.put( key, readValue( v ) );
      }
      else
View Full Code Here

      throw new IOException(
        String.format(
          "binary tagged data version mismatch: got %d expected %d",
          version, VERSION ) );
   
    Type t = readType();
    int length = readLength();
   
    return new Message( t, vf, length );
  }
View Full Code Here

    // nothing to do, readKeysAndValues swallowed the NONE.
  }

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

  @SuppressWarnings("deprecation")
  private ArrayValue startArray() throws IOException
  {
    byte type = buf.getByte();
   
    Type customStructType;
    if (type == TypeCode.CUSTOM || type == TypeCode.STRUCT)
      customStructType = readType();
    else
      customStructType = null;
   
View Full Code Here

    Object obj = readValue( intOrStrValidator, false );
   
    if (obj instanceof Integer)
    {
      Integer id = (Integer) obj;
      Type type = vf.getType( id );
     
      if (type == null)
        type = new Type( id, id.toString() );
     
      return type;
    }
   
    Assertion.check( obj instanceof String, "obj instanceof String" );
    String name = (String) obj;
    Type type = vf.getType( name );
   
    if (type == null)
      type = new Type( name );
   
    return type;
  }
View Full Code Here

    endArray( av );
  }

  private void writeKeysAndValues( StructValue sv ) throws IOException
  {
    Type t = sv.type();
    for (Map.Entry<Field, Object> me: sv)
    {
      Field f = me.getKey();
      writeField( f );
      writeValue( t.getValidator( f ), me.getValue() );
    }
  }
View Full Code Here

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

    mt_request = new Type( "_Etch_PwAuthReq" );
    mt_response = new Type( "_Etch_PwAuthResp" );
   
    vf.addType( mt_request );
    vf.addType( mt_response );
   
    mf_user = new Field( "user" );
View Full Code Here

    TagElement te = new XmlParser().parseOne( rdr, null, MESSAGE_TAG );
    stack.push( te );
    elementList.push( te.getChildren() );
   
    Integer id = te.getIntAttr( null, STRUCT_TYPE_ATTR );
    Type type = vf.getType( id );
    return new Message( type, vf );
  }
View Full Code Here

  {
    TagElement te = stack.peek();
    elementList.push( te.getChildren() );
   
    Integer id = te.getIntAttr( null, STRUCT_TYPE_ATTR );
    Type type = vf.getType( id );
    return new StructValue( type, vf );
  }
View Full Code Here

TOP

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

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.