1 23 24 package org.apache.slide.structure; 25 26 import java.util.Vector ; 27 28 import org.apache.slide.common.ObjectValidationFailedException; 29 import org.apache.slide.util.Messages; 30 31 36 public class LinkNode extends ObjectNode { 37 38 39 41 42 45 public LinkNode() { 46 super(); 47 } 48 49 50 53 public LinkNode(String uri) { 54 super(uri); 55 } 56 57 58 61 public LinkNode(String uri, Vector children, Vector links) { 62 super(uri, children, links); 63 } 64 65 66 69 public LinkNode(String uri, Vector children, Vector links, 70 String linkedUri) { 71 super(uri, children, links); 72 setLinkedUri(linkedUri); 73 } 74 75 76 78 79 82 protected String linkedUri; 83 84 85 87 88 93 public String getLinkedUri() { 94 return linkedUri; 95 } 96 97 98 103 void setLinkedUri(String linkedUri) { 104 if (!linkedUri.equals(getUri())) { 105 this.linkedUri = linkedUri; 106 } 107 } 108 109 110 115 public void validate(String expectedUri) { 116 super.validate(expectedUri); 117 118 if (linkedUri == null) 119 throw new ObjectValidationFailedException 120 (uri, Messages.message 121 (LinkNode.class.getName() + ".nullLink")); 122 123 } 124 125 126 } 127 | Popular Tags |