@Override public <A extends Annotation> A getContextAnnotation(Class<A> acls) { return _property.getContextAnnotation(acls); }
@Override public <A extends Annotation> A getContextAnnotation(Class<A> acls) { return (_property == null) ? null : _property.getContextAnnotation(acls); }
@Override public <A extends Annotation> A getContextAnnotation(Class<A> acls) { return (_property == null) ? null : _property.getContextAnnotation(acls); }
@Override public <A extends Annotation> A getContextAnnotation(Class<A> acls) { return _property.getContextAnnotation(acls); }
@Override public <A extends Annotation> A getContextAnnotation(Class<A> acls) { return (_property == null) ? null : _property.getContextAnnotation(acls); }
@Override public JsonSerializer<?> createContextual(SerializerProvider serializerProvider, BeanProperty beanProperty) throws JsonMappingException { if (beanProperty != null) { // System.err.println("beanProperty:" + beanProperty + " name:" + beanProperty.getName() + " type:" + beanProperty.getMember().getGenericType()); Class<A> clazz = annotation(); A anno = beanProperty.getAnnotation(clazz); if (anno == null) { anno = beanProperty.getContextAnnotation(clazz); } if (anno != null) { try { return this.create(clazz, anno, beanProperty); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } return serializerProvider.findValueSerializer(beanProperty.getType(), beanProperty); } return serializerProvider.findNullValueSerializer(beanProperty); }
ann = property.getContextAnnotation(JsonId.class);
@Override public JsonSerializer<?> createContextual(SerializerProvider provider, BeanProperty property) throws JsonMappingException { Sensitive sensitive = null; if (property != null) { logger.debug("Checking property for @Sensitive annotation."); sensitive = property.getAnnotation(Sensitive.class); if (sensitive == null) { logger.debug("Checking property for @Sensitive context annotation."); sensitive = property.getContextAnnotation(Sensitive.class); } } if (sensitive != null) { String sensitiveMask = sensitive.mask(); char sensitiveCharacter = sensitive.character(); logger.debug("Found an annotation with mask {} and masking character {}.", sensitiveMask, sensitiveCharacter); return new CensorshipSerializer(sensitiveMask, sensitiveCharacter); } // the default serializer has no mask so use it return this; }