public static String getNameOfReferenceableItem ( Object annotation ) { if ( annotation == null ) { return "" ; } String name = "" , ref = "" ; if ( annotation instanceof org . eclipse . microprofile . openapi . annotations . headers . Header ) { name = ( ( org . eclipse . microprofile . openapi . annotations . headers . Header ) annotation ) . name ( ) ; ref = ( ( org . eclipse . microprofile . openapi . annotations . headers . Header ) annotation ) . ref ( ) ; } else if ( annotation instanceof ExampleObject ) { name = ( ( ExampleObject ) annotation ) . name ( ) ; ref = ( ( ExampleObject ) annotation ) . ref ( ) ; } else if ( annotation instanceof org . eclipse . microprofile . openapi . annotations . links . Link ) { name = ( ( org . eclipse . microprofile . openapi . annotations . links . Link ) annotation ) . name ( ) ; ref = ( ( org . eclipse . microprofile . openapi . annotations . links . Link ) annotation ) . ref ( ) ; } else if ( annotation instanceof Callback ) { name = ( ( Callback ) annotation ) . name ( ) ; ref = ( ( Callback ) annotation ) . ref ( ) ; } if ( StringUtils . isBlank ( name ) ) { if ( StringUtils . isNotBlank ( ref ) ) { //If the item is a reference then use the simple name of reference as the name int index = ref . lastIndexOf ( ' ' ) ; return index == - 1 ? ref : ref . substring ( index + 1 ) ; } } return name ; }
Retrieve the name