1 26 27 package org.objectweb.jonas.security.realm.principals; 28 29 import java.io.Serializable ; 30 31 36 public class Role implements Serializable , RoleMBean { 37 38 41 private String name = null; 42 43 46 private String description = null; 47 48 51 public Role() { 52 53 } 54 55 59 public Role(String name) { 60 setName(name); 61 } 62 63 67 public void setName(String name) { 68 this.name = name; 69 } 70 71 75 public String getName() { 76 return name; 77 } 78 79 83 public void setDescription(String description) { 84 this.description = description; 85 } 86 87 91 public String getDescription() { 92 return description; 93 } 94 95 99 public String toXML() { 100 StringBuffer xml = new StringBuffer ("<role name=\""); 101 xml.append(name); 102 xml.append("\" description=\""); 103 if (description != null) { 104 xml.append(description); 105 } 106 xml.append("\" />"); 107 return xml.toString(); 108 } 109 110 114 public String toString() { 115 return this.toXML(); 116 } 117 118 } | Popular Tags |