/** * Convenience method for accessing annotation that may be associated * either directly on property, or, if not, via enclosing class (context). * This allows adding baseline contextual annotations, for example, by adding * an annotation for a given class and making that apply to all properties * unless overridden by per-property annotations. *<p> * This method is functionally equivalent to: *<pre> * MyAnnotation ann = propWriter.getAnnotation(MyAnnotation.class); * if (ann == null) { * ann = propWriter.getContextAnnotation(MyAnnotation.class); * } *</pre> * that is, tries to find a property annotation first, but if one is not * found, tries to find context-annotation (from enclosing class) of * same type. * * @since 2.5 */ public <A extends Annotation> A findAnnotation(Class<A> acls) { A ann = getAnnotation(acls); if (ann == null) { ann = getContextAnnotation(acls); } return ann; }
/** * Convenience method for accessing annotation that may be associated * either directly on property, or, if not, via enclosing class (context). * This allows adding baseline contextual annotations, for example, by adding * an annotation for a given class and making that apply to all properties * unless overridden by per-property annotations. *<p> * This method is functionally equivalent to: *<pre> * MyAnnotation ann = propWriter.getAnnotation(MyAnnotation.class); * if (ann == null) { * ann = propWriter.getContextAnnotation(MyAnnotation.class); * } *</pre> * that is, tries to find a property annotation first, but if one is not * found, tries to find context-annotation (from enclosing class) of * same type. * * @since 2.5 */ public <A extends Annotation> A findAnnotation(Class<A> acls) { A ann = getAnnotation(acls); if (ann == null) { ann = getContextAnnotation(acls); } return ann; }
/** * Convenience method for accessing annotation that may be associated * either directly on property, or, if not, via enclosing class (context). * This allows adding baseline contextual annotations, for example, by adding * an annotation for a given class and making that apply to all properties * unless overridden by per-property annotations. *<p> * This method is functionally equivalent to: *<pre> * MyAnnotation ann = propWriter.getAnnotation(MyAnnotation.class); * if (ann == null) { * ann = propWriter.getContextAnnotation(MyAnnotation.class); * } *</pre> * that is, tries to find a property annotation first, but if one is not * found, tries to find context-annotation (from enclosing class) of * same type. * * @since 2.5 */ public <A extends Annotation> A findAnnotation(Class<A> acls) { A ann = getAnnotation(acls); if (ann == null) { ann = getContextAnnotation(acls); } return ann; }
/** * Convenience method for accessing annotation that may be associated * either directly on property, or, if not, via enclosing class (context). * This allows adding baseline contextual annotations, for example, by adding * an annotation for a given class and making that apply to all properties * unless overridden by per-property annotations. *<p> * This method is functionally equivalent to: *<pre> * MyAnnotation ann = propWriter.getAnnotation(MyAnnotation.class); * if (ann == null) { * ann = propWriter.getContextAnnotation(MyAnnotation.class); * } *</pre> * that is, tries to find a property annotation first, but if one is not * found, tries to find context-annotation (from enclosing class) of * same type. * * @since 2.5 */ public <A extends Annotation> A findAnnotation(Class<A> acls) { A ann = getAnnotation(acls); if (ann == null) { ann = getContextAnnotation(acls); } return ann; }
/** * Convenience method for accessing annotation that may be associated * either directly on property, or, if not, via enclosing class (context). * This allows adding baseline contextual annotations, for example, by adding * an annotation for a given class and making that apply to all properties * unless overridden by per-property annotations. *<p> * This method is functionally equivalent to: *<pre> * MyAnnotation ann = propWriter.getAnnotation(MyAnnotation.class); * if (ann == null) { * ann = propWriter.getContextAnnotation(MyAnnotation.class); * } *</pre> * that is, tries to find a property annotation first, but if one is not * found, tries to find context-annotation (from enclosing class) of * same type. * * @since 2.5 */ public <A extends Annotation> A findAnnotation(Class<A> acls) { A ann = getAnnotation(acls); if (ann == null) { ann = getContextAnnotation(acls); } return ann; }
JsonDetails det = writer.getAnnotation(JsonDetails.class); if (det != null) { if (!details && det.value()) {