[
https://jira.jboss.org/jira/browse/JBXB-209?page=com.atlassian.jira.plugi...
]
Thomas Diesler commented on JBXB-209:
-------------------------------------
If I change the type name to
public enum TAvailability
{
mandatory("mandatory"),
optional("optional");
...
}
(which is not a recommended enum type name) - it seems to work
Enum parsing requires value equal to type name
----------------------------------------------
Key: JBXB-209
URL:
https://jira.jboss.org/jira/browse/JBXB-209
Project: JBoss XML Binding (JBossXB)
Issue Type: Bug
Affects Versions: JBossXB-2.0.1.GA
Reporter: Thomas Diesler
Caused by: java.lang.RuntimeException: Invalid value mandatory valid are [MANDATORY,
OPTIONAL]
at org.jboss.xb.builder.runtime.EnumValueAdapter.cast(EnumValueAdapter.java:136)
at
org.jboss.xb.builder.runtime.AbstractPropertyHandler.attribute(AbstractPropertyHandler.java:115)
at
org.jboss.xb.binding.sunday.unmarshalling.AttributesHandler.attributes(AttributesHandler.java:51)
at
org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler.attributes(DefaultElementHandler.java:65)
at org.jboss.xb.builder.runtime.BeanHandler.startParticle(BeanHandler.java:124)
at
org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:630)
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
public enum TAvailability
{
MANDATORY("mandatory"),
OPTIONAL("optional");
private final String value;
TAvailability(String v)
{
value = v;
}
public String value()
{
return value;
}
public static TAvailability fromValue(String v)
{
for (TAvailability c : TAvailability.values())
{
if (c.value.equals(v))
{
return c;
}
}
throw new IllegalArgumentException(v);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira