import.css=/download/attachments/6062824/tecnologia.css |
Procura Annotation associadas a um determinado método.
Reflection.getMethodAnnotationList( oObj, cMethodName) |
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
oObj | objeto | Objeto onde está definido o método cujas Annotation serão retornadas | X | |
cMethodName | caractere | Método onde serão procuradas as Annotations | X |
Nome | Tipo | Descrição |
---|---|---|
aRet | array | Array contendo em cada posição um objeto do tipo Json onde cada propriedade é o nome da Annotation encontrada. Caso nada seja encontrado, seu valor é NIL. |
#include "tlpp-core.th" @annotation AnnotationGetMethodAnnotationList01 teste1 as char @end @annotation AnnotationGetMethodAnnotationList02 teste2 as char @end Class GetMethodAnnotationList Public Method New() @AnnotationGetMethodAnnotationList01(teste1 = "Primeira Annotation") @AnnotationGetMethodAnnotationList02(teste2 = "Segunda Annotation") Public Method MethodWithAnnotation() EndClass Method New() class GetMethodAnnotationList Return Self Method MethodWithAnnotation() class GetMethodAnnotationList Return Function u_testGetMethodAnnotationList(aResult) Local oObj := GetMethodAnnotationList():New() Local aRet aRet := Reflection.getMethodAnnotationList(oObj, "MethodWithAnnotation") Conout(Len(aRet)) Conout(aRet[1]["teste1"]) Conout(aRet[2]["teste2"]) Return |
2
Primeira Annotation
Segunda Annotation
17.3.0.3