Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
collapsefalse
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
arrayLista de parâmetros com a posição onde a Annotation foi encontrada.           X        X
cAnnotationName
caractereNome da Annotation a  ser procurada.           X

...

Bloco de código
languagecpp
themeEclipse
titletest_doc_getMethodParmsByAnnotation.tlpp
linenumberstrue
#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
languagecpp
themeEclipse
title

...

exemplo2.tlpp
linenumberstrue
#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

...