Histórico da Página
...
Bloco de código | ||
---|---|---|
| ||
Reflection.getMethodParmsByAnnotation( oObjectxParam, cMethodName, aListParms, cAnnotationName) |
...
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
oObjectxParam | objeto/caractere** | Objeto instância da classe/nome da classe** proprietário/a** do método onde será procurada a Annotation. | X | |
cMethodName | caractere | Nome do método onde será procurada a Annotation. | X | |
aListParms | array | Lista de parâmetros com a posição onde a Annotation foi encontrada. | X | X |
cAnnotationName | caractere | Nome da Annotation a ser procurada. | X |
...
Bloco de código | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#include "tlpp-core.th"
@annotation AnnotationGetMethodParmsByAnnotation
nickname as char
@end
Class GetMethodParmsByAnnotation
Public Method New()
Public Method ParmByAnnotation(@AnnotationGetMethodParmsByAnnotation("annotation parm1") parm1, @AnnotationGetMethodParmsByAnnotation("annotation parm2") parm2)
EndClass
Method New() class GetMethodParmsByAnnotation
Return Self
Function u_testGetMethodParmsByAnnotation()
Local oObj := GetMethodParmsByAnnotation():New()
Local lRet := .F. as logical
Local aRet := {} as array
lRet := Reflection.GetMethodParmsByAnnotation(oObj, "ParmByAnnotation", @aRet, "AnnotationGetMethodParmsByAnnotation")
if lRet
Conout(lRet)
aEval(aRet,{|x| Conout(x)})
else
Conout('Nao foi possivel encontrar nenhuma Annotation com os parametros informados')
endIf
Return |
Bloco de código | |||||
---|---|---|---|---|---|
|
...
| |||
#include "tlpp-core.th"
@annotation AnnotationGetMethodParmsByAnnotation
nickname as char
@end
Class GetMethodParmsByAnnotation
Public Method New()
Public Method ParmByAnnotation(@AnnotationGetMethodParmsByAnnotation("annotation parm1") parm1, @AnnotationGetMethodParmsByAnnotation("annotation parm2") parm2)
EndClass
Method New() class GetMethodParmsByAnnotation
Return Self
Function u_testGetMethodParmsByAnnotation()
Local lRet := .F. as logical
Local aRet := {} as array
lRet := Reflection.GetMethodParmsByAnnotation("GetMethodParmsByAnnotation", "ParmByAnnotation", @aRet, "AnnotationGetMethodParmsByAnnotation")
if lRet
Conout(lRet)
aEval(aRet,{|x| Conout(x)})
else
Conout('Nao foi possivel encontrar nenhuma Annotation com os parametros informados')
endIf
Return |
Resultado dos Exemplos
.T.
1
2
Abrangência
17.3.0.3
Veja também
...
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas