public void setAsText(String text) {
if (text != null) {
String[] parts = text.split("=");
if (parts.length != 2) {
throw new PropertyEditorException("Principal should have the form 'name=class'");
}
Principal principal = new Principal();
principal.setPrincipalName(parts[0]);
principal.setClassName(parts[1]);
setValue(principal);