Reflection.getFunctionAnnotation
Retorna o valor de uma Annotation em uma função a partir de uma busca efetuada em um programa fonte indicado.
Sintaxe
Reflection.getFunctionAnnotation( cSourceName, cFunctionName, cAnnotationName )
Parâmetros
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
cSourceName | caractere | nome do fonte contendo a função onde será procurada a Annotation. | X | |
cPropertyName | caractere | Nome da função onde será está declarada a Annotation. | X | |
cAnnotationName | caractere | Nome da Annotation que será procurada. | X |
Retorno
Nome | Tipo | Descrição |
---|---|---|
jRet | objeto | Retorna um objeto do tipo Json contendo o valor da propriedade da Annotation buscada. Caso não encontre seu retorno é NIL. |
Exemplos
test_doc_resourceGetFunctionAnnotation.tlpp
/* Programa test_doc_resourceGetFunctionAnnotation.tlpp */ #include "tlpp-core.th" @annotation AnnotationResource nickname as char @end @AnnotationResource(nickname='Totvs') Function u_resourceGetFunctionAnnotation() return
test_doc_getFunctionAnnotation.tlpp
#include "tlpp-core.th" Function u_testGetFunctionAnnotation() local jRet jRet := Reflection.getFunctionAnnotation("test_doc_resourceGetFunctionAnnotation.tlpp", "u_resourceGetFunctionAnnotation","AnnotationResource") if(valType(jRet) <> "U") conout(jRet["nickname"]) else conout('Não foram encontradas Annotations com os parametros pesquisados') endif return
Resultado do Exemplo
Totvs
Abrangência
17.3.0.3
Veja também
Denis De Souza Naves gosta disto.
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas