Hi,

can I please ask you to attach all relevant files to a new Jira issue
(http://jira.codehaus.org/browse/CASTOR) so that we can replay this
problem ?

Regards
Werner

darrickc wrote:
> I'm having an issue where I'm trying to map a simple enum (below) and I keep
> getting exceptions from Castor (1.2) when trying to load the mapping file.
> Here is the exception
> org.exolab.castor.mapping.MappingException: Could not find the class
> com.mycompany.messaging.myproduct.UserPartitionRights.Rights
> 
> 
> Here is the UserPartitionRights class:
> package com.mycompany.messaging.myproduct;
> public class UserPartitionRights
> {     
>       public enum Rights 
>       {
>               SeeJobs(ResourceType.Job), DeleteJobs(ResourceType.Job), 
>               ChangeJobStatus(ResourceType.Job), 
> ChangeJobSets(ResourceType.Job);
>                               
>               public final ResourceType resourceType;
>               
>               Rights(ResourceType type)
>               {
>                       resourceType = type;
>               }
>               
>               public static Rights fromValue(final String value) 
>               {
>               for (Rights c: Rights.values()) 
>               {
>                   if (Rights.valueOf( value ) == c ) 
>                   {
>                       return c;
>                   }
>               }
>               throw new IllegalArgumentException(value);
>           }
> 
>               
>       };
> 
> And here is the relevant section of my mapping file:
> 
> <class name="com.mycompany.messaging.myproduct.UserPartitionRights">
>       <field name="aRights"
> type="com.mycompany.messaging.myproduct.UserPartitionRights.Rights">
>                 <bind-xml name="aRights" />
>       </field>         
> </class>
> 
> My ultimate goal is to be able to (un)marshal an EnumMap<Rights, Boolean>... 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to