1 23 24 package org.apache.slide.structure; 25 26 import java.util.Vector ; 27 import org.apache.slide.content.NodeProperty.NamespaceCache; 28 import org.jdom.Namespace; 29 30 41 public class ActionNode extends ObjectNode { 42 43 44 public static final String DEFAULT_URI = "default"; 45 public static final String ALL_URI = "all"; 46 47 public static final ActionNode DEFAULT = new ActionNode(DEFAULT_URI, NamespaceCache.DEFAULT_NAMESPACE); 48 public static final ActionNode ALL = new ActionNode(ALL_URI, NamespaceCache.DEFAULT_NAMESPACE); 49 50 53 private Namespace namespace; 54 55 57 58 61 public ActionNode() { 62 super(); 63 } 64 65 68 public ActionNode(String uri) { 69 super(uri); 70 } 71 72 75 public ActionNode(String uri, Vector children, Vector links) { 76 super(uri, children, links); 77 } 78 79 public ActionNode(String uuri, Vector bindings, Vector parentBindings, Vector links) { 80 super(uuri, bindings, parentBindings, links); 81 } 82 83 90 public ActionNode(String uri, Namespace namespace) { 91 super(uri); 92 this.namespace = namespace; 93 } 94 95 105 public static ActionNode getActionNode(String actionUri) { 106 if (ActionNode.ALL_URI.equals(actionUri)) { 107 return ActionNode.ALL; 108 } 109 return new ActionNode(actionUri); 110 } 111 112 122 public static ActionNode getActionNode(String actionUri, Namespace namespace) { 123 if (ActionNode.ALL_URI.equals(actionUri) && NamespaceCache.DEFAULT_NAMESPACE.equals(namespace)) { 124 return ActionNode.ALL; 125 } 126 return new ActionNode(actionUri, namespace); 127 } 128 129 137 public Namespace getNamespace() { 138 if (this.namespace == null) { 139 throw new IllegalStateException ("Namespace retrieved without being specified"); 140 } 141 return this.namespace; 142 } 143 } 144 | Popular Tags |