Reflection.getDataAnnotation
Efetua a busca de uma Annotation atribuída a uma classe e retorna o fonte onde a mesma foi encontrada.
Sintaxe
Reflection.getDataAnnotation( cClassName, cAnnotationName )
Parâmetros
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
cClassName | caractere | Nome da classe onde será procurada a Annotation | X | |
cAnnotationName | caractere | Nome da Annotation que será procurada. | X |
Retorno
Nome | Tipo | Descrição |
---|---|---|
cRet | caractere | Retorna uma string com o nome do fonte onde a Annotationfoi encontrada. Caso não encontre o retorno é vazio. |
Exemplos
exemplo1.tlpp
#include "tlpp-core.th" @annotation AnnotationgetClassSourceName nickname as char @end class getClassSourceName Public Method New() @AnnotationgetClassSourceName(nickname = "Company") Public Method MethodWithAnnotation() Static Method Run(aResult) Static Method Example(aResult) EndClass Method New() class getClassSourceName Return Self Method MethodWithAnnotation() class getClassSourceName Return
exemplo2.tlpp
#include "tlpp-core.th" Function u_testgetClassSourceName local cRet := '' as character cRet := Reflection.getClassSourceName("reflection.getClassSourceName", "AnnotationgetClassSourceName") if(valType(cRet) <> 'U' .and. !empty(cRet)) Conout("The source name of annotation is: " + cValToChar(cRet)) else Conout('Erro na execução da Reflection.getClassSourceName') endif Return
Resultado dos Exemplos
exemplo1.tlpp
Abrangência
24.3.0.0
Veja também
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas