import.css=/download/attachments/6062824/tecnologia.css |
Efetua a busca da Annotation dentro de um objeto retornando uma lista contendo o(s) nome(s) do(s) método(s) onde a mesma foi encontrada.
Reflection.getMethodsByAnnotation( oObj,cAnnotationName ) |
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
oObj | objeto | Objeto na qual a busca será realizada | X | |
cAnnotationName | caractere | Nome da Annotation a ser procurada | X |
Nome | Tipo | Descrição |
---|---|---|
aRet | Array | Array contendo os métodos que possuem a Annotation solicitada. Caso não encontre a array retorna vazia. |
#include "tlpp-core.th" @annotation AnnotationGetMethodsByAnnotation property1 as char @end Class GetMethodsByAnnotation Public Method New() @AnnotationGetMethodsByAnnotation(property1 = "Method Annotation") Public Method MethodWithAnnotation() @AnnotationGetMethodsByAnnotation(property1 = "Method Annotation") Public Method AnotherMethodWithAnnotation() EndClass Method New() class GetMethodsByAnnotation Return Self Method MethodWithAnnotation() class GetMethodsByAnnotation Return Method AnotherMethodWithAnnotation() class GetMethodsByAnnotation Return Function u_testGetMethodsByAnnotation() Local aRet := {} as array Local oObj oObj := GetMethodsByAnnotation():New() aRet := Reflection.getMethodsByAnnotation(oObj, "AnnotationGetMethodsByAnnotation") if(valType(aRet) == "A" .and. len(aRet) > 0) aEval(aRet,{|x| Conout(x)} ) else Conout('Nao foi encontrada Annotation com os parametros solicitados') endIf Return |
ANOTHERMETHODWITHANNOTATION
METHODWITHANNOTATION
17.3.0.3