org.opensolaris.opengrok.configuration
Class Project

java.lang.Object
  extended by org.opensolaris.opengrok.configuration.Project

public class Project
extends java.lang.Object

Placeholder for the information that builds up a project


Constructor Summary
Project()
           
 
Method Summary
static Project getByDescription(java.lang.String desc)
          Returns project object by its description, used in webapp to figure out which project is to be searched
 java.lang.String getDescription()
          Get a textual description of this project
 java.lang.String getId()
          Get the project id
 java.lang.String getPath()
          Get the path (relative from source root) where this project is located
static Project getProject(java.io.File file)
          Get the project for a specific file
static Project getProject(java.lang.String path)
          Get the project for a specific file
 int getTabSize()
          Get the tab size for this project, if tab size has been set.
 boolean hasTabSizeSetting()
          Has this project an explicit tab size setting?
 void setDescription(java.lang.String description)
          Set a textual description of this project, prefferably don't use " , " in the name, since it's used as delimiter for more projects
 void setPath(java.lang.String path)
          Set the path (relative from source root) this project is located It seems that you should ALWAYS prefix the path with current file.separator , current environment should always have it set up
 void setTabSize(int tabSize)
          Set tab size for this project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project

public Project()
Method Detail

getDescription

public java.lang.String getDescription()
Get a textual description of this project

Returns:
a textual description of the project

getPath

public java.lang.String getPath()
Get the path (relative from source root) where this project is located

Returns:
the relative path

getId

public java.lang.String getId()
Get the project id

Returns:
the id of the project

getTabSize

public int getTabSize()
Get the tab size for this project, if tab size has been set.

Returns:
tab size if set, 0 otherwise
See Also:
hasTabSizeSetting()

setDescription

public void setDescription(java.lang.String description)
Set a textual description of this project, prefferably don't use " , " in the name, since it's used as delimiter for more projects

Parameters:
description - a textual description of the project

setPath

public void setPath(java.lang.String path)
Set the path (relative from source root) this project is located It seems that you should ALWAYS prefix the path with current file.separator , current environment should always have it set up

Parameters:
path - the relative path from source sroot where this project is located.

setTabSize

public void setTabSize(int tabSize)
Set tab size for this project. Used for expanding tabs to spaces in xrefs.

Parameters:
tabSize - the size of tabs in this project

hasTabSizeSetting

public boolean hasTabSizeSetting()
Has this project an explicit tab size setting?

Returns:
true if the tab size has been set for this project, or false if it hasn't and the default should be used

getProject

public static Project getProject(java.lang.String path)
Get the project for a specific file

Parameters:
path - the file to lookup (relative from source root)
Returns:
the project that this file belongs to (or null if the file doesn't belong to a project)

getProject

public static Project getProject(java.io.File file)
Get the project for a specific file

Parameters:
file - the file to lookup
Returns:
the project that this file belongs to (or null if the file doesn't belong to a project)

getByDescription

public static Project getByDescription(java.lang.String desc)
Returns project object by its description, used in webapp to figure out which project is to be searched

Parameters:
desc - description of the project
Returns:
project that fits the description