Class ConstructId

  • All Implemented Interfaces:
    Comparable<ConstructId>

    public abstract class ConstructId
    extends Object
    implements Comparable<ConstructId>
    The construct identifier shall allow the unique identification of programming constructs at application compile time and runtime. It depends on the specific programming language used. Java methods, for instance, are uniquely identified by package name, class name, internal class name (if any), method name and method arguments.
    • Method Detail

      • getQualifiedName

        public abstract String getQualifiedName()
        Returns a construct identifier that is unique within the respective runtime environment. Example: In the context of the Java Runtime Environment (more precisely: a given class loader), a Java class is uniquely identified by its name and the package it belongs to.
        Returns:
        a String object.
      • getName

        public abstract String getName()
        Returns a construct identifier that is unique within a given context (but not necessarily within the runtime environment). Example: A Java method is uniquely identified in its class context by its name and its parameter types. A Java class (nested or not) is uniquely identified in its package context by its name.
        Returns:
        a String object.
      • getSimpleName

        public abstract String getSimpleName()
        Returns a simple, not necessarily unique name of the construct. Example: For Java methods, the simple name corresponds to the method name (excluding parameter types).
        Returns:
        a String object.
      • getDefinitionContext

        public abstract ConstructId getDefinitionContext()
        Returns the context in which the the construct is defined. Example: Java classes are defined in a package (the same holds true for nested classes). Java methods and constructors are defined in a class.
        Returns:
        a ConstructId object.
        See Also:
        getName(), getQualifiedName()
      • toJSON

        public abstract String toJSON()
        Returns a JSON representation of the construct.
        Returns:
        a String object.
      • toGSON

        public abstract com.google.gson.JsonObject toGSON()
        Returns a GSON representation of the construct.
        Returns:
        a JsonObject object.
      • compareTo

        public final int compareTo​(ConstructId _c)
        Compares the construct with the given construct by comparing their qualified name.
        Specified by:
        compareTo in interface Comparable<ConstructId>
        Parameters:
        _c - a ConstructId object.
        Returns:
        a int.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Returns true if the qualified name of the two constructs are equal, false otherwise.
        Overrides:
        equals in class Object
      • toSharedType

        public static ConstructId toSharedType​(ConstructId _core_type)
        Transforms an object with a given core type (defined in vulas-core) into an object having the corresponding shared type (defined in vulas-share).
        Parameters:
        _core_type - a ConstructId object.
        Returns:
        a ConstructId object.