Class ProjectDescriptorsFactory
java.lang.Object
com.nomagic.magicdraw.core.project.ProjectDescriptorsFactory
Factory for ProjectDescriptors creating.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic URI
constructRemoteURI
(String id, String qualifiedName) Creates project URI for remote project.static URI
constructRemoteURI
(String id, String qualifiedName, int version) Creates project URI for remote project and given version.Creates remote project descriptor.static ProjectDescriptor
createAnyRemoteProjectDescriptor
(Project project) Creates remote project descriptor.static ProjectDescriptor
createLocalProjectDescriptor
(Project project) Creates local project descriptor.static ProjectDescriptor
createLocalProjectDescriptor
(Project project, File file) Creates local project descriptor with given project and filestatic ProjectDescriptor
createProjectDescriptor
(String location) Deprecated.static ProjectDescriptor
createProjectDescriptor
(URI location) Parses location String and creates ProjectDescriptor object from project's location string.static ProjectDescriptor
createRemoteProjectDescriptor
(String id, String qualifiedName, int actualVersionNumber) Creates project descriptor for remote project and given version.static ProjectDescriptor
createRemoteProjectDescriptor
(String id, String qualifiedName, String actualVersionNumber) Creates project descriptor for remote project and given version.static List<ProjectDescriptor>
getAvailableDescriptorsForProject
(Project project) Returns all available descriptors for given project.static ProjectDescriptor
getDescriptorForProject
(Project project) Returns project descriptor for given projectstatic String
Retrieves project name from given uri.static String
getProjectFullPath
(URI uri) Get project branch path (WITH project name) or just project name if branches are not applicable for given uristatic String
getProjectName
(URI uri) Extract project name from the URI.static String
getRemoteID
(URI uri) Retrieves project id from given uri.static String
getRemoteID
(URI uri, String separator) Retrieves project id from given uri.static long
getRemoteLongVersion
(URI uri) Retrieves remote version from given uri.static int
getRemoteVersion
(URI uri) Deprecated.static String
Retrieves remote version from given uri.static boolean
isAnyRemote
(URI uri)
-
Constructor Details
-
ProjectDescriptorsFactory
public ProjectDescriptorsFactory()
-
-
Method Details
-
createProjectDescriptor
Deprecated.UsecreateProjectDescriptor(URI)
Parses location String and creates ProjectDescriptor object from project's location string.- Parameters:
location
- the project's location- Returns:
- constructed ProjectDescriptor object.
-
createProjectDescriptor
Parses location String and creates ProjectDescriptor object from project's location string.- Parameters:
location
- the project's location- Returns:
- constructed ProjectDescriptor object.
-
getAvailableDescriptorsForProject
Returns all available descriptors for given project.- Parameters:
project
- the project.- Returns:
- List of descriptors.
-
getDescriptorForProject
Returns project descriptor for given project- Parameters:
project
- project for which descriptor is created.- Returns:
- Local project descriptor if project is local, remote project descriptor if project is remote.
-
createLocalProjectDescriptor
Creates local project descriptor.- Parameters:
project
- project for which descriptor is created.- Returns:
- created project descriptor
-
createLocalProjectDescriptor
public static ProjectDescriptor createLocalProjectDescriptor(@CheckForNull Project project, @CheckForNull File file) Creates local project descriptor with given project and file- Parameters:
project
- project for which descriptor is createdfile
- new location for project- Returns:
- created project descriptor.
-
createAnyRemoteProjectDescriptor
Creates remote project descriptor. Supports teamwork and ESI projects- Parameters:
project
- project for which descriptor is created.- Returns:
- null if project is not remote
-
createAbstractRemoteProjectDescriptorWithActualVersion
@CheckForNull public static AbstractRemoteProjectDescriptor createAbstractRemoteProjectDescriptorWithActualVersion(Project project) Creates remote project descriptor. Even for latest version uses actual version number instead of -1.- Parameters:
project
- project for which descriptor is created- Returns:
- null if project is not remote
-
constructRemoteURI
Creates project URI for remote project and given version.- Parameters:
id
- remote project idqualifiedName
- qualified name - branch (if any) combination with project nameversion
- version number for which descriptor is created. Use -1 for latest version- Returns:
- created uri
-
constructRemoteURI
Creates project URI for remote project.- Parameters:
id
- remote project idqualifiedName
- qualified name - branch (if any) combination with project name- Returns:
- created uri
-
getRemoteVersionAsString
Retrieves remote version from given uri.- Parameters:
uri
- uri to check- Returns:
- version number from uri.
-
getRemoteVersion
Deprecated.Retrieves remote version from given uri.- Parameters:
uri
- uri to check- Returns:
- version number from uri.
-
getRemoteLongVersion
Retrieves remote version from given uri.- Parameters:
uri
- uri to check- Returns:
- version number from uri.
-
isAnyRemote
- Parameters:
uri
- uri to check.- Returns:
- true if uri is remote project descriptor uri
-
getRemoteID
Retrieves project id from given uri.- Parameters:
uri
- remote project uri to check.- Returns:
- remote project id from project uri.
-
getRemoteID
Retrieves project id from given uri.- Parameters:
uri
- remote project uri to check.separator
- uri info separator- Returns:
- remote project id from project uri.
-
getName
Retrieves project name from given uri.- Parameters:
uri
- remote uri to check.- Returns:
- remote project name.
-
getProjectName
Extract project name from the URI. Name doesn't contain branch name, if such was (remote)- Parameters:
uri
- uri used to retrieve name.- Returns:
- project name
- See Also:
-
getProjectFullPath
Get project branch path (WITH project name) or just project name if branches are not applicable for given uri- Parameters:
uri
- used to retrieve full path.- Returns:
- null if no branch was found
-
createRemoteProjectDescriptor
@CheckForNull public static ProjectDescriptor createRemoteProjectDescriptor(String id, @CheckForNull String qualifiedName, @CheckForNull String actualVersionNumber) Creates project descriptor for remote project and given version.- Parameters:
id
- remote project id.qualifiedName
- qualified name - branch (if any) combination with project name.actualVersionNumber
- version number for which descriptor is created. Use -1 for latest version.- Returns:
- created descriptor.
-
createRemoteProjectDescriptor
@CheckForNull public static ProjectDescriptor createRemoteProjectDescriptor(String id, @CheckForNull String qualifiedName, int actualVersionNumber) Creates project descriptor for remote project and given version.- Parameters:
id
- remote project id.qualifiedName
- qualified name - branch (if any) combination with project name.actualVersionNumber
- version number for which descriptor is created. Use -1 for latest version.- Returns:
- created descriptor.
-
createProjectDescriptor(URI)
Parses location String and creates ProjectDescriptor object from project's location string.