1 17 18 package org.apache.geronimo.security.jaas; 19 20 import org.apache.geronimo.common.propertyeditor.PropertyEditorException; 21 import org.apache.geronimo.common.propertyeditor.TextPropertyEditorSupport; 22 23 24 30 public class LoginModuleControlFlagEditor extends TextPropertyEditorSupport { 31 32 public LoginModuleControlFlagEditor() { 33 super(); 34 } 35 36 public LoginModuleControlFlagEditor(final Object source) { 37 super(source); 38 } 39 40 public Object getValue() { 41 if ("REQUIRED".equals(getAsText())) { 42 return LoginModuleControlFlag.REQUIRED; 43 } else if ("REQUISITE".equals(getAsText())) { 44 return LoginModuleControlFlag.REQUISITE; 45 } else if ("SUFFICIENT".equals(getAsText())) { 46 return LoginModuleControlFlag.SUFFICIENT; 47 } else if ("OPTIONAL".equals(getAsText())) { 48 return LoginModuleControlFlag.OPTIONAL; 49 } 50 throw new PropertyEditorException("Illegal value: '" + getAsText() + "'"); 51 } 52 } 53 | Popular Tags |