Class QvtNamesChecker


  • public class QvtNamesChecker
    extends Object
    Provides validation functionality for QVT elements identifiers.
    • Method Detail

      • isValidCompilationUnitFileName

        public static boolean isValidCompilationUnitFileName​(String fileName)
      • validateCompilationUnitFileName

        public static org.eclipse.core.runtime.IStatus validateCompilationUnitFileName​(String fileName)
      • getCompilationUnitMainModuleName

        public static String getCompilationUnitMainModuleName​(String compilationUnitFileName)
        Get the name of the main module for the given compilation unit file name.

        Parameters:
        compilationUnitFileName - a valid compilation unit file name
        Returns:
        the module name, representing the give file name without the file name extension.
      • extractQualifyingIdentifierPart

        public static String extractQualifyingIdentifierPart​(String qualifiedIdentifier)
        Extracts the qualifying part of the given qualified identifier.

        Parameters:
        qualifiedIdentifier - a valid qualified identifier
        Returns:
        the qualifying part is the string up-to the last '.' separated segment of the given qualified identifier.

        Note: If the qualified identifier is a simple identifier, which also represents a valid qualified identifier, empty string representing the default name-space is returned.

        Throws:
        IllegalArgumentException - in case that the passed qualifiedIdentifier is not valid
        See Also:
        validateQualifiedIdentifier(String, String)
      • extractLocalIdentifierPart

        public static String extractLocalIdentifierPart​(String qualifiedIdentifier)
        Extracts the local identifier from the given qualified identifier.

        Parameters:
        qualifiedIdentifier - a valid qualified identifier
        Returns:
        the local identifier as the last '.' separated segment of the given qualified identifier.

        Note: If the qualified identifier is a simple identifier, which also represents a valid qualified identifier, the passed value is returned.

        Throws:
        IllegalArgumentException - in case that the passed qualifiedIdentifier is not valid
        See Also:
        validateQualifiedIdentifier(String, String)
      • validateQualifiedIdentifier

        public static org.eclipse.core.runtime.IStatus validateQualifiedIdentifier​(String qualifiedIdentifier,
                                                                                   String identifierKindName)
      • validateNamespaceSimpleIdenfier

        public static org.eclipse.core.runtime.IStatus validateNamespaceSimpleIdenfier​(String name)
      • validateNamespaceQualifiedIdentifier

        public static org.eclipse.core.runtime.IStatus validateNamespaceQualifiedIdentifier​(String name)
      • validateQvtModuleIdentifier

        public static org.eclipse.core.runtime.IStatus validateQvtModuleIdentifier​(String name)
      • validateIdentifier

        public static org.eclipse.core.runtime.IStatus validateIdentifier​(String name,
                                                                          String identifierKindName)
      • getQualifiedNameSegments

        public static String[] getQualifiedNameSegments​(String qualifiedName)
        Get the name segments of the given qualified-name.

        Note: No kind of validation is performed by this method, simply tokens delimited by '.' are returned.

        Parameters:
        qualifiedName - a valid qualified identifier in the form of sequence of simple identifiers separated by '.'
        Returns:
        array of name segments composing the given qualified name