Árvore de páginas

Versões comparadas

Chave

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

...

Bloco de código
languagecpp
themeEclipse
titleexemplo1.tlpp
linenumberstrue
#include "tlpp-core.th"
 
@annotation attr
@end
 
Class GetAttributesByAnnotation
 
  @attr()
  Public Data cAttr as Character
  Public Method New()
  
EndClass
 
Method New() class GetAttributesByAnnotation
  ::cAttr := "initialized"
Return self
 
Function u_testGetAttributesByAnnotation()
  
  Local aAttr as Array
  local obj   as Object

  obj   := GetAttributesByAnnotation():New()
  aAttr := Reflection.getAttributesByAnnotation(obj, "attr")
  ConOut(aAttr[1]:cAttributeName)
  ConOut(aAttr[1]:cAttributeType)
  
Return
Bloco de código
languagecpp
themeEclipse
titleexemplo2.tlpp
linenumberstrue
#include "tlpp-core.th"
 
@annotation attr
@end
 
Class GetAttributesByAnnotation
 
  @attr()
  Public Data cAttr as Character
  Public Method New()
  
EndClass
 
Method New() class GetAttributesByAnnotation
  ::cAttr := "initialized"
Return self
 
Function u_testGetAttributesByAnnotation()
  
  Local aAttr as Array

  obj   := GetAttributesByAnnotation():New()
  aAttr := Reflection.getAttributesByAnnotation("GetAttributesByAnnotation", "attr")
  ConOut(aAttr[1]:cAttributeName)
  ConOut(aAttr[1]:cAttributeType)
  
Return

Resultado do Exemplo

-----------------------
CATTR
CHARACTER
-----------------------

...