Árvore de páginas

Procura uma Annotation em um objeto.

Sintaxe

Reflection.isAnnotationObjectPresent( oObj, cAnnotationName )

Parâmetros

Nome

Tipo

Descrição

Obrigatório

Referência

oObj

objeto

Indica o objeto onde será procurado a Annotation.

X


cAnnotationName 

caractere

Indica o nome da Annotation que será procurada.

X


Retorno

Nome

Tipo

Descrição

lRet

numérico

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

Exemplos

exemplo1.tlpp
@annotation AnnotationExemplo
    nickname as char
@end

@AnnotationExemplo(nickname = "Company")
class MeuObjeto
	public data data1
	public method new()
EndClass


main function usoDeAnnotation()
	local oObj := MeuObjeto():New()
	conout(Reflection.isAnnotationObjectPresent(oObj,"AnnotationExemplo"))
	conout(Reflection.isAnnotationObjectPresent(oObj,"Teste"))
return

Resultado do Exemplo

.T.

.F.

Abrangência

17.3.0.3

Veja também

  • Sem rótulos