Package org.emftext.language.java
Class LogicalJavaURIGenerator
- java.lang.Object
-
- org.emftext.language.java.LogicalJavaURIGenerator
-
public class LogicalJavaURIGenerator extends Object
This class provides functionality to construct unique logical URIs for Java classes, packages and modules represented as EMF-models.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASSIFIER_SEPARATOR
Java's separator for classifier names ($).static String
CLASSIFIERS_PATH_SUFIX
End of a URI fragment part.static String
CLASSIFIERS_ROOT_PATH_PREFIX
Start of a URI fragment part pointing at a classifier contained in a compilation unit.static String
CLASSIFIERS_SUB_PATH_PREFIX
Start of a URI fragment part pointing at a classifier contained as member in another classifier.static String
JAVA_CLASS_FILE_EXTENSION
Java's class file extension (.class).static String
JAVA_CLASS_FILE_EXTENSION_NAME
The simple file extension for class files without the preceding dot.static String
JAVA_CLASSIFIER_PATHMAP
Pathmap (URI scheme + first segment) for Java classes.static String
JAVA_FILE_EXTENSION
Java's file extension (.java).static String
JAVA_FILE_EXTENSION_NAME
The simple file extension for Java files without a preceding dot.static String
JAVA_MODULE_FILE_NAME
File name of a module declaration.static String
JAVA_MODULE_PATHMAP
Pathmap (URI scheme + first segment) for Java modules.static String
JAVA_PACKAGE_FILE_NAME
File name of a package declaration.static String
JAVA_PACKAGE_PATHMAP
Pathmap (URI scheme + first segment) for Java classes.static String
JAVA_URI_SCHEME
URI scheme for the logical URIs.static String
JAVA_URI_SEGMENT_CLASSIFIER
Logical URI segment for classifiers.static String
JAVA_URI_SEGMENT_MODULE
Logical URI segment for modules.static String
JAVA_URI_SEGMENT_PACKAGE
Logical URI segment for packages.static String
JAVAXMI_FILE_EXTENSION
File extension for javaxmi files.static String
JAVAXMI_FILE_EXTENSION_NAME
The simple file extension for javaxmi files without the preceding dot.static String
PACKAGE_SEPARATOR
Java's separator for package names (.).
-
Constructor Summary
Constructors Constructor Description LogicalJavaURIGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
JAVA_URI_SCHEME
public static final String JAVA_URI_SCHEME
URI scheme for the logical URIs.- See Also:
- Constant Field Values
-
JAVA_URI_SEGMENT_CLASSIFIER
public static final String JAVA_URI_SEGMENT_CLASSIFIER
Logical URI segment for classifiers.- See Also:
- Constant Field Values
-
JAVA_URI_SEGMENT_PACKAGE
public static final String JAVA_URI_SEGMENT_PACKAGE
Logical URI segment for packages.- See Also:
- Constant Field Values
-
JAVA_URI_SEGMENT_MODULE
public static final String JAVA_URI_SEGMENT_MODULE
Logical URI segment for modules.- See Also:
- Constant Field Values
-
JAVA_CLASSIFIER_PATHMAP
public static final String JAVA_CLASSIFIER_PATHMAP
Pathmap (URI scheme + first segment) for Java classes.- See Also:
- Constant Field Values
-
JAVA_PACKAGE_PATHMAP
public static final String JAVA_PACKAGE_PATHMAP
Pathmap (URI scheme + first segment) for Java classes.- See Also:
- Constant Field Values
-
JAVA_MODULE_PATHMAP
public static final String JAVA_MODULE_PATHMAP
Pathmap (URI scheme + first segment) for Java modules.- See Also:
- Constant Field Values
-
CLASSIFIERS_ROOT_PATH_PREFIX
public static final String CLASSIFIERS_ROOT_PATH_PREFIX
Start of a URI fragment part pointing at a classifier contained in a compilation unit.- See Also:
- Constant Field Values
-
CLASSIFIERS_SUB_PATH_PREFIX
public static final String CLASSIFIERS_SUB_PATH_PREFIX
Start of a URI fragment part pointing at a classifier contained as member in another classifier.- See Also:
- Constant Field Values
-
CLASSIFIERS_PATH_SUFIX
public static final String CLASSIFIERS_PATH_SUFIX
End of a URI fragment part.- See Also:
- Constant Field Values
-
PACKAGE_SEPARATOR
public static final String PACKAGE_SEPARATOR
Java's separator for package names (.).- See Also:
- Constant Field Values
-
CLASSIFIER_SEPARATOR
public static final String CLASSIFIER_SEPARATOR
Java's separator for classifier names ($).- See Also:
- Constant Field Values
-
JAVA_FILE_EXTENSION_NAME
public static final String JAVA_FILE_EXTENSION_NAME
The simple file extension for Java files without a preceding dot.- See Also:
- Constant Field Values
-
JAVA_FILE_EXTENSION
public static final String JAVA_FILE_EXTENSION
Java's file extension (.java).- See Also:
- Constant Field Values
-
JAVA_CLASS_FILE_EXTENSION_NAME
public static final String JAVA_CLASS_FILE_EXTENSION_NAME
The simple file extension for class files without the preceding dot.- See Also:
- Constant Field Values
-
JAVA_CLASS_FILE_EXTENSION
public static final String JAVA_CLASS_FILE_EXTENSION
Java's class file extension (.class).- See Also:
- Constant Field Values
-
JAVAXMI_FILE_EXTENSION_NAME
public static final String JAVAXMI_FILE_EXTENSION_NAME
The simple file extension for javaxmi files without the preceding dot.- See Also:
- Constant Field Values
-
JAVAXMI_FILE_EXTENSION
public static final String JAVAXMI_FILE_EXTENSION
File extension for javaxmi files.- See Also:
- Constant Field Values
-
JAVA_MODULE_FILE_NAME
public static final String JAVA_MODULE_FILE_NAME
File name of a module declaration.- See Also:
- Constant Field Values
-
JAVA_PACKAGE_FILE_NAME
public static final String JAVA_PACKAGE_FILE_NAME
File name of a package declaration.- See Also:
- Constant Field Values
-
-
Method Detail
-
getJavaFileResourceURI
public static URI getJavaFileResourceURI(String fullQualifiedName)
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
public static 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.- Parameters:
fullQualifiedName
-- Returns:
- the logical URI for the classifier
-
getSimpleClassName
public static String getSimpleClassName(String fullQualifiedName)
Returns a simple name (i.e., last segment) for a given fully qualified name- Parameters:
fullQualifiedName
-- Returns:
- simple name string
-
getModuleURI
public static URI getModuleURI(String moduleName)
Creates a logical URI for modules.- Parameters:
moduleName
- the name of the module.- Returns:
- the logical URI for a module.
-
packageName
public static 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).- Parameters:
nsaElement
-- Returns:
- the namespace.
-
-