View Javadoc

1   package org.modeshape.graph.connector.path;
2   
3   import java.util.List;
4   import java.util.Map;
5   import java.util.Set;
6   import java.util.UUID;
7   import org.modeshape.graph.ExecutionContext;
8   import org.modeshape.graph.property.Name;
9   import org.modeshape.graph.property.NameFactory;
10  import org.modeshape.graph.property.Path;
11  import org.modeshape.graph.property.Property;
12  
13  /**
14   * Basic interface for a read-only node in a {@link PathRepository path repository}.
15   */
16  public interface PathNode {
17  
18      /**
19       * Returns the full path to this node
20       * 
21       * @return the full path to this node
22       */
23      public Path getPath();
24  
25      /**
26       * Returns the UUID for this node. Only the root node in a {@link PathWorkspace} should have a UUID. All other nodes should
27       * return null from this method.
28       * 
29       * @return the UUID for this node; may be null
30       */
31      public UUID getUuid();
32  
33      /**
34       * Returns the set of child names for this node
35       * 
36       * @return the set of child names for this node
37       */
38      public Set<Name> getUniqueChildNames();
39  
40      /**
41       * @return children
42       */
43      public List<Path.Segment> getChildSegments();
44  
45      /**
46       * Returns the named property
47       * 
48       * @param context the current execution context, used to get a {@link NameFactory name factory}
49       * @param name the name of the property to return
50       * @return the property for the given name
51       */
52      public Property getProperty( ExecutionContext context,
53                                   String name );
54  
55      /**
56       * Returns the named property
57       * 
58       * @param name the name of the property to return
59       * @return the property for the given name
60       */
61      public Property getProperty( Name name );
62  
63      /**
64       * Returns a map of property names to the property for the given name
65       * 
66       * @return a map of property names to the property for the given name
67       */
68      public Map<Name, Property> getProperties();
69  }