Package org.eclipse.m2m.internal.qvt.oml
Class QvtNamesChecker
- java.lang.Object
-
- org.eclipse.m2m.internal.qvt.oml.QvtNamesChecker
-
public class QvtNamesChecker extends Object
Provides validation functionality for QVT elements identifiers.
-
-
Field Summary
Fields Modifier and Type Field Description static StringQNAME_DELIMITER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringextractLocalIdentifierPart(String qualifiedIdentifier)Extracts the local identifier from the given qualified identifier.static StringextractQualifyingIdentifierPart(String qualifiedIdentifier)Extracts the qualifying part of the given qualified identifier.static StringgetCompilationUnitMainModuleName(String compilationUnitFileName)Get the name of the main module for the given compilation unit file name.static String[]getQualifiedNameSegments(String qualifiedName)Get the name segments of the given qualified-name.static booleanisValidCompilationUnitFileName(String fileName)static org.eclipse.core.runtime.IStatusvalidateCompilationUnitFileName(String fileName)static org.eclipse.core.runtime.IStatusvalidateIdentifier(String name, String identifierKindName)static org.eclipse.core.runtime.IStatusvalidateNamespaceQualifiedIdentifier(String name)static org.eclipse.core.runtime.IStatusvalidateNamespaceSimpleIdenfier(String name)static org.eclipse.core.runtime.IStatusvalidateQualifiedIdentifier(String qualifiedIdentifier, String identifierKindName)static org.eclipse.core.runtime.IStatusvalidateQvtModuleIdentifier(String name)
-
-
-
Field Detail
-
QNAME_DELIMITER
public static final String QNAME_DELIMITER
- See Also:
- Constant Field Values
-
-
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 passedqualifiedIdentifieris 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 passedqualifiedIdentifieris 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
-
-