当前位置: 首页>>代码示例>>Java>>正文


Java Annotated.getRawType方法代码示例

本文整理汇总了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;
	}
}
 
开发者ID:Devskiller,项目名称:friendly-id,代码行数:18,代码来源:FriendlyIdAnnotationIntrospector.java

示例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 );

}
 
开发者ID:NyBatis,项目名称:NyBatisCore,代码行数:21,代码来源:ColumnAnnotationInspector.java

示例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 );

}
 
开发者ID:NyBatis,项目名称:NyBatisCore,代码行数:26,代码来源:ColumnAnnotationInspector.java

示例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);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:10,代码来源:HibernateAnnotationIntrospector.java

示例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);
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:9,代码来源:HibernateAnnotationIntrospector.java

示例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();
}
 
开发者ID:Devskiller,项目名称:friendly-id,代码行数:10,代码来源:FriendlyIdAnnotationIntrospector.java

示例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);
}
 
开发者ID:aureliano,项目名称:evt-bridge,代码行数:9,代码来源:ElasticSearchAnnotationIntrospector.java

示例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);
}
 
开发者ID:aureliano,项目名称:evt-bridge,代码行数:13,代码来源:ElasticSearchAnnotationIntrospector.java

示例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);
}
 
开发者ID:aureliano,项目名称:evt-bridge,代码行数:14,代码来源:ElasticSearchAnnotationIntrospector.java

示例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);
}
 
开发者ID:aureliano,项目名称:evt-bridge,代码行数:14,代码来源:ElasticSearchAnnotationIntrospector.java

示例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);
}
 
开发者ID:aureliano,项目名称:evt-bridge,代码行数:13,代码来源:ElasticSearchAnnotationIntrospector.java

示例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;
}
 
开发者ID:pescuma,项目名称:buildhealth,代码行数:12,代码来源:BuildHealthWebServer.java


注:本文中的com.fasterxml.jackson.databind.introspect.Annotated.getRawType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。