Histórico da Página
...
| Pagetitle | ||||
|---|---|---|---|---|
|
Procura Annotation Efetua a busca de Annotations associadas a um determinado método.
...
| Bloco de código | ||
|---|---|---|
| ||
Reflection.getMethodAnnotationList( oObjxParam, cMethodName) |
Parâmetros
Nome | Tipo | Descrição | Obrigatório | Referência |
|---|---|---|---|---|
oObjxParam | objeto/caractere** | Objeto instância da classe/nome da classe** onde está definido o método cujas Annotation Annotations serão retornadas | X | |
cMethodName | caractere | Método onde serão procuradas as Annotations | X |
...
| Bloco de código | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
#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 |
| Bloco de código | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
#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 aRet
aRet := Reflection.getMethodAnnotationList("GetMethodAnnotationList", "MethodWithAnnotation")
Conout(Len(aRet))
Conout(aRet[1]["teste1"])
Conout(aRet[2]["teste2"])
Return |
Resultado do Exemplo
...
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas