1 | public PropertyIterator iterator() {↵ | | 1 | public PropertyIterator iterator() {↵
|
2 | return getArguments().iterator();↵ | | 2 | return getArguments().iterator();↵
|
3 | }↵ | | 3 | }↵
|
|
4 | /**↵ | | 4 | /**↵
|
5 | * Create a string representation of the arguments.↵ | | 5 | * Create a string representation of the arguments.↵
|
6 | * ↵ | | 6 | * ↵
|
7 | * @return the string representation of the arguments↵ | | 7 | * @return the string representation of the arguments↵
|
8 | */↵ | | 8 | */↵
|
9 | public String toString() {↵ | | 9 | public String toString() {↵
|
10 | StringBuffer str = new StringBuffer();↵ | | 10 | StringBuffer str = new StringBuffer();↵
|
11 | PropertyIterator iter = getArguments().iterator();↵ | | 11 | PropertyIterator iter = getArguments().iterator();↵
|
12 | while (iter.hasNext()) {↵ | | 12 | while (iter.hasNext()) {↵
|
13 | Argument arg = (Argument) iter.next().getObjectValue();↵ | | 13 | LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();↵
|
14 | final String metaData = arg.getMetaData();↵ | | 14 | final String metaData = arg.getMetaData();↵
|
15 | str.append(arg.getName());↵ | | 15 | str.append(arg.getName());↵
|
16 | if (metaData == null) {↵ | | 16 | if (metaData == null) {↵
|
17 | str.append("="); //$NON-NLS-1$↵ | | 17 | str.append("="); //$NON-NLS$↵
|
18 | } else {↵ | | 18 | } else {↵
|
19 | str.append(metaData);↵ | | 19 | str.append(metaData);↵
|
20 | }↵ | | 20 | }↵
|
21 | str.append(arg.getValue());↵ | | 21 | str.append(arg.getValue());↵
|
22 | if (iter.hasNext()) {↵ | | 22 | if (iter.hasNext()) {↵
|
23 | str.append("&"); //$NON-NLS-1$↵ | | 23 | str.append("&"); //$NON-NLS$↵
|
24 | }↵ | | 24 | }↵
|
25 | }↵ | | 25 | }↵
|
26 | return str.toString();↵ | | 26 | return str.toString();↵
|
27 | }↵ | | 27 | }↵
|
|
28 | /**↵ | | 28 | /**↵
|
29 | * Remove the specified argument from the list.↵ | | 29 | * Remove the specified argument from the list.↵
|
30 | * ↵ | | 30 | * ↵
|
31 | * @param row↵ | | 31 | * @param row↵
|
32 | * the index of the argument to remove↵ | | 32 | * the index of the argument to remove↵
|
33 | */↵ | | 33 | */↵
|
34 | public void removeArgument(int row) {↵ | | 34 | public void removeArgument(int row) {↵
|
35 | if (row < getArguments().size()) {↵ | | 35 | if (row < getArguments().size()) {↵
|
36 | getArguments().remove(row);↵ | | 36 | getArguments().remove(row);↵
|
37 | }↵ | | 37 | }↵
|
38 | }↵ | | 38 | }↵
|
|
39 | /**↵ | | 39 | /**↵
|
40 | * Remove the specified argument from the list.↵ | | 40 | * Remove the specified argument from the list.↵
|
41 | * ↵ | | 41 | * ↵
|
42 | * @param arg↵ | | 42 | * @param arg↵
|
43 | * the argument to remove↵ | | 43 | * the argument to remove↵
|
44 | */↵ | | 44 | */↵
|
45 | public void removeArgument(Argument arg) {↵ | | 45 | public void removeArgument(LDAPArgument arg) {↵
|
46 | PropertyIterator iter = getArguments().iterator();↵ | | 46 | PropertyIterator iter = getArguments().iterator();↵
|
47 | while (iter.hasNext()) {↵ | | 47 | while (iter.hasNext()) {↵
|
48 | Argument item = (Argument) iter.next().getObjectValue();↵ | | 48 | LDAPArgument item = (LDAPArgument) iter.next().getObjectValue();↵
|
49 | if (arg.equals(item)) {↵ | | 49 | if (arg.equals(item)) {↵
|
50 | iter.remove();↵ | | 50 | iter.remove();↵
|
51 | }↵ | | 51 | }↵
|
52 | }↵ | | 52 | }↵
|
53 | }↵ | | 53 | }↵
|
|
54 | /**↵ | | 54 | /**↵
|
55 | * Remove the argument with the specified name.↵ | | 55 | * Remove the argument with the specified name.↵
|
56 | * ↵ | | 56 | * ↵
|
57 | * @param argName↵ | | 57 | * @param argName↵
|
58 | * the name of the argument to remove↵ | | 58 | * the name of the argument to remove↵
|
59 | */↵ | | 59 | */↵
|
60 | public void removeArgument(String argName) {↵ | | 60 | public void removeArgument(String argName) {↵
|
61 | PropertyIterator iter = getArguments().iterator();↵ | | 61 | PropertyIterator iter = getArguments().iterator();↵
|
62 | while (iter.hasNext()) {↵ | | 62 | while (iter.hasNext()) {↵
|
63 | Argument arg = (Argument) iter.next().getObjectValue();↵ | | 63 | LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();↵
|
64 | if (arg.getName().equals(argName)) {↵ | | 64 | if (arg.getName().equals(argName)) {↵
|
65 | iter.remove();↵ | | 65 | iter.remove();↵
|
66 | }↵ | | 66 | }↵
|
67 | }↵ | | 67 | }↵
|
68 | }↵ | | 68 | }↵
|
|
69 | /**↵ | | 69 | /**↵
|
70 | * Remove all arguments from the list.↵ | | 70 | * Remove all arguments from the list.↵
|
71 | */↵ | | 71 | */↵
|
72 | public void removeAllArguments() {↵ | | 72 | public void removeAllArguments() {↵
|
73 | getArguments().clear();↵ | | 73 | getArguments().clear();↵
|
74 | }↵ | | 74 | }↵
|
|
75 | /**↵ | | 75 | /**↵
|
76 | * Add a new empty argument to the list. The new argument will have the↵ | | 76 | * Add a new empty argument to the list. The new argument will have the↵
|
77 | * empty string as its name and value, and null metadata.↵ | | 77 | * empty string as its name and value, and null metadata.↵
|
78 | */↵ | | 78 | */↵
|
79 | public void addEmptyArgument() {↵ | | 79 | public void addEmptyArgument() {↵
|
80 | addArgument(new Argument("", "", null));↵ | | 80 | addArgument(new LDAPArgument("", "", "", null));↵
|
81 | }↵ | | 81 | }↵
|
|
82 | /**↵ | | 82 | /**↵
|
83 | * Get the number of arguments in the list.↵ | | 83 | * Get the number of arguments in the list.↵
|
84 | * ↵ | | 84 | * ↵
|
85 | * @return the number of arguments↵ | | 85 | * @return the number of arguments↵
|
86 | */↵ | | 86 | */↵
|
87 | public int getArgumentCount() {↵ | | 87 | public int getArgumentCount() {↵
|
88 | return getArguments().size();↵ | | 88 | return getArguments().size();↵
|
89 | }↵ | | 89 | }↵
|
|
90 | /**↵ | | 90 | /**↵
|
91 | * Get a single argument.↵ | | 91 | * Get a single argument.↵
|
92 | * ↵ | | 92 | * ↵
|
93 | * @param row↵ | | 93 | * @param row↵
|
94 | * the index of the argument to return.↵ | | 94 | * the index of the argument to return.↵
|
95 | * @return the argument at the specified index, or null if no argument↵ | | 95 | * @return the argument at the specified index, or null if no argument↵
|
96 | * exists at that index.↵ | | 96 | * exists at that index.↵
|
97 | */↵ | | 97 | */↵
|
98 | public Argument getArgument(int row) {↵ | | 98 | public LDAPArgument getArgument(int row) {↵
|
99 | Argument argument = null;↵ | | 99 | LDAPArgument argument = null;↵
|
|
100 | if (row < getArguments().size()) {↵ | | 100 | if (row < getArguments().size()) {↵
|
101 | argument = (Argument) getArguments().get(row).getObjectValue();↵ | | 101 | argument = (LDAPArgument) getArguments().get(row).getObjectValue();↵
|
102 | }↵ | | 102 | }↵
|
|
103 | return argument | | 103 | return argument
|