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 Details

    • JAVA_URI_SCHEME

      public static final String JAVA_URI_SCHEME
      URI scheme for the logical URIs.
      See Also:
    • JAVA_URI_SEGMENT_CLASSIFIER

      public static final String JAVA_URI_SEGMENT_CLASSIFIER
      Logical URI segment for classifiers.
      See Also:
    • JAVA_URI_SEGMENT_PACKAGE

      public static final String JAVA_URI_SEGMENT_PACKAGE
      Logical URI segment for packages.
      See Also:
    • JAVA_URI_SEGMENT_MODULE

      public static final String JAVA_URI_SEGMENT_MODULE
      Logical URI segment for modules.
      See Also:
    • JAVA_CLASSIFIER_PATHMAP

      public static final String JAVA_CLASSIFIER_PATHMAP
      Pathmap (URI scheme + first segment) for Java classes.
      See Also:
    • JAVA_PACKAGE_PATHMAP

      public static final String JAVA_PACKAGE_PATHMAP
      Pathmap (URI scheme + first segment) for Java classes.
      See Also:
    • JAVA_MODULE_PATHMAP

      public static final String JAVA_MODULE_PATHMAP
      Pathmap (URI scheme + first segment) for Java modules.
      See Also:
    • 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:
    • 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:
    • CLASSIFIERS_PATH_SUFIX

      public static final String CLASSIFIERS_PATH_SUFIX
      End of a URI fragment part.
      See Also:
    • PACKAGE_SEPARATOR

      public static final String PACKAGE_SEPARATOR
      Java's separator for package names (.).
      See Also:
    • CLASSIFIER_SEPARATOR

      public static final String CLASSIFIER_SEPARATOR
      Java's separator for classifier names ($).
      See Also:
    • 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:
    • JAVA_FILE_EXTENSION

      public static final String JAVA_FILE_EXTENSION
      Java's file extension (.java).
      See Also:
    • 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:
    • JAVA_CLASS_FILE_EXTENSION

      public static final String JAVA_CLASS_FILE_EXTENSION
      Java's class file extension (.class).
      See Also:
    • 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:
    • JAVAXMI_FILE_EXTENSION

      public static final String JAVAXMI_FILE_EXTENSION
      File extension for javaxmi files.
      See Also:
    • JAVA_MODULE_FILE_NAME

      public static final String JAVA_MODULE_FILE_NAME
      File name of a module declaration.
      See Also:
    • JAVA_PACKAGE_FILE_NAME

      public static final String JAVA_PACKAGE_FILE_NAME
      File name of a package declaration.
      See Also:
  • Constructor Details

    • LogicalJavaURIGenerator

      public LogicalJavaURIGenerator()
  • Method Details

    • 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.
    • getPackageURI

      public static URI getPackageURI(String packageName)
    • 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.