本文整理匯總了Java中org.codehaus.jackson.map.SerializationConfig.getAnnotationIntrospector方法的典型用法代碼示例。如果您正苦於以下問題:Java SerializationConfig.getAnnotationIntrospector方法的具體用法?Java SerializationConfig.getAnnotationIntrospector怎麽用?Java SerializationConfig.getAnnotationIntrospector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.codehaus.jackson.map.SerializationConfig
的用法示例。
在下文中一共展示了SerializationConfig.getAnnotationIntrospector方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeIgnorableTypes
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected <T extends AnnotatedMember> void removeIgnorableTypes(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, Map<String, T> paramMap)
{
if (paramMap.isEmpty());
while (true)
{
return;
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
Iterator localIterator = paramMap.entrySet().iterator();
HashMap localHashMap = new HashMap();
while (localIterator.hasNext())
{
Class localClass = ((AnnotatedMember)((Map.Entry)localIterator.next()).getValue()).getRawType();
Boolean localBoolean = (Boolean)localHashMap.get(localClass);
if (localBoolean == null)
{
localBoolean = localAnnotationIntrospector.isIgnorableType(((BasicBeanDescription)paramSerializationConfig.introspectClassAnnotations(localClass)).getClassInfo());
if (localBoolean == null)
localBoolean = Boolean.FALSE;
localHashMap.put(localClass, localBoolean);
}
if (!localBoolean.booleanValue())
continue;
localIterator.remove();
}
}
}
示例2: findPropertyContentTypeSerializer
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
public TypeSerializer findPropertyContentTypeSerializer(JavaType paramJavaType, SerializationConfig paramSerializationConfig, AnnotatedMember paramAnnotatedMember, BeanProperty paramBeanProperty)
throws JsonMappingException
{
JavaType localJavaType = paramJavaType.getContentType();
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
TypeResolverBuilder localTypeResolverBuilder = localAnnotationIntrospector.findPropertyContentTypeResolver(paramSerializationConfig, paramAnnotatedMember, paramJavaType);
if (localTypeResolverBuilder == null)
return createTypeSerializer(paramSerializationConfig, localJavaType, paramBeanProperty);
return localTypeResolverBuilder.buildTypeSerializer(paramSerializationConfig, localJavaType, paramSerializationConfig.getSubtypeResolver().collectAndResolveSubtypes(paramAnnotatedMember, paramSerializationConfig, localAnnotationIntrospector), paramBeanProperty);
}
示例3: findPropertyTypeSerializer
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
public TypeSerializer findPropertyTypeSerializer(JavaType paramJavaType, SerializationConfig paramSerializationConfig, AnnotatedMember paramAnnotatedMember, BeanProperty paramBeanProperty)
throws JsonMappingException
{
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
TypeResolverBuilder localTypeResolverBuilder = localAnnotationIntrospector.findPropertyTypeResolver(paramSerializationConfig, paramAnnotatedMember, paramJavaType);
if (localTypeResolverBuilder == null)
return createTypeSerializer(paramSerializationConfig, paramJavaType, paramBeanProperty);
return localTypeResolverBuilder.buildTypeSerializer(paramSerializationConfig, paramJavaType, paramSerializationConfig.getSubtypeResolver().collectAndResolveSubtypes(paramAnnotatedMember, paramSerializationConfig, localAnnotationIntrospector), paramBeanProperty);
}
示例4: sortBeanProperties
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected List<BeanPropertyWriter> sortBeanProperties(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, List<BeanPropertyWriter> paramList)
{
List localList = paramBasicBeanDescription.findCreatorPropertyNames();
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
AnnotatedClass localAnnotatedClass = paramBasicBeanDescription.getClassInfo();
String[] arrayOfString = localAnnotationIntrospector.findSerializationPropertyOrder(localAnnotatedClass);
Boolean localBoolean = localAnnotationIntrospector.findSerializationSortAlphabetically(localAnnotatedClass);
if (localBoolean == null);
for (boolean bool = paramSerializationConfig.isEnabled(SerializationConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY); ; bool = localBoolean.booleanValue())
{
if ((bool) || (!localList.isEmpty()) || (arrayOfString != null))
paramList = _sortBeanProperties(paramList, localList, arrayOfString, bool);
return paramList;
}
}
示例5: construct
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
public static EnumSerializer construct(Class<Enum<?>> paramClass, SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription)
{
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING));
for (EnumValues localEnumValues = EnumValues.constructFromToString(paramClass, localAnnotationIntrospector); ; localEnumValues = EnumValues.constructFromName(paramClass, localAnnotationIntrospector))
return new EnumSerializer(localEnumValues);
}
示例6: findContentSerializer
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected static JsonSerializer<Object> findContentSerializer(SerializationConfig paramSerializationConfig, Annotated paramAnnotated, BeanProperty paramBeanProperty)
{
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
Class localClass = localAnnotationIntrospector.findContentSerializer(paramAnnotated);
if (((localClass == null) || (localClass == JsonSerializer.None.class)) && (paramBeanProperty != null))
localClass = localAnnotationIntrospector.findContentSerializer(paramBeanProperty.getMember());
if ((localClass != null) && (localClass != JsonSerializer.None.class))
return paramSerializationConfig.serializerInstance(paramAnnotated, localClass);
return null;
}
示例7: findKeySerializer
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected static JsonSerializer<Object> findKeySerializer(SerializationConfig paramSerializationConfig, Annotated paramAnnotated, BeanProperty paramBeanProperty)
{
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
Class localClass = localAnnotationIntrospector.findKeySerializer(paramAnnotated);
if (((localClass == null) || (localClass == JsonSerializer.None.class)) && (paramBeanProperty != null))
localClass = localAnnotationIntrospector.findKeySerializer(paramBeanProperty.getMember());
if ((localClass != null) && (localClass != JsonSerializer.None.class))
return paramSerializationConfig.serializerInstance(paramAnnotated, localClass);
return null;
}
示例8: createTypeSerializer
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
public TypeSerializer createTypeSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
{
AnnotatedClass localAnnotatedClass = ((BasicBeanDescription)paramSerializationConfig.introspectClassAnnotations(paramJavaType.getRawClass())).getClassInfo();
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
TypeResolverBuilder localTypeResolverBuilder = localAnnotationIntrospector.findTypeResolver(paramSerializationConfig, localAnnotatedClass, paramJavaType);
Collection localCollection = null;
if (localTypeResolverBuilder == null)
localTypeResolverBuilder = paramSerializationConfig.getDefaultTyper(paramJavaType);
while (localTypeResolverBuilder == null)
{
return null;
localCollection = paramSerializationConfig.getSubtypeResolver().collectAndResolveSubtypes(localAnnotatedClass, paramSerializationConfig, localAnnotationIntrospector);
}
return localTypeResolverBuilder.buildTypeSerializer(paramSerializationConfig, paramJavaType, localCollection, paramBeanProperty);
}
示例9: usesStaticTyping
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected boolean usesStaticTyping(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription, TypeSerializer paramTypeSerializer, BeanProperty paramBeanProperty)
{
if (paramTypeSerializer != null);
AnnotationIntrospector localAnnotationIntrospector;
JavaType localJavaType;
do
{
do
{
do
{
return false;
localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
JsonSerialize.Typing localTyping = localAnnotationIntrospector.findSerializationTyping(paramBasicBeanDescription.getClassInfo());
if (localTyping != null)
{
if (localTyping == JsonSerialize.Typing.STATIC)
return true;
}
else if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.USE_STATIC_TYPING))
return true;
}
while (paramBeanProperty == null);
localJavaType = paramBeanProperty.getType();
}
while (!localJavaType.isContainerType());
if (localAnnotationIntrospector.findSerializationContentType(paramBeanProperty.getMember(), paramBeanProperty.getType()) != null)
return true;
}
while ((!(localJavaType instanceof MapType)) || (localAnnotationIntrospector.findSerializationKeyType(paramBeanProperty.getMember(), paramBeanProperty.getType()) == null));
return true;
}
示例10: forSerialization
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
public BasicBeanDescription forSerialization(SerializationConfig paramSerializationConfig, JavaType paramJavaType, ClassIntrospector.MixInResolver paramMixInResolver)
{
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
AnnotatedClass localAnnotatedClass = AnnotatedClass.construct(paramJavaType.getRawClass(), localAnnotationIntrospector, paramMixInResolver);
localAnnotatedClass.resolveMemberMethods(getSerializationMethodFilter(paramSerializationConfig), false);
localAnnotatedClass.resolveCreators(true);
localAnnotatedClass.resolveFields(false);
return new BasicBeanDescription(paramSerializationConfig, paramJavaType, localAnnotatedClass);
}
示例11: findBeanProperties
import org.codehaus.jackson.map.SerializationConfig; //導入方法依賴的package包/類
protected List<BeanPropertyWriter> findBeanProperties(SerializationConfig paramSerializationConfig, BasicBeanDescription paramBasicBeanDescription)
throws JsonMappingException
{
VisibilityChecker localVisibilityChecker1 = paramSerializationConfig.getDefaultVisibilityChecker();
if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_GETTERS))
{
JsonAutoDetect.Visibility localVisibility3 = JsonAutoDetect.Visibility.NONE;
localVisibilityChecker1 = localVisibilityChecker1.withGetterVisibility(localVisibility3);
}
if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_IS_GETTERS))
{
JsonAutoDetect.Visibility localVisibility2 = JsonAutoDetect.Visibility.NONE;
localVisibilityChecker1 = localVisibilityChecker1.withIsGetterVisibility(localVisibility2);
}
if (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.AUTO_DETECT_FIELDS))
{
JsonAutoDetect.Visibility localVisibility1 = JsonAutoDetect.Visibility.NONE;
localVisibilityChecker1 = localVisibilityChecker1.withFieldVisibility(localVisibility1);
}
AnnotationIntrospector localAnnotationIntrospector = paramSerializationConfig.getAnnotationIntrospector();
VisibilityChecker localVisibilityChecker2 = localAnnotationIntrospector.findAutoDetectVisibility(paramBasicBeanDescription.getClassInfo(), localVisibilityChecker1);
LinkedHashMap localLinkedHashMap1 = paramBasicBeanDescription.findGetters(localVisibilityChecker2, null);
LinkedHashMap localLinkedHashMap2 = paramBasicBeanDescription.findSerializableFields(localVisibilityChecker2, localLinkedHashMap1.keySet());
removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localLinkedHashMap1);
removeIgnorableTypes(paramSerializationConfig, paramBasicBeanDescription, localLinkedHashMap2);
ArrayList localArrayList;
if ((localLinkedHashMap1.isEmpty()) && (localLinkedHashMap2.isEmpty()))
localArrayList = null;
while (true)
{
return localArrayList;
boolean bool = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, null, null);
PropertyBuilder localPropertyBuilder = constructPropertyBuilder(paramSerializationConfig, paramBasicBeanDescription);
int i = localLinkedHashMap1.size();
localArrayList = new ArrayList(i);
TypeBindings localTypeBindings = paramBasicBeanDescription.bindingsForBeanType();
Iterator localIterator1 = localLinkedHashMap2.entrySet().iterator();
while (localIterator1.hasNext())
{
Map.Entry localEntry2 = (Map.Entry)localIterator1.next();
AnnotationIntrospector.ReferenceProperty localReferenceProperty2 = localAnnotationIntrospector.findReferenceType((AnnotatedMember)localEntry2.getValue());
if ((localReferenceProperty2 != null) && (localReferenceProperty2.isBackReference()))
continue;
BeanPropertyWriter localBeanPropertyWriter2 = _constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, (String)localEntry2.getKey(), (AnnotatedMember)localEntry2.getValue());
localArrayList.add(localBeanPropertyWriter2);
}
Iterator localIterator2 = localLinkedHashMap1.entrySet().iterator();
while (localIterator2.hasNext())
{
Map.Entry localEntry1 = (Map.Entry)localIterator2.next();
AnnotationIntrospector.ReferenceProperty localReferenceProperty1 = localAnnotationIntrospector.findReferenceType((AnnotatedMember)localEntry1.getValue());
if ((localReferenceProperty1 != null) && (localReferenceProperty1.isBackReference()))
continue;
BeanPropertyWriter localBeanPropertyWriter1 = _constructWriter(paramSerializationConfig, localTypeBindings, localPropertyBuilder, bool, (String)localEntry1.getKey(), (AnnotatedMember)localEntry1.getValue());
localArrayList.add(localBeanPropertyWriter1);
}
}
}