Histórico da Página
...
Bloco de código | ||
---|---|---|
| ||
Reflection.getMethodsObjectByAnnotation( oObjxParam,cAnnotationName ) |
Parâmetros
Nome | Tipo | Descrição | Obrigatório | Referência | |||
---|---|---|---|---|---|---|---|
xParam** | objet/caractere | Objeto instância da classe/nome da classe** | oObj | objeto | Objeto onde a busca pela Annotation será realizada | X | |
cAnnotationName | caractere | Nome da Annotation a ser procurada | X |
Informações | ||
---|---|---|
| ||
A partir do build 24.3.0.0, também haverá a opção de passar simplesmente o nome da classe em xParam, conforme exemplo 2. Mas continua valendo a passagem da instância do objeto (exemplo 1). |
Retorno
Nome | Tipo | Descrição |
---|---|---|
aRet | Array | Array contendo em cada posição um objeto Json com a propriedade cMethodName onde o valor é o método onde a Annotation foi encontrada. Caso não haja resultado a array retorna vazia. |
...
Bloco de código | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#include "tlpp-core.th"
@annotation AnnotationGetMethodsObjectByAnnotation
@end
Class GetMethodsObjectByAnnotation
Public Method New()
@AnnotationGetMethodsObjectByAnnotation()
Public Method MethodWithAnnotation()
EndClass
Method New() class GetMethodsObjectByAnnotation
Return Self
Method MethodWithAnnotation() class GetMethodsObjectByAnnotation
Return
Function u_testGetMethodsObjectByAnnotation()
Local ObjMethod
Local oObj
oObj := GetMethodsObjectByAnnotation():New()
ObjMethod := Reflection.getMethodsObjectByAnnotation(oObj, "AnnotationGetMethodsObjectByAnnotation")
Conout("Nome do Metodo: " + ObjMethod[1]:cMethodName)
Return |
Bloco de código | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#include "tlpp-core.th" @annotation AnnotationGetMethodsObjectByAnnotation @end Class GetMethodsObjectByAnnotation Public Method New() @AnnotationGetMethodsObjectByAnnotation() Public Method MethodWithAnnotation() EndClass Method New() class GetMethodsObjectByAnnotation Return Self Method MethodWithAnnotation() class GetMethodsObjectByAnnotation Return Function u_testGetMethodsObjectByAnnotation() Local ObjMethod Local oObj ObjMethod := Reflection.getMethodsObjectByAnnotation("GetMethodsObjectByAnnotation", "AnnotationGetMethodsObjectByAnnotation") Conout("Nome do Metodo: " + ObjMethod[1]:cMethodName) Return |
Resultado
...
dos Exemplos
Nome do Metodo: MethodWithAnnotation
...
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas