\r
/** Tree based implementation of a structure registry. */\r
public class TreeSRegistry implements StructureRegistry<TreeSPath> {\r
- public final static String STATUS_ACTIVE = "STATUS_ACTIVE";\r
-\r
/** For ORM */\r
private Long tid;\r
- private String status;\r
private Map<TreeSPath, SimpleSElement> elements = new TreeMap<TreeSPath, SimpleSElement>();\r
\r
private String mode = StructureRegistry.ALL;\r
}\r
\r
public void register(TreeSPath path, StructureElement element) {\r
+ if (path == null)\r
+ throw new UnsupportedException("Cannot register under a null path.");\r
+ if (element == null)\r
+ throw new UnsupportedException(\r
+ "Cannot register null element for path " + path);\r
+ if (element.getLabel() == null)\r
+ throw new UnsupportedException(\r
+ "Cannot register an element with null label for path "\r
+ + path);\r
+\r
final SimpleSElement simpleSElement;\r
if (element instanceof SimpleSElement) {\r
simpleSElement = (SimpleSElement) element;\r
simpleSElement = new SimpleSElement(element.getLabel());\r
}\r
\r
- if (path == null)\r
- throw new UnsupportedException("Path cannot be null.");\r
-\r
elements.put(path, simpleSElement);\r
-\r
}\r
\r
public String getMode() {\r
this.activePaths = activePaths;\r
}\r
\r
- public String getStatus() {\r
- return status;\r
- }\r
-\r
- public void setStatus(String status) {\r
- this.status = status;\r
- }\r
-\r
/** Gets the elements. */\r
public Map<TreeSPath, SimpleSElement> getElements() {\r
return elements;\r