Java Code Examples for com.fasterxml.jackson.databind.introspect.Annotated#hasAnnotation()
The following examples show how to use
com.fasterxml.jackson.databind.introspect.Annotated#hasAnnotation() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HibernateAnnotationIntrospector.java From onedev with MIT License | 5 votes |
@SuppressWarnings("unchecked") @Override public Object findSerializer(Annotated am) { if (am.hasAnnotation(ManyToOne.class)) { return new ManyToOneSerializer((Class<AbstractEntity>) am.getRawType()); } else { return super.findDeserializer(am); } }
Example 2
Source File: HibernateAnnotationIntrospector.java From onedev with MIT License | 5 votes |
@Override public Object findDeserializer(Annotated am) { if (am.hasAnnotation(ManyToOne.class)) { return new ManyToOneDeserializer(am.getRawType()); } else { return super.findDeserializer(am); } }
Example 3
Source File: CustomAnnotationIntrospector.java From elepy with Apache License 2.0 | 5 votes |
private boolean isId(Annotated annotated) { return annotated.hasAnnotation(Id.class) || annotated.hasAnnotation(javax.persistence.Id.class) || annotated.hasAnnotation(Identifier.class) || annotated.getName().equals("id"); }
Example 4
Source File: EntityAnnotationIntrospector.java From requery with Apache License 2.0 | 5 votes |
private PropertyName getMappedName(Annotated annotated) { if (annotated.hasAnnotation(Table.class)) { Table table = annotated.getAnnotation(Table.class); return new PropertyName(table.name()); } if (annotated.hasAnnotation(View.class)) { View view = annotated.getAnnotation(View.class); return new PropertyName(view.name()); } else if (annotated.hasAnnotation(Column.class)) { Column column = annotated.getAnnotation(Column.class); return new PropertyName(column.name()); } else { return null; } }
Example 5
Source File: ObfuscateAnnotationIntrospector.java From Singularity with Apache License 2.0 | 5 votes |
@Override public Object findSerializer(Annotated am) { if (am.hasAnnotation(Obfuscate.class)) { return OBFUSCATE_SERIALIZER; } else { return null; } }
Example 6
Source File: RosettaAnnotationIntrospector.java From Rosetta with Apache License 2.0 | 4 votes |
@Override public boolean hasCreatorAnnotation(Annotated a) { return a.hasAnnotation(RosettaCreator.class); }