Package org.emftext.language.java
Class LogicalJavaURIGenerator
java.lang.Object
org.emftext.language.java.LogicalJavaURIGenerator
This class provides functionality to construct unique logical URIs
for Java classes, packages and modules represented as EMF-models.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Java's separator for classifier names ($).static final String
End of a URI fragment part.static final String
Start of a URI fragment part pointing at a classifier contained in a compilation unit.static final String
Start of a URI fragment part pointing at a classifier contained as member in another classifier.static final String
Java's class file extension (.class).static final String
The simple file extension for class files without the preceding dot.static final String
Pathmap (URI scheme + first segment) for Java classes.static final String
Java's file extension (.java).static final String
The simple file extension for Java files without a preceding dot.static final String
File name of a module declaration.static final String
Pathmap (URI scheme + first segment) for Java modules.static final String
File name of a package declaration.static final String
Pathmap (URI scheme + first segment) for Java classes.static final String
URI scheme for the logical URIs.static final String
Logical URI segment for classifiers.static final String
Logical URI segment for modules.static final String
Logical URI segment for packages.static final String
File extension for javaxmi files.static final String
The simple file extension for javaxmi files without the preceding dot.static final String
Java's separator for package names (.). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic URI
getClassifierURI
(String fullQualifiedName) Constructs an URI from a fully qualified classifier name pointing at the file containing the classifier and the classifier itself inside the EMF-model constructed from that resource.static URI
getJavaFileResourceURI
(String fullQualifiedName) Constructs a logical URI from a fully qualified classifier name pointing to the resource containing the classifier.static URI
getModuleURI
(String moduleName) Creates a logical URI for modules.static URI
getPackageURI
(String packageName) static String
getSimpleClassName
(String fullQualifiedName) Returns a simple name (i.e., last segment) for a given fully qualified namestatic String
packageName
(NamespaceAwareElement nsaElement) Constructs a single string representation of the given element's namespace, assuming that the namespace points at a package (and not a classifier).
-
Field Details
-
JAVA_URI_SCHEME
URI scheme for the logical URIs.- See Also:
-
JAVA_URI_SEGMENT_CLASSIFIER
Logical URI segment for classifiers.- See Also:
-
JAVA_URI_SEGMENT_PACKAGE
Logical URI segment for packages.- See Also:
-
JAVA_URI_SEGMENT_MODULE
Logical URI segment for modules.- See Also:
-
JAVA_CLASSIFIER_PATHMAP
Pathmap (URI scheme + first segment) for Java classes.- See Also:
-
JAVA_PACKAGE_PATHMAP
Pathmap (URI scheme + first segment) for Java classes.- See Also:
-
JAVA_MODULE_PATHMAP
Pathmap (URI scheme + first segment) for Java modules.- See Also:
-
CLASSIFIERS_ROOT_PATH_PREFIX
Start of a URI fragment part pointing at a classifier contained in a compilation unit.- See Also:
-
CLASSIFIERS_SUB_PATH_PREFIX
Start of a URI fragment part pointing at a classifier contained as member in another classifier.- See Also:
-
CLASSIFIERS_PATH_SUFIX
End of a URI fragment part.- See Also:
-
PACKAGE_SEPARATOR
Java's separator for package names (.).- See Also:
-
CLASSIFIER_SEPARATOR
Java's separator for classifier names ($).- See Also:
-
JAVA_FILE_EXTENSION_NAME
The simple file extension for Java files without a preceding dot.- See Also:
-
JAVA_FILE_EXTENSION
Java's file extension (.java).- See Also:
-
JAVA_CLASS_FILE_EXTENSION_NAME
The simple file extension for class files without the preceding dot.- See Also:
-
JAVA_CLASS_FILE_EXTENSION
Java's class file extension (.class).- See Also:
-
JAVAXMI_FILE_EXTENSION_NAME
The simple file extension for javaxmi files without the preceding dot.- See Also:
-
JAVAXMI_FILE_EXTENSION
File extension for javaxmi files.- See Also:
-
JAVA_MODULE_FILE_NAME
File name of a module declaration.- See Also:
-
JAVA_PACKAGE_FILE_NAME
File name of a package declaration.- See Also:
-
-
Constructor Details
-
LogicalJavaURIGenerator
public LogicalJavaURIGenerator()
-
-
Method Details
-
getJavaFileResourceURI
Constructs a logical URI from a fully qualified classifier name pointing to the resource containing the classifier.- Parameters:
fullQualifiedName
- the fully qualified classifier name.- Returns:
- the logical URI for the classifier.
-
getClassifierURI
Constructs an URI from a fully qualified classifier name pointing at the file containing the classifier and the classifier itself inside the EMF-model constructed from that resource.- Parameters:
fullQualifiedName
-- Returns:
- the logical URI for the classifier
-
getSimpleClassName
Returns a simple name (i.e., last segment) for a given fully qualified name- Parameters:
fullQualifiedName
-- Returns:
- simple name string
-
getModuleURI
Creates a logical URI for modules.- Parameters:
moduleName
- the name of the module.- Returns:
- the logical URI for a module.
-
getPackageURI
-
packageName
Constructs a single string representation of the given element's namespace, assuming that the namespace points at a package (and not a classifier).- Parameters:
nsaElement
-- Returns:
- the namespace.
-