Methods Summary |
---|
public java.lang.Object | clone()Clone the role object.
try {
return new Role(name, objectNameList);
} catch (IllegalArgumentException exc) {
return null; // can't happen
}
|
public java.lang.String | getRoleName()Retrieves role name.
return name;
|
public java.util.List | getRoleValue()Retrieves role value.
return objectNameList;
|
private void | readObject(java.io.ObjectInputStream in)Deserializes a {@link Role} from an {@link ObjectInputStream}.
if (compat)
{
// Read an object serialized in the old serial form
//
ObjectInputStream.GetField fields = in.readFields();
name = (String) fields.get("myName", null);
if (fields.defaulted("myName"))
{
throw new NullPointerException("myName");
}
objectNameList = (List<ObjectName>) fields.get("myObjNameList", null);
if (fields.defaulted("myObjNameList"))
{
throw new NullPointerException("myObjNameList");
}
}
else
{
// Read an object serialized in the new serial form
//
in.defaultReadObject();
}
|
public static java.lang.String | roleValueToString(java.util.List roleValue)Returns a string for the given role value.
if (roleValue == null) {
String excMsg = "Invalid parameter";
throw new IllegalArgumentException(excMsg);
}
StringBuilder result = new StringBuilder();
for (ObjectName currObjName : roleValue) {
if (result.length() > 0)
result.append("\n");
result.append(currObjName.toString());
}
return result.toString();
|
public void | setRoleName(java.lang.String roleName)Sets role name.
if (roleName == null) {
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
name = roleName;
return;
|
public void | setRoleValue(java.util.List roleValue)Sets role value.
if (roleValue == null) {
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
objectNameList = new ArrayList<ObjectName>(roleValue);
return;
|
public java.lang.String | toString()Returns a string describing the role.
StringBuffer result = new StringBuffer();
result.append("role name: " + name + "; role value: ");
for (Iterator objNameIter = objectNameList.iterator();
objNameIter.hasNext();) {
ObjectName currObjName = (ObjectName)(objNameIter.next());
result.append(currObjName.toString());
if (objNameIter.hasNext()) {
result.append(", ");
}
}
return result.toString();
|
private void | writeObject(java.io.ObjectOutputStream out)Serializes a {@link Role} to an {@link ObjectOutputStream}.
if (compat)
{
// Serializes this instance in the old serial form
//
ObjectOutputStream.PutField fields = out.putFields();
fields.put("myName", name);
fields.put("myObjNameList", (ArrayList)objectNameList);
out.writeFields();
}
else
{
// Serializes this instance in the new serial form
//
out.defaultWriteObject();
}
|