Árvore de páginas

Versões comparadas

Chave

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

...

Pagetitle
Reflection.isAnnotationDataPresent
Reflection.isAnnotationDataPresent

Procura Efetua a busca de uma Annotation em uma propriedade de um objeto.

...

Nome

Tipo

Descrição

Obrigatório

Referência

oObj

objeto

Indica o objeto Objeto onde será procurado a Annotation.

X


cPropertyName

caractere

Indica o nome Nome da propriedade onde será procurada a Annotation.

X


cAnnotationName
caractereIndica o nome Nome da Annotation que será procurada. X

Retorno

Nome

Tipo

Descrição

lRet

lógico

Retorna  .T. caso encontre a Annotation e .F. caso não encontre.

Exemplos

Bloco de código
languagecpp
themeEclipse
titleexemplo1test_doc_IsAnnotationDataPresent.tlpp
linenumberstrue
#include "tlpp-core.th"

@annotation AnnotationExemploAnnotationIsAnnotationDataPresent
    nickname as char
@end

Class IsAnnotationDataPresent
class MeuObjeto
	@AnnotationExemplo@AnnotationIsAnnotationDataPresent(nickname = "CompanyTotvs")
	publicPublic data data1

	publicPublic methodMethod newNew()
EndClass


main function usoDeAnnotationMethod New() class IsAnnotationDataPresent
Return Self

Function u_testIsAnnotationDataPresent()
	localLocal oObj := MeuObjetoIsAnnotationDataPresent():New()
	conoutConout(Reflection.isAnnotationDataPresent(oObj, "data1", "AnnotationExemploAnnotationIsAnnotationDataPresent"))
	conoutConout(Reflection.isAnnotationDataPresent(oObj, "data1", "TesteNoExist"))
returnReturn

Resultado do Exemplo

.T.

.F.

...