Package org.eclipse.steady
Class ConstructId
- java.lang.Object
-
- org.eclipse.steady.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.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConstructId(ProgrammingLanguage _l)Constructor for ConstructId.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(ConstructId _c)Compares the construct with the given construct by comparing their qualified name.booleanequals(Object obj)Returns true if the qualified name of the two constructs are equal, false otherwise.abstract ConstructIdgetDefinitionContext()Returns the context in which the the construct is defined.ProgrammingLanguagegetLanguage()getLanguage.abstract StringgetName()Returns a construct identifier that is unique within a given context (but not necessarily within the runtime environment).abstract StringgetQualifiedName()Returns a construct identifier that is unique within the respective runtime environment.abstract ConstructTypegetSharedType()getSharedType.static Collection<ConstructId>getSharedType(Collection<ConstructId> _c)getSharedType.abstract StringgetSimpleName()Returns a simple, not necessarily unique name of the construct.inthashCode()abstract com.google.gson.JsonObjecttoGSON()Returns a GSON representation of the construct.abstract StringtoJSON()Returns a JSON representation of the construct.static ConstructIdtoSharedType(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).
-
-
-
Constructor Detail
-
ConstructId
protected ConstructId(ProgrammingLanguage _l)
Constructor for ConstructId.
- Parameters:
_l- aProgrammingLanguageobject.
-
-
Method Detail
-
getLanguage
public ProgrammingLanguage getLanguage()
getLanguage.
- Returns:
- a
ProgrammingLanguageobject.
-
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
Stringobject.
-
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
Stringobject.
-
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
Stringobject.
-
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
ConstructIdobject. - See Also:
getName(),getQualifiedName()
-
toJSON
public abstract String toJSON()
Returns a JSON representation of the construct.- Returns:
- a
Stringobject.
-
toGSON
public abstract com.google.gson.JsonObject toGSON()
Returns a GSON representation of the construct.- Returns:
- a
JsonObjectobject.
-
compareTo
public final int compareTo(ConstructId _c)
Compares the construct with the given construct by comparing their qualified name.- Specified by:
compareToin interfaceComparable<ConstructId>- Parameters:
_c- aConstructIdobject.- Returns:
- a int.
-
equals
public boolean equals(Object obj)
Returns true if the qualified name of the two constructs are equal, false otherwise.
-
getSharedType
public abstract ConstructType getSharedType()
getSharedType.
- Returns:
- a
ConstructTypeobject.
-
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- aConstructIdobject.- Returns:
- a
ConstructIdobject.
-
getSharedType
public static Collection<ConstructId> getSharedType(Collection<ConstructId> _c)
getSharedType.
- Parameters:
_c- aCollectionobject.- Returns:
- a
Collectionobject.
-
-