本文整理匯總了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;
}
}