[jboss-dev-forums] [Design of JBossXB] - Re: Extending EnumValueAdapter

alesj do-not-reply at jboss.com
Tue Mar 18 09:59:07 EDT 2008


"adrian at jboss.org" wrote : 
  | I naturally assumed you didn't understand how it works or the idea
  | that is supposed to be declaritive (annotation based).
  | 
Claiming not understanding something as simple as a single class with the size of 20+ lines is low. ;-)

What is declarative is debatable.
Adding @JBossXxmlEnum(ignore=true) to my (although it was never written down, this is what I had in mind) @ValueAdapter(CaseIgnoreEnumAdapter.class) is not that far apart. 

"adrian at jboss.org" wrote : 
  | This was confirmed to me when you kept asking questions
  | instead of trying to understand how it really worked.
  | 
  | Claiming to have a working implementation of a new feature when you're not showing and understanding of how the old stuff works is obviously a "red flag".
  | 
  | Problems:
  | 1) Why should we let you modify something you don't understand?
  | 2) Why should we continue to answer questions when you haven't tried to understand it for yourself?
  | 
Claiming constant 'not understanding' won't make your semi-detailed answers go away. :-)

Let's look at the history:
"adrian at jboss.org" wrote : 
  | Then when constructing the map of valid values and doing the lookups
  | convert the xml values to lower case if the "ignoreCase" is true. 
  | 
Not all values can be converted to lower case:
"adrian at jboss.org" wrote : 
  | Yes. Obviously, you can't ignore case on an integer. ;-)
  | 

Next one:
"adrian at jboss.org" wrote : 
  | Everything is a String in xml :-)
  | 
And we got this from additional drill-down:
"adrian at jboss.org" wrote : 
  | "alesj" wrote : 
  |   | Who makes sure "1" is passed into EVA::cast as an Integer?
  |   | 
  | Its the xsd:type (or technically its parent type) of the attribute/element.
  | 

This one also isn't as obvious as it could be:
"adrian at jboss.org" wrote : 
  | 
  |   | @XmlEnum(type=Integer.class)
  |   | @JBossXmlEnum(ignoreCase=true)
  |   | public enum  Numbers
  |   | {
  |   |    @XmlEnumValue("ONE")
  |   |    ONE(1),
  |   | }
  |   | 
  | 
Defining Integer type + explicit String enum value.
OK, I'll can pass this one to 's&s' principle.
Though my first idea tells me that Integer.parse in IntegerEditor will complain since it will get passed "ONE". 
Or it could be that perhaps I again don't understand. ;-)



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137420#4137420

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137420



More information about the jboss-dev-forums mailing list