public FieldOutline process(AnnotateOutline context, FieldOutline fieldOutline, Options options, Object attributes) { final String name = context.getMapping().getNaming() .getPropertyName(context.getMapping(), fieldOutline); logger.debug("Processing field [" + name + "]."); // Ok final JMethod issetter = FieldAccessorUtils.issetter(fieldOutline); if (issetter != null) { logger.debug("Annotating [" + issetter.name() + "] with @javax.persistence.Transient."); issetter.annotate(Transient.class); } final Object attribute = AttributesUtils.getAttribute(attributes, name); Collection<XAnnotation<?>> xannotations = context.getCreateXAnnotations() .createAttributeAnnotations(attribute); final JMethod getter = FieldAccessorUtils.getter(fieldOutline); logger.debug("Annotating the field [" + OutlineUtils.getFieldName(fieldOutline) + "]:\n" + ArrayUtils.toString(xannotations)); if (xannotations == null) { logger.error("No annotations for the field [" + OutlineUtils.getFieldName(fieldOutline) + "]:\n" + ArrayUtils.toString(xannotations)); } else { context.getApplyXAnnotations().annotate( fieldOutline.parent().ref.owner(), getter, xannotations); } return fieldOutline; }
public FieldOutline process(AnnotateOutline context, FieldOutline fieldOutline, Options options, Object attributes) { final String name = context.getMapping().getNaming() .getPropertyName(context.getMapping(), fieldOutline); logger.debug("Processing field [" + name + "]."); // Ok final JMethod issetter = FieldAccessorUtils.issetter(fieldOutline); if (issetter != null) { logger.debug("Annotating [" + issetter.name() + "] with @javax.persistence.Transient."); issetter.annotate(Transient.class); } final Object attribute = AttributesUtils.getAttribute(attributes, name); Collection<XAnnotation<?>> xannotations = context.getCreateXAnnotations() .createAttributeAnnotations(attribute); final JMethod getter = FieldAccessorUtils.getter(fieldOutline); logger.debug("Annotating the field [" + OutlineUtils.getFieldName(fieldOutline) + "]:\n" + ArrayUtils.toString(xannotations)); if (xannotations == null) { logger.error("No annotations for the field [" + OutlineUtils.getFieldName(fieldOutline) + "]:\n" + ArrayUtils.toString(xannotations)); } else { context.getApplyXAnnotations().annotate( fieldOutline.parent().ref.owner(), getter, xannotations); } return fieldOutline; }