Last change
on this file since 8699 was 5800, checked in by cs025, 21 years ago |
Adding gs3build
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.3 KB
|
Line | |
---|
1 | package org.greenstone.gsdl3.gs3build.metadata;
|
---|
2 |
|
---|
3 | public class METSAgent
|
---|
4 | {
|
---|
5 | String name;
|
---|
6 | String note;
|
---|
7 |
|
---|
8 | String role;
|
---|
9 | String otherrole;
|
---|
10 | String type;
|
---|
11 | String othertype;
|
---|
12 |
|
---|
13 | public METSAgent(String name, String note, String role, String type)
|
---|
14 | { this.name = name;
|
---|
15 | this.note = note;
|
---|
16 |
|
---|
17 | this.setRole(role);
|
---|
18 | this.setType(type);
|
---|
19 | }
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Check if the role matches one of the standard offerings
|
---|
23 | */
|
---|
24 | private boolean validateRole(String role)
|
---|
25 | { return true;
|
---|
26 | }
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Check if the type matches one of the standard offerings
|
---|
30 | */
|
---|
31 | private boolean validateType(String role)
|
---|
32 | { if (role.equals("INDIVIDUAL") ||
|
---|
33 | role.equals("ORGANIZATION")) {
|
---|
34 | return true;
|
---|
35 | }
|
---|
36 | return false;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public void setRole(String otherRole)
|
---|
40 | { // automatically use 'OTHER' if either the role or type of agent don't
|
---|
41 | // validate against the standard list
|
---|
42 | if (this.validateRole(role)) {
|
---|
43 | this.role = role;
|
---|
44 | this.otherrole = null;
|
---|
45 | }
|
---|
46 | else {
|
---|
47 | this.role = "OTHER";
|
---|
48 | this.otherrole = role;
|
---|
49 | }
|
---|
50 | }
|
---|
51 |
|
---|
52 | public void setType(String otherType)
|
---|
53 | { // automatically use 'OTHER' if either the role or type of agent don't
|
---|
54 | // validate against the standard list
|
---|
55 | if (this.validateType(type)) {
|
---|
56 | this.type = type;
|
---|
57 | this.othertype = null;
|
---|
58 | }
|
---|
59 | else {
|
---|
60 | this.type = "OTHER";
|
---|
61 | this.othertype = type;
|
---|
62 | }
|
---|
63 | }
|
---|
64 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.