All files / src/objects icf_service.ts

93.02% Statements 40/43
100% Branches 6/6
75% Functions 3/4
93.02% Lines 40/43

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 431x 1x 1x 1x 1x 1x 10x 10x 1x 1x 1x 1x 1x 1x 1x 1x 1x       1x 1x 1x 4x 4x 4x 4x 4x 4x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 1x
import {AbstractObject} from "./_abstract_object";
import {xmlToArray} from "../xml_utils";
 
export class ICFService extends AbstractObject {
 
  public getType(): string {
    return "SICF";
  }
 
  public getAllowedNaming() {
    return { // todo, verify
      maxLength: 100,
      allowNamespace: true,
    };
  }
 
  public getDescription(): string | undefined {
    // todo
    return undefined;
  }
 
  // todo, cache parsed data
  public getHandlerList(): string[] | undefined {
    const ret: string[] = [];
 
    const parsed = this.parseRaw2();
    if (parsed === undefined
        || parsed.abapGit === undefined
        || parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
      return undefined;
    }
 
    const table = parsed.abapGit["asx:abap"]["asx:values"].ICFHANDLER_TABLE;
    for (const h of xmlToArray(table)) {
      if (h.ICFHANDLER !== undefined) {
        ret.push(h.ICFHANDLER.ICFHANDLER);
      }
    }
 
    return ret;
  }
 
}