Following up on this, I seem to be missing something.

In my PanelFactory, I am trying to detect an annotation. I have the
following:

        @Override
        protected ApplicationAdvice appliesTo(IModel<?> model) {
                if (model instanceof ScalarModel) {
                        Object obj = model.getObject();
                        if (obj != null) {
                                if (obj instanceof PojoAdapter) {
                                        PojoAdapter po = (PojoAdapter) obj;
                                        
System.out.println(po.getSpecification().getCorrespondingClass().getName());
                                        if
(po.getSpecification().getCorrespondingClass().isAnnotationPresent(Html.class))
{
                                                return 
ApplicationAdvice.APPLIES;
                                        }
                                }
                        }
                }
                return ApplicationAdvice.DOES_NOT_APPLY;
        }

But it is not detecting my annotation on the field:

        // {{ Description (property)
        @Column(allowsNull = "false")
        @PropertyLayout( multiLine = 10, typicalLength = 80)
        @Html
        private String description;

        @MemberOrder(sequence = "1")
        public String getDescription() {
                return description;
        }

        public void setDescription(final String description) {
                this.description = description;
        }
        public String defaultDescription(){
                return "Your text here";
        }
        // }}


I remember something about facts, should I rather be working with them?

Regards,
Kevin



-- 
Kevin Meyer
Ljubljana, Slovenia


Reply via email to