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 StringCLASSIFIER_SEPARATORJava's separator for classifier names ($).static StringCLASSIFIERS_PATH_SUFIXEnd of a URI fragment part.static StringCLASSIFIERS_ROOT_PATH_PREFIXStart of a URI fragment part pointing at a classifier contained in a compilation unit.static StringCLASSIFIERS_SUB_PATH_PREFIXStart of a URI fragment part pointing at a classifier contained as member in another classifier.static StringJAVA_CLASS_FILE_EXTENSIONJava's class file extension (.class).static StringJAVA_CLASS_FILE_EXTENSION_NAMEThe simple file extension for class files without the preceding dot.static StringJAVA_CLASSIFIER_PATHMAPPathmap (URI scheme + first segment) for Java classes.static StringJAVA_FILE_EXTENSIONJava's file extension (.java).static StringJAVA_FILE_EXTENSION_NAMEThe simple file extension for Java files without a preceding dot.static StringJAVA_MODULE_FILE_NAMEFile name of a module declaration.static StringJAVA_MODULE_PATHMAPPathmap (URI scheme + first segment) for Java modules.static StringJAVA_PACKAGE_FILE_NAMEFile name of a package declaration.static StringJAVA_PACKAGE_PATHMAPPathmap (URI scheme + first segment) for Java classes.static StringJAVA_URI_SCHEMEURI scheme for the logical URIs.static StringJAVA_URI_SEGMENT_CLASSIFIERLogical URI segment for classifiers.static StringJAVA_URI_SEGMENT_MODULELogical URI segment for modules.static StringJAVA_URI_SEGMENT_PACKAGELogical URI segment for packages.static StringJAVAXMI_FILE_EXTENSIONFile extension for javaxmi files.static StringJAVAXMI_FILE_EXTENSION_NAMEThe simple file extension for javaxmi files without the preceding dot.static StringPACKAGE_SEPARATORJava'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 URIgetClassifierURI(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 URIgetJavaFileResourceURI(String fullQualifiedName)Constructs a logical URI from a fully qualified classifier name pointing to the resource containing the classifier.static URIgetModuleURI(String moduleName)Creates a logical URI for modules.static URIgetPackageURI(String packageName)static StringgetSimpleClassName(String fullQualifiedName)Returns a simple name (i.e., last segment) for a given fully qualified namestatic StringpackageName(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.
-
-