mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Add interface for better testing to zcl_abapgit_xml_input/output (#3514)
* introduce interfaces for classes zcl_abapgit_xml_input/output * refactor classes to use interfaces * fix indentation of xml files * fix exception class * Removed default for commit comment (#3513) * Removed default for commit comment Closes https://github.com/larshp/abapGit/issues/3511 * Removed default for commit comment Co-authored-by: Lars Hvam <larshp@hotmail.com> * Fix incorrect status of ignored files in repo view (#3506) * Fix incorrect status of ignored filed in repo view After update of repo settings, some ignored files showed as "-/A". https://github.com/larshp/abapGit/pull/3415 * Whitespace Co-authored-by: Lars Hvam <larshp@hotmail.com> * Minor improvements of icons in repo view (#3493) * Minor improvement for icons in repo view * Add Icon Legend in "Debug Info" A place to see available icons (will copy it to documentation). * Pretty print * Reverse icons in debug info Icons are now in docs. No need for this here Co-authored-by: Lars Hvam <larshp@hotmail.com> * z'ify * zif'y * remove to much zif'iation * whitespace Co-authored-by: Marc Bernard <59966492+mbtools@users.noreply.github.com> Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
09120cb80d
commit
507cb9c9db
|
@ -5,26 +5,19 @@ CLASS zcl_abapgit_xml_input DEFINITION
|
|||
|
||||
PUBLIC SECTION.
|
||||
|
||||
INTERFACES zif_abapgit_xml_input.
|
||||
|
||||
ALIASES:
|
||||
read FOR zif_abapgit_xml_input~read,
|
||||
get_raw FOR zif_abapgit_xml_input~get_raw,
|
||||
get_metadata FOR zif_abapgit_xml_input~get_metadata.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
!iv_xml TYPE clike
|
||||
!iv_filename TYPE string OPTIONAL
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS read
|
||||
IMPORTING
|
||||
!iv_name TYPE clike
|
||||
CHANGING
|
||||
!cg_data TYPE any
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS get_raw
|
||||
RETURNING
|
||||
VALUE(ri_raw) TYPE REF TO if_ixml_document .
|
||||
* todo, add read_xml to match add_xml in lcl_xml_output
|
||||
METHODS get_metadata
|
||||
RETURNING
|
||||
VALUE(rs_metadata) TYPE zif_abapgit_definitions=>ty_metadata .
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS: fix_xml.
|
||||
|
@ -33,7 +26,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_XML_INPUT IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_xml_input IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
|
|
@ -5,41 +5,20 @@ CLASS zcl_abapgit_xml_output DEFINITION
|
|||
|
||||
PUBLIC SECTION.
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_i18n_params,
|
||||
serialize_master_lang_only TYPE abap_bool,
|
||||
END OF ty_i18n_params.
|
||||
INTERFACES zif_abapgit_xml_output.
|
||||
|
||||
METHODS add
|
||||
IMPORTING
|
||||
!iv_name TYPE clike
|
||||
!ig_data TYPE any
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS set_raw
|
||||
IMPORTING
|
||||
!ii_raw TYPE REF TO if_ixml_element .
|
||||
METHODS add_xml
|
||||
IMPORTING
|
||||
!iv_name TYPE clike
|
||||
!ii_xml TYPE REF TO if_ixml_element .
|
||||
METHODS render
|
||||
IMPORTING
|
||||
!iv_normalize TYPE abap_bool DEFAULT abap_true
|
||||
!is_metadata TYPE zif_abapgit_definitions=>ty_metadata OPTIONAL
|
||||
RETURNING
|
||||
VALUE(rv_xml) TYPE string .
|
||||
METHODS i18n_params
|
||||
IMPORTING
|
||||
iv_serialize_master_lang_only TYPE ty_i18n_params-serialize_master_lang_only OPTIONAL
|
||||
RETURNING
|
||||
VALUE(rs_params) TYPE ty_i18n_params.
|
||||
ALIASES:
|
||||
add FOR zif_abapgit_xml_output~add,
|
||||
set_raw FOR zif_abapgit_xml_output~set_raw,
|
||||
add_xml FOR zif_abapgit_xml_output~add_xml,
|
||||
render FOR zif_abapgit_xml_output~render,
|
||||
i18n_params FOR zif_abapgit_xml_output~i18n_params.
|
||||
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
|
||||
DATA mi_raw TYPE REF TO if_ixml_element .
|
||||
DATA ms_i18n_params TYPE ty_i18n_params .
|
||||
DATA ms_i18n_params TYPE zif_abapgit_xml_output~ty_i18n_params .
|
||||
|
||||
METHODS build_asx_node
|
||||
RETURNING
|
||||
|
@ -48,7 +27,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_XML_OUTPUT IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_xml_output IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD add.
|
||||
|
|
17
src/xml/zif_abapgit_xml_input.intf.abap
Normal file
17
src/xml/zif_abapgit_xml_input.intf.abap
Normal file
|
@ -0,0 +1,17 @@
|
|||
INTERFACE zif_abapgit_xml_input
|
||||
PUBLIC .
|
||||
METHODS read
|
||||
IMPORTING
|
||||
!iv_name TYPE clike
|
||||
CHANGING
|
||||
!cg_data TYPE any
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS get_raw
|
||||
RETURNING
|
||||
VALUE(ri_raw) TYPE REF TO if_ixml_document .
|
||||
* todo, add read_xml to match add_xml in lcl_xml_output
|
||||
METHODS get_metadata
|
||||
RETURNING
|
||||
VALUE(rs_metadata) TYPE zif_abapgit_definitions=>ty_metadata .
|
||||
ENDINTERFACE.
|
15
src/xml/zif_abapgit_xml_input.intf.xml
Normal file
15
src/xml/zif_abapgit_xml_input.intf.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<VSEOINTERF>
|
||||
<CLSNAME>ZIF_ABAPGIT_XML_INPUT</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Interface for XML INPUT</DESCRIPT>
|
||||
<EXPOSURE>2</EXPOSURE>
|
||||
<STATE>1</STATE>
|
||||
<UNICODE>X</UNICODE>
|
||||
</VSEOINTERF>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
32
src/xml/zif_abapgit_xml_output.intf.abap
Normal file
32
src/xml/zif_abapgit_xml_output.intf.abap
Normal file
|
@ -0,0 +1,32 @@
|
|||
INTERFACE zif_abapgit_xml_output
|
||||
PUBLIC .
|
||||
TYPES:
|
||||
BEGIN OF ty_i18n_params,
|
||||
serialize_master_lang_only TYPE abap_bool,
|
||||
END OF ty_i18n_params.
|
||||
|
||||
METHODS add
|
||||
IMPORTING
|
||||
!iv_name TYPE clike
|
||||
!ig_data TYPE any
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS set_raw
|
||||
IMPORTING
|
||||
!ii_raw TYPE REF TO if_ixml_element .
|
||||
METHODS add_xml
|
||||
IMPORTING
|
||||
!iv_name TYPE clike
|
||||
!ii_xml TYPE REF TO if_ixml_element .
|
||||
METHODS render
|
||||
IMPORTING
|
||||
!iv_normalize TYPE sap_bool DEFAULT abap_true
|
||||
!is_metadata TYPE zif_abapgit_definitions=>ty_metadata OPTIONAL
|
||||
RETURNING
|
||||
VALUE(rv_xml) TYPE string .
|
||||
METHODS i18n_params
|
||||
IMPORTING
|
||||
iv_serialize_master_lang_only TYPE ty_i18n_params-serialize_master_lang_only OPTIONAL
|
||||
RETURNING
|
||||
VALUE(rs_params) TYPE ty_i18n_params.
|
||||
ENDINTERFACE.
|
15
src/xml/zif_abapgit_xml_output.intf.xml
Normal file
15
src/xml/zif_abapgit_xml_output.intf.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<VSEOINTERF>
|
||||
<CLSNAME>ZIF_ABAPGIT_XML_OUTPUT</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Interface for XML OUTPUT</DESCRIPT>
|
||||
<EXPOSURE>2</EXPOSURE>
|
||||
<STATE>1</STATE>
|
||||
<UNICODE>X</UNICODE>
|
||||
</VSEOINTERF>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
Loading…
Reference in New Issue
Block a user