java - Read property of annotation -


if had defined class:

@mainform(grupo = 3, icone = "user") public class usuario {     ... } 

and pass view list (which include class above):

public list<class<?>> lista_classes_projeto() {     ... } 

is there way read value icone in jsp code:

        <c:foreach var="option" items="${lista}">             <li>                 <c:url value="/${option.simplename}/listagem" var="url"/>                 <a class="link" href="${url}">                     <i class="icon-"></i>                     <span>${option.simplename}</span>                 </a>             </li>         </c:foreach> 

i didn't test, give line try: (in each)

((mainform) option.getannotation(mainform.class)).icone(); 

note null handling ignored. assume option (class) has annotation @mainform


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -