You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by d....@searchspace.com on 2003/01/10 18:57:36 UTC

Deserializers

I have an object that can only be instantiated when a particular field is
known. This field is immutable. What is the best way to construct a
deserializer for this object? (without having to completely rewrite the
functionality provided by DeserializerImpl for example).
 
e.g.
 
public class DummyClass {
 
    public DummyClass (int id, String value){
            this.id = id;
            this.value = value;
    }
 
    public int getId(){
        return this.id;
    }
 
    public String getValue(){
        return this.value;
    }
 
}
 
 

Re: Deserializers

Posted by Benjamin Tomasini <bt...@neteverything.com>.
I would wrap it in a JavaBean and use BeanSerialzer.

public class Bean {

  private String id = null;
  private String name = null;

  // Getters and setters for id and name below

  public DummyClass getDummyClass() {

    DummyClass dummyClass = new DummyClass(id,value);

    // Do other sets here

    return dummyClass;

  }

}

On Fri, 2003-01-10 at 12:57, d.martin@searchspace.com wrote:
> I have an object that can only be instantiated when a particular field is
> known. This field is immutable. What is the best way to construct a
> deserializer for this object? (without having to completely rewrite the
> functionality provided by DeserializerImpl for example).
>  
> e.g.
>  
> public class DummyClass {
>  
>     public DummyClass (int id, String value){
>             this.id = id;
>             this.value = value;
>     }
>  
>     public int getId(){
>         return this.id;
>     }
>  
>     public String getValue(){
>         return this.value;
>     }
>  
> }
>  
>