當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。