Class ProjectDescriptorsFactory

java.lang.Object
com.nomagic.magicdraw.core.project.ProjectDescriptorsFactory

@OpenApiAll public class ProjectDescriptorsFactory extends Object
Factory for ProjectDescriptors creating.
  • Constructor Details

    • ProjectDescriptorsFactory

      public ProjectDescriptorsFactory()
  • Method Details

    • createProjectDescriptor

      @CheckForNull @Deprecated public static ProjectDescriptor createProjectDescriptor(String location)
      Deprecated.
      Use createProjectDescriptor(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 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 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 File file)
      Creates local project descriptor with given project and file
      Parameters:
      project - project for which descriptor is created
      file - 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 public static URI constructRemoteURI(String id, String qualifiedName, int version)
      Creates project URI for remote project and given version.
      Parameters:
      id - remote project id
      qualifiedName - qualified name - branch (if any) combination with project name
      version - version number for which descriptor is created. Use -1 for latest version
      Returns:
      created uri
    • constructRemoteURI

      @CheckForNull public static URI constructRemoteURI(String id, String qualifiedName)
      Creates project URI for remote project.
      Parameters:
      id - remote project id
      qualifiedName - qualified name - branch (if any) combination with project name
      Returns:
      created uri
    • getRemoteVersionAsString

      @CheckForNull public static String getRemoteVersionAsString(URI uri)
      Retrieves remote version from given uri.
      Parameters:
      uri - uri to check
      Returns:
      version number from uri.
    • getRemoteVersion

      public static int getRemoteVersion(URI uri)
      Deprecated.
      Retrieves remote version from given uri.
      Parameters:
      uri - uri to check
      Returns:
      version number from uri.
    • getRemoteLongVersion

      public static long getRemoteLongVersion(URI uri)
      Retrieves remote version from given uri.
      Parameters:
      uri - uri to check
      Returns:
      version number from uri.
    • isAnyRemote

      public static boolean isAnyRemote(URI uri)
      Parameters:
      uri - uri to check.
      Returns:
      true if uri is remote project descriptor uri
    • getRemoteID

      @CheckForNull public static String getRemoteID(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 String getRemoteID(URI uri, 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 String getName(@CheckForNull URI uri)
      Retrieves project name from given uri.
      Parameters:
      uri - remote uri to check.
      Returns:
      remote project name.
    • getProjectName

      @CheckForNull public static String getProjectName(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:
    • getProjectFullPath

      @CheckForNull public static String getProjectFullPath(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(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.