org.sourcejammer.project.controller
Class ControllerUtil

java.lang.Object
  |
  +--org.sourcejammer.project.controller.ControllerUtil

public class ControllerUtil
extends java.lang.Object

Title: SourceJammer v 0.1.0 Description: Copyright: Copyright (c) 2001 Company:

Version:
1.0
Author:
Robert MacGrogan

Field Summary
private static java.lang.String PARENT_PROJECT
           
 
Constructor Summary
ControllerUtil()
           
 
Method Summary
static org.sourcejammer.project.NodeList buildFileVersionList(FileNode fileNode)
          Builds a NodeList of NodeInfo objects of a FileNode's version children.
static org.sourcejammer.project.NodeList buildProjectChildList(ProjectNode projectNode, NodeLibrary lib)
          Builds a NodeList of NodeInfo objects of a ProjectNode's children.
static org.sourcejammer.project.view.NodeInfo getNodeInfoFromNode(org.sourcejammer.project.Node node)
          Builds a NodeInfo object based on the contents of the passed-in Node object.
static java.lang.String getPathFromProject(ProjectNode project, NodeLibrary library)
          public static NodeName buildNodeNameObject(ControllerNode node){ if (node instanceof VersionNode){ throw new BadMethodArgumentException("Cannot call buildNodeNameObject() for VersionNode."); } NodeName oNameObject = new NodeName(); oNameObject.setName(node.getNodeName()); ControllerNode oParentNode = node.getParent(); if (oParentNode != null){ //Note reflexive call to this same method below.
static long getUniqueIDFromPath(long parentID, java.lang.String path, NodeLibrary library)
          Converts a string path and parent project id into the id of a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARENT_PROJECT

private static final java.lang.String PARENT_PROJECT
See Also:
Constant Field Values
Constructor Detail

ControllerUtil

public ControllerUtil()
Method Detail

buildProjectChildList

public static org.sourcejammer.project.NodeList buildProjectChildList(ProjectNode projectNode,
                                                                      NodeLibrary lib)
                                                               throws FileAccessException,
                                                                      ProjectDoesNotExistException,
                                                                      FileDoesNotExistException,
                                                                      SecurityException
Builds a NodeList of NodeInfo objects of a ProjectNode's children. This NodeList is for setting the child nodes property of a Project object.

Parameters:
projectNode - -- the project node to retrieve the children from.
Returns:
a NodeList object of NodeInfo objects of the children of projectNode
FileAccessException
ProjectDoesNotExistException
FileDoesNotExistException
SecurityException

buildFileVersionList

public static org.sourcejammer.project.NodeList buildFileVersionList(FileNode fileNode)
Builds a NodeList of NodeInfo objects of a FileNode's version children. This NodeList is for setting the child nodes property of a File object.

Parameters:
fileNode - -- the file node to retrieve the children from.
Returns:
a NodeList object of NodeInfo objects of the children of fileNode

getNodeInfoFromNode

public static org.sourcejammer.project.view.NodeInfo getNodeInfoFromNode(org.sourcejammer.project.Node node)
Builds a NodeInfo object based on the contents of the passed-in Node object. Add appropriate properties for FileNode, VersionNode, and ProjectNode

Parameters:
node - -- the node object to build NodeInfo from.
Returns:
a NodeInfo object with info about node.
Throws:
org.sourcejammer.util.BadMethodArgumentException - (runtime) if the Node cannot be cast to FileNode, ProjectNode, or VersionNode.

getPathFromProject

public static java.lang.String getPathFromProject(ProjectNode project,
                                                  NodeLibrary library)
                                           throws FileAccessException,
                                                  ProjectDoesNotExistException,
                                                  SecurityException
public static NodeName buildNodeNameObject(ControllerNode node){ if (node instanceof VersionNode){ throw new BadMethodArgumentException("Cannot call buildNodeNameObject() for VersionNode."); } NodeName oNameObject = new NodeName(); oNameObject.setName(node.getNodeName()); ControllerNode oParentNode = node.getParent(); if (oParentNode != null){ //Note reflexive call to this same method below. oNameObject.setParent(buildNodeNameObject(oParentNode)); } return oNameObject; }

FileAccessException
ProjectDoesNotExistException
SecurityException

getUniqueIDFromPath

public static long getUniqueIDFromPath(long parentID,
                                       java.lang.String path,
                                       NodeLibrary library)
                                throws FileAccessException,
                                       ProjectDoesNotExistException,
                                       org.sourcejammer.project.NodeDoesNotExistException,
                                       SecurityException
Converts a string path and parent project id into the id of a node.

FileAccessException
ProjectDoesNotExistException
org.sourcejammer.project.NodeDoesNotExistException
SecurityException


Copyright 2003 Soucejammer project.