1 22 package org.jboss.aop.util; 23 24 import java.io.ObjectStreamException ; 25 import java.io.Serializable ; 26 import java.util.ArrayList ; 27 28 31 public final class PayloadKey implements Serializable 32 { 33 34 static final long serialVersionUID = 7688683906350419871L; 35 36 private static int nextOrdinal = 0; 38 39 private static final ArrayList values = new ArrayList (3); 40 41 42 public final static PayloadKey TRANSIENT = new PayloadKey("TRANSIENT"); 43 44 45 public final static PayloadKey AS_IS = new PayloadKey("AS_IS"); 46 47 48 public final static PayloadKey MARSHALLED = new PayloadKey("MARSHALLED"); 49 50 private final transient String name; 51 52 private final int ordinal; 54 55 private PayloadKey(String name) 56 { 57 this.name = name; 58 this.ordinal = nextOrdinal++; 59 values.add(this); 60 } 61 62 public String toString() 63 { 64 return name; 65 } 66 67 Object readResolve() throws ObjectStreamException 68 { 69 return values.get(ordinal); 70 } 71 } 72 | Popular Tags |