X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fstructure%2Ftree%2FTreeSRegistry.java;h=36c85728fe32c2dcdb75f52acf664a667aef3b23;hb=7a8f034133c1112e187e2a2bfd2c56a8d2452345;hp=7337367dc1de8683f4388e6cc3f75d5e22f46d5f;hpb=8c69c342c923aff75e3cc53afe390b767bb81e2e;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/tree/TreeSRegistry.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/tree/TreeSRegistry.java index 7337367dc..36c85728f 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/tree/TreeSRegistry.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/tree/TreeSRegistry.java @@ -12,11 +12,8 @@ import org.argeo.slc.core.structure.StructureRegistry; /** Tree based implementation of a structure registry. */ public class TreeSRegistry implements StructureRegistry { - public final static String STATUS_ACTIVE = "STATUS_ACTIVE"; - /** For ORM */ private Long tid; - private String status; private Map elements = new TreeMap(); private String mode = StructureRegistry.ALL; @@ -36,6 +33,16 @@ public class TreeSRegistry implements StructureRegistry { } public void register(TreeSPath path, StructureElement element) { + if (path == null) + throw new UnsupportedException("Cannot register under a null path."); + if (element == null) + throw new UnsupportedException( + "Cannot register null element for path " + path); + if (element.getLabel() == null) + throw new UnsupportedException( + "Cannot register an element with null label for path " + + path); + final SimpleSElement simpleSElement; if (element instanceof SimpleSElement) { simpleSElement = (SimpleSElement) element; @@ -43,11 +50,7 @@ public class TreeSRegistry implements StructureRegistry { simpleSElement = new SimpleSElement(element.getLabel()); } - if (path == null) - throw new UnsupportedException("Path cannot be null."); - elements.put(path, simpleSElement); - } public String getMode() { @@ -66,14 +69,6 @@ public class TreeSRegistry implements StructureRegistry { this.activePaths = activePaths; } - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - /** Gets the elements. */ public Map getElements() { return elements;