Java: Split API name column into separate columns

This commit is contained in:
Koen Vlaswinkel
2023-09-25 10:16:59 +02:00
parent f4522edc95
commit ced95e0f45
5 changed files with 47 additions and 43 deletions

View File

@@ -14,14 +14,12 @@ private Call aUsage(ExternalEndpoint endpoint) {
result.getCallee().getSourceDeclaration() = endpoint
}
from
ExternalEndpoint endpoint, string apiName, boolean supported, Call usage, string type,
string classification
from ExternalEndpoint endpoint, boolean supported, Call usage, string type, string classification
where
apiName = endpoint.getApiName() and
supported = isSupported(endpoint) and
usage = aUsage(endpoint) and
type = supportedType(endpoint) and
classification = usageClassification(usage)
select usage, apiName, supported, endpoint.jarContainer(), endpoint.jarVersion(), type,
select usage, endpoint.getPackageName(), endpoint.getTypeName(), endpoint.getName(),
endpoint.getParameterTypes(), supported, endpoint.jarContainer(), endpoint.jarVersion(), type,
classification

View File

@@ -10,10 +10,10 @@ private import java
private import FrameworkModeEndpointsQuery
private import ModelEditor
from PublicEndpointFromSource endpoint, string apiName, boolean supported, string type
from PublicEndpointFromSource endpoint, boolean supported, string type
where
apiName = endpoint.getApiName() and
supported = isSupported(endpoint) and
type = supportedType(endpoint)
select endpoint, apiName, supported,
select endpoint, endpoint.getPackageName(), endpoint.getTypeName(), endpoint.getName(),
endpoint.getParameterTypes(), supported,
endpoint.getCompilationUnit().getParentContainer().getBaseName(), type

View File

@@ -20,13 +20,19 @@ class Endpoint extends Callable {
Endpoint() { not isUninteresting(this) }
/**
* Gets information about the external API in the form expected by the MaD modeling framework.
* Gets the package name of this endpoint.
*/
string getApiName() {
result =
this.getDeclaringType().getPackage() + "." + this.getDeclaringType().nestedName() + "#" +
this.getName() + paramsString(this)
}
string getPackageName() { result = this.getDeclaringType().getPackage().getName() }
/**
* Gets the type name of this endpoint.
*/
string getTypeName() { result = this.getDeclaringType().nestedName() }
/**
* Gets the parameter types of this endpoint.
*/
string getParameterTypes() { result = paramsString(this) }
private string getJarName() {
result = this.getCompilationUnit().getParentContainer*().(JarFile).getBaseName()