Class Project
java.lang.Object
org.opengrok.indexer.configuration.Project
- All Implemented Interfaces:
Serializable
,Comparable<Project>
,Nameable
Placeholder for the information that builds up a project.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a group where this project belongs.void
int
final void
Fill the project with the current configuration where the applicable project property has a default value.boolean
static Project
Returns project object by its name, used in webapp to figure out which project is to be searched.Return groups where this project belongs.getId()
Get the project id.getName()
Get a textual name of this project.getPath()
Get the path (relative from source root) where this project is located.static @Nullable Project
getProject
(File file) Get the project for a specific file.static Project
getProject
(String path) Get the project for a specific file.int
Get the tab size for this project, if tab size has been set.int
hashCode()
boolean
Has this project an explicit tab size setting?boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Indicate whether the navigate window should be opened by default when browsing a source code from this project.boolean
final void
setAnnotationCacheEnabled
(boolean flag) final void
setBugPage
(String bugPage) final void
setBugPattern
(String bugPattern) Set the bug pattern to a new value.void
final void
setHandleRenamedFiles
(boolean flag) final void
setHistoryBasedReindex
(boolean flag) final void
setHistoryCacheEnabled
(boolean flag) final void
setHistoryEnabled
(boolean flag) void
setIndexed
(boolean flag) final void
setMergeCommitsEnabled
(boolean flag) void
Set a textual name of this project, preferably don't use " , " in the name, since it's used as delimiter for more projects XXX we should not allow setting project name after it has been constructed because it is probably part of HashMap.final void
setNavigateWindowEnabled
(boolean navigateWindowEnabled) Set the value of navigateWindowEnabled.void
setPassword
(String password) Set password to be used for repository authentication.void
Set the path (relative from source root) this project is located.final void
setReviewPage
(String reviewPage) final void
setReviewPattern
(String reviewPattern) Set the review pattern to a new value.final void
setTabSize
(int tabSize) Set tab size for this project.final void
setTagsEnabled
(boolean flag) void
setUsername
(String username) Set username to be used for repository authentication.toString()
-
Constructor Details
-
Project
public Project() -
Project
Create a project with given name.- Parameters:
name
- the name of the project
-
Project
Create a project with given name and path and default configuration values.- Parameters:
name
- the name of the projectpath
- the path of the project relative to the source root
-
-
Method Details
-
getName
Get a textual name of this project. -
getPath
Get the path (relative from source root) where this project is located.- Returns:
- the relative path
-
isIndexed
public boolean isIndexed() -
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:
-
setName
Set a textual name of this project, preferably don't use " , " in the name, since it's used as delimiter for more projects XXX we should not allow setting project name after it has been constructed because it is probably part of HashMap. -
setPath
Set the path (relative from source root) this project is located.- Parameters:
path
- the relative path from source root where this project is located, starting with path separator.
-
setIndexed
public void setIndexed(boolean flag) -
setTabSize
public final 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, orfalse
if it hasn't and the default should be used
-
isHandleRenamedFiles
public boolean isHandleRenamedFiles()- Returns:
- true if this project handles renamed files.
-
isMergeCommitsEnabled
public boolean isMergeCommitsEnabled()- Returns:
- true if merge commits are enabled.
-
isTagsEnabled
public boolean isTagsEnabled()- Returns:
- whether tagging of history entries is on
-
setHandleRenamedFiles
public final void setHandleRenamedFiles(boolean flag) - Parameters:
flag
- true if project should handle renamed files, false otherwise.
-
isHistoryEnabled
public boolean isHistoryEnabled()- Returns:
- true if this project should have history cache.
-
setHistoryEnabled
public final void setHistoryEnabled(boolean flag) - Parameters:
flag
- true if project should have history cache, false otherwise.
-
isHistoryCacheEnabled
public boolean isHistoryCacheEnabled()- Returns:
- true if this project should have history cache.
-
setHistoryCacheEnabled
public final void setHistoryCacheEnabled(boolean flag) - Parameters:
flag
- true if project should have history cache, false otherwise.
-
isAnnotationCacheEnabled
public boolean isAnnotationCacheEnabled()- Returns:
- true if this project should have annotation cache.
-
setAnnotationCacheEnabled
public final void setAnnotationCacheEnabled(boolean flag) - Parameters:
flag
- true if project should have annotation cache, false otherwise.
-
setMergeCommitsEnabled
public final void setMergeCommitsEnabled(boolean flag) - Parameters:
flag
- true if project's repositories should deal with merge commits.
-
setTagsEnabled
public final void setTagsEnabled(boolean flag) - Parameters:
flag
- whether to tag history entries
-
isHistoryBasedReindex
public boolean isHistoryBasedReindex()- Returns:
- true if this project handles renamed files.
-
setHistoryBasedReindex
public final void setHistoryBasedReindex(boolean flag) - Parameters:
flag
- true if project should handle renamed files, false otherwise.
-
setUsername
Set username to be used for repository authentication.- Parameters:
username
- username
-
getUsername
- Returns:
- username used for repository authentication
-
setPassword
Set password to be used for repository authentication.- Parameters:
password
- password
-
getPassword
- Returns:
- password used for repository authentication
-
clearProperties
@VisibleForTesting public void clearProperties() -
getGroups
Return groups where this project belongs.- Returns:
- set of groups|empty if none
-
setGroups
-
addGroup
Adds a group where this project belongs.- Parameters:
group
- group to add
-
setBugPage
-
getBugPage
-
setBugPattern
Set the bug pattern to a new value.- Parameters:
bugPattern
- the new pattern- Throws:
PatternSyntaxException
- when the pattern is not a valid regexp or does not contain at least one capture group and the group does not contain a single character
-
getBugPattern
-
getReviewPage
-
setReviewPage
-
getReviewPattern
-
setReviewPattern
Set the review pattern to a new value.- Parameters:
reviewPattern
- the new pattern- Throws:
PatternSyntaxException
- when the pattern is not a valid regexp or does not contain at least one capture group and the group does not contain a single character
-
completeWithDefaults
public final void completeWithDefaults()Fill the project with the current configuration where the applicable project property has a default value. -
getProject
Get the project for a specific file.- Parameters:
path
- the file to lookup (relative to source root)- Returns:
- the project that this file belongs to (or null if the file doesn't belong to a project)
-
getProject
Get the project for a specific file.- Parameters:
file
- file under source root- Returns:
- the project that this file belongs to (or
null
if the file doesn't belong to a project, or it is a symbolic link that is not allowed)
-
getByName
Returns project object by its name, used in webapp to figure out which project is to be searched.- Parameters:
name
- name of the project- Returns:
- project that fits the name
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Project>
-
hashCode
public int hashCode() -
equals
-
toString
-