本文整理汇总了Java中com.fasterxml.jackson.databind.introspect.Annotated.hasAnnotation方法的典型用法代码示例。如果您正苦于以下问题:Java Annotated.hasAnnotation方法的具体用法?Java Annotated.hasAnnotation怎么用?Java Annotated.hasAnnotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.introspect.Annotated
的用法示例。
在下文中一共展示了Annotated.hasAnnotation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findSerializer
import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findSerializer( Annotated annotated ) {
if( ! annotated.hasAnnotation(Column.class) || ! isStringType(annotated) ) {
return super.findSerializer( annotated );
}
Class classType = annotated.getRawType();
if( Types.isNotString(classType) ) {
if( Types.isBoolean(classType) ) {
return ColumnBooleanSerializer.class;
} else if( ! Types.isPrimitive(classType) ) {
return ColumnBeanSerializer.class;
}
}
return super.findSerializer( annotated );
}
示例2: findDeserializer
import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findDeserializer( Annotated annotated ) {
if( ! annotated.hasAnnotation(Column.class) || ! isStringType(annotated) ) {
return super.findDeserializer( annotated );
}
Class classType;
try {
classType = ( (AnnotatedMethod) annotated ).getRawParameterType( 0 );
} catch( Exception e ) {
classType = annotated.getRawType();
}
if( Types.isNotString(classType) ) {
if( Types.isBoolean(classType) ) {
return ColumnBooleanDeserializer.class;
} else if( ! Types.isPrimitive(classType) ) {
return ColumnBeanDeserializer.class;
}
}
return super.findDeserializer( annotated );
}
示例3: findSerializer
import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@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);
}
}
示例4: findDeserializer
import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findDeserializer(Annotated am) {
if (am.hasAnnotation(ManyToOne.class)) {
return new ManyToOneDeserializer(am.getRawType());
} else {
return super.findDeserializer(am);
}
}
示例5: findSerializer
import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
@Override
public Object findSerializer(Annotated am) {
if (am.hasAnnotation(Obfuscate.class)) {
return OBFUSCATE_SERIALIZER;
} else {
return null;
}
}
示例6: getMappedName
import com.fasterxml.jackson.databind.introspect.Annotated; //导入方法依赖的package包/类
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;
}
}