2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.persistence
.hibernate
.permission
;
11 import eu
.etaxonomy
.cdm
.model
.CdmBaseType
;
12 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
15 * see also {@link CdmBaseType}
18 * @author a.kohlbecker
21 public enum CdmPermissionClass
{
24 DESCRIPTIONELEMENTBASE
,
34 * return the appropriate CdmPermissionClass for the given Object
37 * @return the CdmPermissionClass or null
39 public static CdmPermissionClass
getValueOf(CdmBase o
){
40 return CdmPermissionClass
.getValueOf(o
.getClass());
46 * return the appropriate CdmPermissionClass for the given Object
49 * @return the CdmPermissionClass or null
51 public static CdmPermissionClass
getValueOf(Class o
){
54 return CdmPermissionClass
.valueOf(o
.getSimpleName().toUpperCase());
55 } catch(IllegalArgumentException e
){
56 if (CdmBase
.class.isAssignableFrom(o
)){
57 return getValueOf(o
.getSuperclass());