All files / output zcl_abapgit_syntax_factory.clas.mjs

27.27% Statements 15/55
100% Branches 2/2
12.5% Functions 1/8
27.27% Lines 15/55

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 551x 1x 1x 1x 1x 1x 1x 1x 1x             1x       1x     1x                                                           1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_syntax_factory.clas.abap
class zcl_abapgit_syntax_factory {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_SYNTAX_FACTORY';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"CREATE": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SYNTAX_HIGHLIGHTER", RTTIName: "\\CLASS=ZCL_ABAPGIT_SYNTAX_HIGHLIGHTER"});}, "is_optional": " "}, "IV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_HIDDEN_CHARS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async create(INPUT) {
    return zcl_abapgit_syntax_factory.create(INPUT);
  }
  static async create(INPUT) {
    let ro_instance = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SYNTAX_HIGHLIGHTER", RTTIName: "\\CLASS=ZCL_ABAPGIT_SYNTAX_HIGHLIGHTER"});
    let iv_filename = INPUT?.iv_filename;
    if (iv_filename?.getQualifiedName === undefined || iv_filename.getQualifiedName() !== "STRING") { iv_filename = undefined; }
    if (iv_filename === undefined) { iv_filename = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_filename); }
    let iv_hidden_chars = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_hidden_chars) {iv_hidden_chars.set(INPUT.iv_hidden_chars);}
    if (INPUT === undefined || INPUT.iv_hidden_chars === undefined) {iv_hidden_chars = abap.builtin.abap_false;}
    if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(6, '*.abap'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_ABAP']()).constructor_());
    } else if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(5, '*.xml')) || abap.compare.cp(iv_filename, abap.CharacterFactory.get(6, '*.html')) || abap.compare.cp(iv_filename, abap.CharacterFactory.get(5, '*.xdp'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_XML']()).constructor_());
    } else if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(5, '*.css'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_CSS']()).constructor_());
    } else if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(4, '*.js'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_JS']()).constructor_());
    } else if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(6, '*.json')) || abap.compare.cp(iv_filename, abap.CharacterFactory.get(7, '*.jsonc'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_JSON']()).constructor_());
    } else if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(5, '*.txt')) || abap.compare.cp(iv_filename, abap.CharacterFactory.get(5, '*.ini')) || abap.compare.cp(iv_filename, abap.CharacterFactory.get(6, '*.text'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_TXT']()).constructor_());
    } else if (abap.compare.cp(iv_filename, abap.CharacterFactory.get(4, '*.po'))) {
      ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_SYNTAX_PO']()).constructor_());
    } else {
      ro_instance.clear();
    }
    if (abap.compare.initial(ro_instance) === false) {
      await ro_instance.get().set_hidden_chars({iv_hidden_chars: iv_hidden_chars});
    }
    return ro_instance;
  }
}
abap.Classes['ZCL_ABAPGIT_SYNTAX_FACTORY'] = zcl_abapgit_syntax_factory;
export {zcl_abapgit_syntax_factory};