Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Retorno

Nome

Tipo

Descrição

aRet

Array de JsonArray 

Retorna um array que contém em cada posição um objeto Json com a sua respectiva Annotation. Seu valor será NIL caso nenhuma Annotation seja encontrada.

...

Bloco de código
languagecpp
themeEclipse
titleexemplo1.tlpp
linenumberstrue
@interface AnnotationUm#include "tlpp-object.th"
 
@annotation PrimeiraAnnotation
    nicknameempresa as char
@end
  
  
@interface@annotation AnnotationDoisSegundaAnnotation
    tipo as char
@end
   
  
@AnnotationUm@PrimeiraAnnotation(nicknameempresa = "CompanyTotvs")
@AnnotationDois@SegundaAnnotation(tipo = "Teste ListaSoftware")

class MeuObjetoGetClassAnnotationList
    public data data1
    public method new()
EndClass
   
Method new() Class MeuObjetoGetClassAnnotationList
return self
   
main function AnnotationListu_testGetClassAnnotationList()

    local oObj aRet as array
  
    aRet := MeuObjeto():New()
 Reflection.getClassAnnotationList("GetClassAnnotationList")
   local jRet
 
   if jRet := Reflection.getClassAnnotationList("MeuObjeto")
(valType(aRet) == "A") .and. (len(aRet) > 0)
      conout(jRetaRet[1]["nicknameempresa"])
      conout(jRetaRet[2]["tipo"])
    else
      conout('Não foi encontrada nenhuma Annotation na classe declarada !')  
    endif
return

Resultado do Exemplo

CompanyTotvs

Teste ListaSoftware

Abrangência

17.3.0.3

Veja também

...