當前位置: 首頁>>代碼示例>>Java>>正文


Java SerializationConfig.getAnnotationIntrospector方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.SerializationConfig.getAnnotationIntrospector方法的典型用法代碼示例。如果您正苦於以下問題:Java SerializationConfig.getAnnotationIntrospector方法的具體用法?Java SerializationConfig.getAnnotationIntrospector怎麽用?Java SerializationConfig.getAnnotationIntrospector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.SerializationConfig的用法示例。


在下文中一共展示了SerializationConfig.getAnnotationIntrospector方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTypeSerializer

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
public TypeSerializer createTypeSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType)
{
  AnnotatedClass localAnnotatedClass = paramSerializationConfig.introspectClassAnnotations(paramJavaType.getRawClass()).getClassInfo();
  AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
  TypeResolverBuilder localTypeResolverBuilder = localAnnotationIntrospector.findTypeResolver(paramSerializationConfig, localAnnotatedClass, paramJavaType);
  Collection localCollection;
  if (localTypeResolverBuilder == null)
  {
    localTypeResolverBuilder = paramSerializationConfig.getDefaultTyper(paramJavaType);
    localCollection = null;
  }
  else
  {
    localCollection = paramSerializationConfig.getSubtypeResolver().collectAndResolveSubtypes(localAnnotatedClass, paramSerializationConfig, localAnnotationIntrospector);
  }
  if (localTypeResolverBuilder == null)
    return null;
  return localTypeResolverBuilder.buildTypeSerializer(paramSerializationConfig, paramJavaType, localCollection);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:20,代碼來源:BasicSerializerFactory.java

示例2: buildOldAnnotatedClass

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
private static AnnotatedClass buildOldAnnotatedClass(Method method, Class<?> declaringClass,
		SerializationConfig serializationConfig)
		throws InvocationTargetException, IllegalAccessException {
	boolean useAnnotations = serializationConfig.isAnnotationProcessingEnabled();
	AnnotationIntrospector aintr = useAnnotations ? serializationConfig.getAnnotationIntrospector() : null;
	return AnnotatedClass.class.cast(method.invoke(null, declaringClass, aintr, serializationConfig));
}
 
開發者ID:crnk-project,項目名稱:crnk-framework,代碼行數:8,代碼來源:AnnotatedClassBuilder.java

示例3: buildOldAnnotatedClass

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
private static AnnotatedClass buildOldAnnotatedClass(Method method, Class<?> declaringClass,
                                                     SerializationConfig serializationConfig)
    throws InvocationTargetException, IllegalAccessException {
    boolean useAnnotations = serializationConfig.isAnnotationProcessingEnabled();
    AnnotationIntrospector aintr = useAnnotations ? serializationConfig.getAnnotationIntrospector() : null;
    return AnnotatedClass.class.cast(method.invoke(null, declaringClass, aintr, serializationConfig));
}
 
開發者ID:katharsis-project,項目名稱:katharsis-framework,代碼行數:8,代碼來源:AnnotatedClassBuilder.java

示例4: construct

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
public static EnumSerializer construct(Class<Enum<?>> paramClass, SerializationConfig paramSerializationConfig, BeanDescription paramBeanDescription, JsonFormat.Value paramValue)
{
  AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
  EnumValues localEnumValues;
  if (paramSerializationConfig.isEnabled(SerializationFeature.WRITE_ENUMS_USING_TO_STRING))
    localEnumValues = EnumValues.constructFromToString(paramClass, localAnnotationIntrospector);
  else
    localEnumValues = EnumValues.constructFromName(paramClass, localAnnotationIntrospector);
  return new EnumSerializer(localEnumValues, _isShapeWrittenUsingIndex(paramClass, paramValue, true));
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:11,代碼來源:EnumSerializer.java

示例5: findPropertyContentTypeSerializer

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
public TypeSerializer findPropertyContentTypeSerializer(JavaType paramJavaType, SerializationConfig paramSerializationConfig, AnnotatedMember paramAnnotatedMember)
{
  JavaType localJavaType = paramJavaType.getContentType();
  AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
  TypeResolverBuilder localTypeResolverBuilder = localAnnotationIntrospector.findPropertyContentTypeResolver(paramSerializationConfig, paramAnnotatedMember, paramJavaType);
  if (localTypeResolverBuilder == null)
    return createTypeSerializer(paramSerializationConfig, localJavaType);
  return localTypeResolverBuilder.buildTypeSerializer(paramSerializationConfig, localJavaType, paramSerializationConfig.getSubtypeResolver().collectAndResolveSubtypes(paramAnnotatedMember, paramSerializationConfig, localAnnotationIntrospector, localJavaType));
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:10,代碼來源:BeanSerializerFactory.java

示例6: findPropertyTypeSerializer

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
public TypeSerializer findPropertyTypeSerializer(JavaType paramJavaType, SerializationConfig paramSerializationConfig, AnnotatedMember paramAnnotatedMember)
{
  AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
  TypeResolverBuilder localTypeResolverBuilder = localAnnotationIntrospector.findPropertyTypeResolver(paramSerializationConfig, paramAnnotatedMember, paramJavaType);
  if (localTypeResolverBuilder == null)
    return createTypeSerializer(paramSerializationConfig, paramJavaType);
  return localTypeResolverBuilder.buildTypeSerializer(paramSerializationConfig, paramJavaType, paramSerializationConfig.getSubtypeResolver().collectAndResolveSubtypes(paramAnnotatedMember, paramSerializationConfig, localAnnotationIntrospector, paramJavaType));
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:9,代碼來源:BeanSerializerFactory.java

示例7: removeIgnorableTypes

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
protected void removeIgnorableTypes(SerializationConfig paramSerializationConfig, BeanDescription paramBeanDescription, List<BeanPropertyDefinition> paramList)
{
  AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
  HashMap localHashMap = new HashMap();
  Iterator localIterator = paramList.iterator();
  while (localIterator.hasNext())
  {
    AnnotatedMember localAnnotatedMember = ((BeanPropertyDefinition)localIterator.next()).getAccessor();
    if (localAnnotatedMember == null)
    {
      localIterator.remove();
    }
    else
    {
      Class localClass = localAnnotatedMember.getRawType();
      Boolean localBoolean1 = (Boolean)localHashMap.get(localClass);
      Object localObject = localBoolean1;
      if (localBoolean1 == null)
      {
        Boolean localBoolean2 = localAnnotationIntrospector.isIgnorableType(paramSerializationConfig.introspectClassAnnotations(localClass).getClassInfo());
        localObject = localBoolean2;
        if (localBoolean2 == null)
          localObject = Boolean.FALSE;
        localHashMap.put(localClass, localObject);
      }
      if (((Boolean)localObject).booleanValue())
        localIterator.remove();
    }
  }
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:31,代碼來源:BeanSerializerFactory.java

示例8: modifySecondaryTypesByAnnotation

import com.fasterxml.jackson.databind.SerializationConfig; //導入方法依賴的package包/類
protected static <T extends JavaType> T modifySecondaryTypesByAnnotation(SerializationConfig paramSerializationConfig, Annotated paramAnnotated, T paramT)
{
  AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
  if (paramT.isContainerType())
  {
    Class localClass1 = localAnnotationIntrospector.findSerializationKeyType(paramAnnotated, paramT.getKeyType());
    if (localClass1 != null)
    {
      if (!(paramT instanceof MapType))
        throw new IllegalArgumentException("Illegal key-type annotation: type " + paramT + " is not a Map type");
      try
      {
        paramT = ((MapType)paramT).widenKey(localClass1);
      }
      catch (IllegalArgumentException localIllegalArgumentException2)
      {
        throw new IllegalArgumentException("Failed to narrow key type " + paramT + " with key-type annotation (" + localClass1.getName() + "): " + localIllegalArgumentException2.getMessage());
      }
    }
    Class localClass2 = localAnnotationIntrospector.findSerializationContentType(paramAnnotated, paramT.getContentType());
    if (localClass2 != null)
      try
      {
        JavaType localJavaType = paramT.widenContentsBy(localClass2);
        return localJavaType;
      }
      catch (IllegalArgumentException localIllegalArgumentException1)
      {
        throw new IllegalArgumentException("Failed to narrow content type " + paramT + " with content-type annotation (" + localClass2.getName() + "): " + localIllegalArgumentException1.getMessage());
      }
  }
  return paramT;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:34,代碼來源:BasicSerializerFactory.java


注:本文中的com.fasterxml.jackson.databind.SerializationConfig.getAnnotationIntrospector方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。