Class ProjectDescriptorsFactory
- java.lang.Object
-
- com.nomagic.magicdraw.core.project.ProjectDescriptorsFactory
-
@OpenApiAll public class ProjectDescriptorsFactory extends java.lang.Object
Factory for ProjectDescriptors creating.
-
-
Constructor Summary
Constructors Constructor Description ProjectDescriptorsFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.net.URI
constructRemoteURI(java.lang.String id, java.lang.String qualifiedName)
Creates project URI for remote project.static java.net.URI
constructRemoteURI(java.lang.String id, java.lang.String qualifiedName, int version)
Creates project URI for remote project and given version.private static java.net.URI
constructRemoteURI(java.lang.String id, java.lang.String qualifiedName, java.lang.String version)
Creates project URI for remote project and given version.static AbstractRemoteProjectDescriptor
createAbstractRemoteProjectDescriptorWithActualVersion(Project project)
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, java.io.File file)
Creates local project descriptor with given project and filestatic ProjectDescriptor
createProjectDescriptor(java.lang.String location)
Deprecated.UsecreateProjectDescriptor(URI)
Parses location String and creates ProjectDescriptor object from project's location string.static ProjectDescriptor
createProjectDescriptor(java.net.URI location)
Parses location String and creates ProjectDescriptor object from project's location string.static ProjectDescriptor
createRemoteProjectDescriptor(java.lang.String id, java.lang.String qualifiedName, int actualVersionNumber)
Creates project descriptor for remote project and given version.static ProjectDescriptor
createRemoteProjectDescriptor(java.lang.String id, java.lang.String qualifiedName, java.lang.String actualVersionNumber)
Creates project descriptor for remote project and given version.static java.util.List<ProjectDescriptor>
getAvailableDescriptorsForProject(Project project)
Returns all available descriptors for given project.static ProjectDescriptor
getDescriptorForProject(Project project)
Returns project descriptor for given projectstatic java.lang.String
getName(java.net.URI uri)
Retrieves project name from given uri.static java.lang.String
getProjectFullPath(java.net.URI uri)
Get project branch path (WITH project name) or just project name if branches are not applicable for given uristatic java.lang.String
getProjectName(java.net.URI uri)
Extract project name from the URI.static java.lang.String
getRemoteID(java.net.URI uri)
Retrieves project id from given uri.static java.lang.String
getRemoteID(java.net.URI uri, java.lang.String separator)
Retrieves project id from given uri.private static java.lang.String
getRemoteSeparator()
static int
getRemoteVersion(java.net.URI uri)
Retrieves remote version from given uri.static java.lang.String
getRemoteVersionAsString(java.net.URI uri)
Retrieves remote version from given uri.static boolean
isAnyRemote(java.net.URI uri)
-
-
-
Method Detail
-
createProjectDescriptor
@CheckForNull @Deprecated public static ProjectDescriptor createProjectDescriptor(java.lang.String location)
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
@CheckForNull public static ProjectDescriptor createProjectDescriptor(@CheckForNull java.net.URI location)
Parses location String and creates ProjectDescriptor object from project's location string.- Parameters:
location
- the project's location- Returns:
- constructed ProjectDescriptor object.
-
getAvailableDescriptorsForProject
public static java.util.List<ProjectDescriptor> getAvailableDescriptorsForProject(Project project)
Returns all available descriptors for given project.- Parameters:
project
- the project.- Returns:
- List of descriptors.
-
getDescriptorForProject
public static ProjectDescriptor getDescriptorForProject(Project project)
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
public static ProjectDescriptor createLocalProjectDescriptor(Project project)
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 java.io.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
@CheckForNull public static ProjectDescriptor createAnyRemoteProjectDescriptor(Project project)
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
@CheckForNull private static java.net.URI constructRemoteURI(java.lang.String id, @CheckForNull java.lang.String qualifiedName, @CheckForNull java.lang.String version)
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
@CheckForNull public static java.net.URI constructRemoteURI(java.lang.String id, java.lang.String qualifiedName, int version)
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
@CheckForNull public static java.net.URI constructRemoteURI(java.lang.String id, java.lang.String qualifiedName)
Creates project URI for remote project.- Parameters:
id
- remote project idqualifiedName
- qualified name - branch (if any) combination with project name- Returns:
- created uri
-
getRemoteVersionAsString
@CheckForNull public static java.lang.String getRemoteVersionAsString(java.net.URI uri)
Retrieves remote version from given uri.- Parameters:
uri
- uri to check- Returns:
- version number from uri.
-
getRemoteVersion
public static int getRemoteVersion(java.net.URI uri)
Retrieves remote version from given uri.- Parameters:
uri
- uri to check- Returns:
- version number from uri.
-
isAnyRemote
public static boolean isAnyRemote(java.net.URI uri)
- Parameters:
uri
- uri to check.- Returns:
- true if uri is remote project descriptor uri
-
getRemoteID
@CheckForNull public static java.lang.String getRemoteID(java.net.URI uri)
Retrieves project id from given uri.- Parameters:
uri
- remote project uri to check.- Returns:
- remote project id from project uri.
-
getRemoteID
@CheckForNull public static java.lang.String getRemoteID(java.net.URI uri, java.lang.String separator)
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
@CheckForNull public static java.lang.String getName(@CheckForNull java.net.URI uri)
Retrieves project name from given uri.- Parameters:
uri
- remote uri to check.- Returns:
- remote project name.
-
getProjectName
@CheckForNull public static java.lang.String getProjectName(java.net.URI uri)
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:
getName(java.net.URI)
-
getProjectFullPath
@CheckForNull public static java.lang.String getProjectFullPath(java.net.URI uri)
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(java.lang.String id, @CheckForNull java.lang.String qualifiedName, @CheckForNull java.lang.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(java.lang.String id, @CheckForNull java.lang.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.
-
getRemoteSeparator
private static java.lang.String getRemoteSeparator()
-
-