1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.apache.ws.scout.registry.infomodel; |
18 | |
|
19 | |
import java.util.ArrayList; |
20 | |
import java.util.Collection; |
21 | |
import java.util.Iterator; |
22 | |
|
23 | |
import javax.xml.registry.JAXRException; |
24 | |
import javax.xml.registry.LifeCycleManager; |
25 | |
import javax.xml.registry.UnsupportedCapabilityException; |
26 | |
import javax.xml.registry.infomodel.ClassificationScheme; |
27 | |
import javax.xml.registry.infomodel.Concept; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
public class ClassificationSchemeImpl |
37 | |
extends RegistryEntryImpl |
38 | |
implements ClassificationScheme |
39 | |
{ |
40 | |
|
41 | 0 | private Collection<Concept> childConcepts = new ArrayList<Concept>(); |
42 | |
|
43 | |
|
44 | |
|
45 | 0 | private boolean external = false; |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
public ClassificationSchemeImpl(LifeCycleManager lifeCycleManager) |
51 | |
{ |
52 | 0 | super(lifeCycleManager); |
53 | 0 | } |
54 | |
|
55 | |
public void addChildConcept(Concept concept) |
56 | |
throws JAXRException |
57 | |
{ |
58 | 0 | childConcepts.add(concept); |
59 | 0 | } |
60 | |
|
61 | |
public void addChildConcepts(Collection collection) |
62 | |
throws JAXRException |
63 | |
{ |
64 | 0 | childConcepts.addAll(collection); |
65 | 0 | } |
66 | |
|
67 | |
public int getChildConceptCount() |
68 | |
throws JAXRException |
69 | |
{ |
70 | 0 | return childConcepts.size(); |
71 | |
} |
72 | |
|
73 | |
public Collection getChildrenConcepts() throws JAXRException |
74 | |
{ |
75 | 0 | return childConcepts; |
76 | |
} |
77 | |
|
78 | |
public Collection getDescendantConcepts() throws JAXRException |
79 | |
{ |
80 | 0 | Collection<Concept> coll = new ArrayList<Concept>(); |
81 | 0 | Iterator iter = childConcepts.iterator(); |
82 | 0 | while(iter != null && iter.hasNext()) |
83 | |
{ |
84 | 0 | ConceptImpl c = (ConceptImpl)iter.next(); |
85 | 0 | coll.add(c); |
86 | 0 | coll.addAll(c.getDescendantConcepts()); |
87 | 0 | } |
88 | 0 | return coll; |
89 | |
} |
90 | |
|
91 | |
public int getValueType() |
92 | |
throws JAXRException |
93 | |
{ |
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | 0 | throw new UnsupportedCapabilityException(); |
99 | |
} |
100 | |
|
101 | |
protected void setExternal(boolean b) { |
102 | 0 | this.external = b; |
103 | 0 | } |
104 | |
|
105 | |
public boolean isExternal() throws JAXRException |
106 | |
{ |
107 | 0 | return this.external; |
108 | |
} |
109 | |
|
110 | |
public void removeChildConcept(Concept concept) |
111 | |
throws JAXRException |
112 | |
{ |
113 | 0 | this.childConcepts.remove(concept); |
114 | 0 | } |
115 | |
|
116 | |
public void removeChildConcepts(Collection collection) |
117 | |
throws JAXRException |
118 | |
{ |
119 | 0 | this.childConcepts.removeAll(collection); |
120 | 0 | } |
121 | |
|
122 | |
public void setValueType(int param) |
123 | |
throws JAXRException |
124 | |
{ |
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | 0 | throw new UnsupportedCapabilityException(); |
130 | |
} |
131 | |
|
132 | |
} |