RE: Re: Issue 1: Adding additional conneg metadata to _at_Produce/ConsumeXXX

From: Larry Cable <>
Date: Fri, 18 May 2007 16:08:11 -0700

although I think it is stretching/breaking the meaning of an enumeration and introducing these constants as enums may make their usage harder rather than simpler actually we could ala:
public enum Language {
     // ...
     private Language(final String l) { language = l;}
     public boolean equals(Object o) { return language.equals(o); }
     public int hashCode() { return language.hashCode(); }
     public String toString() { return language.toString(); }
     private final String language;
public enum MediaType {
    public final static String APPLICATION = "APPLICATION";
    // ...
   // ...
   private MediaType(String t, String st) { type = t; subtype = st; }
   public boolean equals(Object o) {
       // ...
   public int hashCode() {
      // ...
   public String toString() {
      return type + "/" + subtype;
   public String getType() { return type; }
   public String getSubtype() { return subType; }
   private final String type;
   private final String subtype;
the problem I see with that is that if we did not provide a rich enough set of values in the enum a developer would
be forced to extend that set by inheritance ... so maybe just simple string constants will be enough
- Larry


From: Dhanji R. Prasanna []
Sent: Fri 5/18/2007 3:22 PM
Subject: Re: Issue 1: Adding additional conneg metadata to @Produce/ConsumeXXX

On 5/18/07, Larry Cable <> wrote:

        @ProduceXXX(value=APPLICATION_XML, language=EN)

+1 on the constant reference-safety. I wish there were a way to use enums here. too =(


Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.