All files / src/abap/4_file_information _abap_file_information.ts

100% Statements 126/126
100% Branches 4/4
100% Functions 0/0
100% Lines 126/126

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 1261x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
import {Identifier} from "./_identifier";
import {Visibility} from "./visibility";
 
// Only helper functions to get data from single file, no type information
 
export enum AttributeLevel {
  Instance = "instance",
  Static = "static",
  Constant = "constant",
}
 
export enum MethodParameterDirection {
  Importing = "importing",
  Exporting = "exporting",
  Changing = "changing",
  Returning = "returning",
}
 
export interface InfoAttribute {
  name: string,
  identifier: Identifier,
  level: AttributeLevel,
  readOnly: boolean,
  visibility: Visibility,
}
 
export interface InfoMethodParameter {
  name: string,
  identifier: Identifier,
  direction: MethodParameterDirection,
}
 
export interface InfoMethodDefinition {
  name: string,
  identifier: Identifier,
// todo, level, Instance or Static
  isRedefinition: boolean,
  isEventHandler: boolean,
  isForTesting: boolean,
  isAbstract: boolean,
  isFinal: boolean,
  visibility: Visibility,
  parameters: InfoMethodParameter[],
  exceptions: string[],
}
 
export interface InfoInterfaceDefinition {
  name: string,
  identifier: Identifier;
  isLocal: boolean;
  isGlobal: boolean;
  interfaces: readonly InfoImplementing[];
  methods: readonly InfoMethodDefinition[];
  aliases: readonly InfoAlias[],
  constants: readonly InfoConstant[],
// todo, constants
// todo, types
  attributes: readonly InfoAttribute[];
}
 
export interface InfoConstant {
  identifier: Identifier;
  name: string,
  typeName: string,
  visibility: Visibility,
  value: string
}
 
export interface InfoAlias {
  name: string,
  identifier: Identifier;
  visibility: Visibility,
  component: string
}
 
export interface InfoImplementing {
  name: string,
  partial: boolean,
  allAbstract: boolean,
  abstractMethods: string[],
  finalMethods: string[],
}
 
export enum Duration {
  short = "SHORT",
  medium = "MEDIUM",
  long = "LONG",
}
 
export enum RiskLevel {
  harmless = "HARMLESS",
  critical = "CRITICAL",
  dangerous = "DANGEROUS",
}
 
export interface InfoClassDefinition extends InfoInterfaceDefinition {
  superClassName: string | undefined;
  isAbstract: boolean;
  isFinal: boolean;
  interfaces: readonly InfoImplementing[];
  isForTesting: boolean;
  duration: Duration | undefined,
  riskLevel: RiskLevel | undefined,
  isSharedMemory: boolean;
}
 
export interface InfoClassImplementation {
  name: string,
  identifier: Identifier;
  methods: readonly Identifier[];
}
 
export interface InfoFormDefinition {
  name: string,
  identifier: Identifier;
}
 
export interface IABAPFileInformation {
  listInterfaceDefinitions(): readonly InfoInterfaceDefinition[];
  getInterfaceDefinitionByName(name: string): InfoInterfaceDefinition | undefined;
  listClassDefinitions(): readonly InfoClassDefinition[];
  getClassDefinitionByName(name: string): InfoClassDefinition | undefined;
  listFormDefinitions(): readonly InfoFormDefinition[];
  listClassImplementations(): readonly InfoClassImplementation[];
  getClassImplementationByName(name: string): InfoClassImplementation | undefined;
}