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) 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 theRoleValue)Returns a string for the given role value.
if (theRoleValue == null) {
String excMsg = "Invalid parameter";
throw new IllegalArgumentException(excMsg);
}
StringBuffer result = new StringBuffer();
for (Iterator objNameIter = theRoleValue.iterator();
objNameIter.hasNext();) {
ObjectName currObjName = (ObjectName)(objNameIter.next());
result.append(currObjName.toString());
if (objNameIter.hasNext()) {
result.append("\n");
}
}
return result.toString();
|
public void | setRoleName(java.lang.String theRoleName)Sets role name.
if (theRoleName == null) {
// Revisit [cebro] Localize message
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
name = theRoleName;
return;
|
public void | setRoleValue(java.util.List theRoleValue)Sets role value.
if (theRoleValue == null) {
// Revisit [cebro] Localize message
String excMsg = "Invalid parameter.";
throw new IllegalArgumentException(excMsg);
}
objectNameList = new ArrayList(theRoleValue);
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();
}
|