axis_examplecompt_changesinfo-opsversion-2.00version-3.01version-3.02
Last change
on this file since e794984 was
8780cbec,
checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago
|
ABAC sources from Cobham
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | package edu.stanford.rt.credential; |
---|
2 | |
---|
3 | |
---|
4 | /** |
---|
5 | * @author Ninghui Li, Sandra Qiu<br> |
---|
6 | * |
---|
7 | * Implementation of <code>LinkedRole</code> element. |
---|
8 | */ |
---|
9 | public class LinkedRole implements PrincipalExpression |
---|
10 | { |
---|
11 | private RoleTerm roleTerm1; // required element. |
---|
12 | private RoleTerm roleTerm2; // required element. |
---|
13 | |
---|
14 | /** |
---|
15 | * Constructor for LinkedRole. |
---|
16 | */ |
---|
17 | public LinkedRole(RoleTerm term1, RoleTerm term2) |
---|
18 | { |
---|
19 | roleTerm1 = term1; |
---|
20 | roleTerm2 = term2; |
---|
21 | } |
---|
22 | |
---|
23 | /** |
---|
24 | * Accessor method for the role terms. |
---|
25 | */ |
---|
26 | public RoleTerm getRoleTermAt(int index) { |
---|
27 | switch(index) { |
---|
28 | case 0: |
---|
29 | return roleTerm1; |
---|
30 | case 1: |
---|
31 | return roleTerm2; |
---|
32 | default: |
---|
33 | return null; |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | /** |
---|
38 | * @see edu.stanford.rt.credential.PrincipalExpression#toString(String) |
---|
39 | */ |
---|
40 | public String toString(String indent) |
---|
41 | { |
---|
42 | String thisIndent = indent + " "; |
---|
43 | |
---|
44 | StringBuffer sb = new StringBuffer(); |
---|
45 | sb.append(thisIndent).append("Linked Role: \n"); |
---|
46 | sb |
---|
47 | .append(thisIndent + " ") |
---|
48 | .append(roleTerm1.toString(thisIndent + " ")) |
---|
49 | .append("\n"); |
---|
50 | sb |
---|
51 | .append(thisIndent + " ") |
---|
52 | .append(roleTerm2.toString(thisIndent + " ")) |
---|
53 | .append("\n"); |
---|
54 | return sb.toString(); |
---|
55 | } |
---|
56 | |
---|
57 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.