title: @XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML
body: <p>how to pick the value of an attribute 'name' which is a  PriceEventName class type   in the below case, FYI if i put @XmlAttribute above it this is turn out to an exception "an error @XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML"
  I looking heavily on the internet but I didn't find something similar to my case </p>
  
  <pre><code>PriceEvent class
  
  package somepackage
  import ...
  import 
  @XmlAccessorType(XmlAccessType.FIELD)
  
      public class PriceEvent {
          @XmlElement(name="Message",namespace="someValue")
          private String color;
  
          private PriceEventName name;// this is an attribute 
          .
          .
      }
  </code></pre>
  
  <p>PriceEventName class</p>
  
  <pre><code>Imports ...
  
  public class PriceEventName {
  
      public static final int PRICEUPDATE_TYPE = 0;
      public static final PriceEventName PRICEUPDATE = new PriceEventName(PRICEUPDATE_TYPE, "X-mas");
      private static java.util.Hashtable _memberTable = init();
      private static java.util.Hashtable init() {
          Hashtable members = new Hashtable();
          members.put("X-mas", PRICEUPDATE);
          return members;
      }
  
      private final int type;
      private java.lang.String stringValue = null;
  
          public PriceEventName(final int type, final java.lang.String value) {
          this.type = type;
          this.stringValue = value;
      }
  
      public static PriceEventName valueOf(final java.lang.String string) {
          java.lang.Object obj = null;
          if (string != null) {
              obj = _memberTable.get(string);
          }
          if (obj == null) {
              String err = "" + string + " is not a valid PriceEventName";
              throw new IllegalArgumentException(err);
          }
          return (PriceEventName) obj;
          }
  }
  </code></pre>