mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Docs: Expand constructor description (#4914)
Describe logic to be used to check requirements and determine if an object type is supported or not.
This commit is contained in:
parent
e86e2267c0
commit
0a3b4be16b
|
@ -28,6 +28,31 @@ Parameter | Description
|
|||
|
||||
These parameters are stored in attributes `MS_ITEM` and `MV_LANGUAGE` respectively.
|
||||
|
||||
Requirements that are necessary to support an object type should be checked in the constructor using the following logic. This is typical if object types are not supported in lower releases.
|
||||
|
||||
```abap
|
||||
METHOD constructor.
|
||||
|
||||
DATA ...
|
||||
|
||||
super->constructor(
|
||||
is_item = is_item
|
||||
iv_language = iv_language ).
|
||||
|
||||
TRY.
|
||||
" Check requirements...
|
||||
CATCH cx_root.
|
||||
" Raise exception if not supported
|
||||
zcx_abapgit_exception=>raise( 'Object type DDLS not supported' ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
```
|
||||
|
||||
This will ensure that none of the other class methods are called, even if objects of the given type exist in a repo.
|
||||
|
||||
Example: [`SRFC`](https://github.com/abapGit/abapGit/blob/main/src/objects/zcl_abapgit_object_srfc.clas.abap).
|
||||
|
||||
## Interface
|
||||
|
||||
Serializers must implement all methods of interface [`ZIF_ABAPGIT_OBJECT`](https://github.com/abapGit/abapGit/blob/main/src/objects/zif_abapgit_object.intf.abap):
|
||||
|
|
Loading…
Reference in New Issue
Block a user