本文整理匯總了Java中com.fasterxml.jackson.databind.introspect.Annotated.getRawType方法的典型用法代碼示例。如果您正苦於以下問題:Java Annotated.getRawType方法的具體用法?Java Annotated.getRawType怎麽用?Java Annotated.getRawType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.fasterxml.jackson.databind.introspect.Annotated
的用法示例。
在下文中一共展示了Annotated.getRawType方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findSerializer
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Object findSerializer(Annotated annotatedMethod) {
IdFormat annotation = annotatedMethod.getAnnotation(IdFormat.class);
if (annotatedMethod.getRawType() == UUID.class) {
if (annotation != null) {
switch (annotation.value()) {
case RAW:
return UUIDSerializer.class;
case URL62:
return FriendlyIdSerializer.class;
}
}
return FriendlyIdSerializer.class;
} else {
return null;
}
}
示例2: 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 );
}
示例3: 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 );
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: rawDeserializationType
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
protected Class<?> rawDeserializationType(Annotated a) {
if (a instanceof AnnotatedMethod) {
AnnotatedMethod am = (AnnotatedMethod) a;
if (am.getParameterCount() == 1) {
return am.getRawParameterType(0);
}
}
return a.getRawType();
}
示例7: isDate
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
private boolean isDate(Annotated annotated) {
Class<?> clazz = annotated.getRawType();
if (Collection.class.isAssignableFrom(clazz)) {
ParameterizedType type = (ParameterizedType) annotated.getGenericType();
clazz = (Class<?>) type.getActualTypeArguments()[0];
}
return clazz.equals(Date.class);
}
示例8: findSerializer
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Object findSerializer(Annotated a) {
Class<?> clazz = a.getRawType();
if (Collection.class.isAssignableFrom(clazz)) {
return null; // Collection should be handled in findContentSerializer(Annotated a)
}
Object serializer = findSerializerToUse(a);
if (serializer != null) {
return serializer;
}
return super.findSerializer(a);
}
示例9: findContentSerializer
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public Class<? extends JsonSerializer<?>> findContentSerializer(Annotated a) {
Class<?> clazz = a.getRawType();
if (!Collection.class.isAssignableFrom(clazz)) {
return null; // Only handle Collection
}
Object serializer = findSerializerToUse(a);
if (serializer != null) {
return (Class<? extends JsonSerializer<?>>) serializer;
}
return super.findContentSerializer(a);
}
示例10: findDeserializer
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Class<? extends JsonDeserializer<?>> findDeserializer(Annotated a) {
Class<?> clazz = a.getRawType();
if (Collection.class.isAssignableFrom(clazz)) {
return null; // Collection should be handled in findContentDeserializer(Annotated a)
}
Class<? extends JsonDeserializer<?>> deserializer = findDeserializerToUse(a);
if (deserializer != null) {
return deserializer;
}
return super.findDeserializer(a);
}
示例11: findContentDeserializer
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Class<? extends JsonDeserializer<?>> findContentDeserializer(Annotated a) {
Class<?> clazz = a.getRawType();
if (!Collection.class.isAssignableFrom(clazz)) {
return null; // Only handle Collection
}
Class<? extends JsonDeserializer<?>> deserializer = findDeserializerToUse(a);
if (deserializer != null) {
return deserializer;
}
return super.findContentDeserializer(a);
}
示例12: isOutputAsAttribute
import com.fasterxml.jackson.databind.introspect.Annotated; //導入方法依賴的package包/類
@Override
public Boolean isOutputAsAttribute(Annotated ann) {
if ("details".equals(getName(ann)))
return null;
Class<?> type = ann.getRawType();
if (type.isPrimitive() || type.isEnum() || type == String.class)
return true;
return null;
}