本文整理匯總了Java中org.codehaus.jackson.type.JavaType.isContainerType方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaType.isContainerType方法的具體用法?Java JavaType.isContainerType怎麽用?Java JavaType.isContainerType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.codehaus.jackson.type.JavaType
的用法示例。
在下文中一共展示了JavaType.isContainerType方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSerializer
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
public JsonSerializer<Object> createSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
BasicBeanDescription localBasicBeanDescription = (BasicBeanDescription)paramSerializationConfig.introspect(paramJavaType);
JsonSerializer localJsonSerializer1 = findSerializerFromAnnotation(paramSerializationConfig, localBasicBeanDescription.getClassInfo(), paramBeanProperty);
if (localJsonSerializer1 != null)
return localJsonSerializer1;
JavaType localJavaType = modifyTypeByAnnotation(paramSerializationConfig, localBasicBeanDescription.getClassInfo(), paramJavaType);
if (localJavaType != paramJavaType);
for (boolean bool = true; paramJavaType.isContainerType(); bool = false)
return buildContainerSerializer(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty, bool);
Iterator localIterator = this._factoryConfig.serializers().iterator();
while (localIterator.hasNext())
{
JsonSerializer localJsonSerializer5 = ((Serializers)localIterator.next()).findSerializer(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty);
if (localJsonSerializer5 != null)
return localJsonSerializer5;
}
JsonSerializer localJsonSerializer2 = findSerializerByLookup(localJavaType, paramSerializationConfig, localBasicBeanDescription, paramBeanProperty, bool);
if (localJsonSerializer2 != null)
return localJsonSerializer2;
JsonSerializer localJsonSerializer3 = findSerializerByPrimaryType(localJavaType, paramSerializationConfig, localBasicBeanDescription, paramBeanProperty, bool);
if (localJsonSerializer3 != null)
return localJsonSerializer3;
JsonSerializer localJsonSerializer4 = findBeanSerializer(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty);
if (localJsonSerializer4 == null)
localJsonSerializer4 = super.findSerializerByAddonType(paramSerializationConfig, localJavaType, localBasicBeanDescription, paramBeanProperty, bool);
return localJsonSerializer4;
}
示例2: usesStaticTyping
import org.codehaus.jackson.type.JavaType; //導入方法依賴的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;
}
示例3: resolveType
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
protected JavaType resolveType(DeserializationConfig paramDeserializationConfig, BasicBeanDescription paramBasicBeanDescription, JavaType paramJavaType, AnnotatedMember paramAnnotatedMember, BeanProperty paramBeanProperty)
{
if (paramJavaType.isContainerType())
{
AnnotationIntrospector localAnnotationIntrospector = paramDeserializationConfig.getAnnotationIntrospector();
JavaType localJavaType = paramJavaType.getKeyType();
if (localJavaType != null)
{
Class localClass2 = localAnnotationIntrospector.findKeyDeserializer(paramAnnotatedMember);
if ((localClass2 != null) && (localClass2 != KeyDeserializer.None.class))
localJavaType.setValueHandler(paramDeserializationConfig.keyDeserializerInstance(paramAnnotatedMember, localClass2));
}
Class localClass1 = localAnnotationIntrospector.findContentDeserializer(paramAnnotatedMember);
if ((localClass1 != null) && (localClass1 != JsonDeserializer.None.class))
{
JsonDeserializer localJsonDeserializer = paramDeserializationConfig.deserializerInstance(paramAnnotatedMember, localClass1);
paramJavaType.getContentType().setValueHandler(localJsonDeserializer);
}
if ((paramAnnotatedMember instanceof AnnotatedMember))
{
TypeDeserializer localTypeDeserializer2 = findPropertyContentTypeDeserializer(paramDeserializationConfig, paramJavaType, paramAnnotatedMember, paramBeanProperty);
if (localTypeDeserializer2 != null)
paramJavaType = paramJavaType.withContentTypeHandler(localTypeDeserializer2);
}
}
if ((paramAnnotatedMember instanceof AnnotatedMember));
for (TypeDeserializer localTypeDeserializer1 = findPropertyTypeDeserializer(paramDeserializationConfig, paramJavaType, paramAnnotatedMember, paramBeanProperty); ; localTypeDeserializer1 = findTypeDeserializer(paramDeserializationConfig, paramJavaType, null))
{
if (localTypeDeserializer1 != null)
paramJavaType = paramJavaType.withTypeHandler(localTypeDeserializer1);
return paramJavaType;
}
}
示例4: _createDeserializer
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
protected JsonDeserializer<Object> _createDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty)
throws JsonMappingException
{
if (paramJavaType.isEnumType())
return this._factory.createEnumDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
if (paramJavaType.isContainerType())
{
if (paramJavaType.isArrayType())
return this._factory.createArrayDeserializer(paramDeserializationConfig, this, (ArrayType)paramJavaType, paramBeanProperty);
if (paramJavaType.isMapLikeType())
{
MapLikeType localMapLikeType = (MapLikeType)paramJavaType;
if (localMapLikeType.isTrueMapType())
return this._factory.createMapDeserializer(paramDeserializationConfig, this, (MapType)localMapLikeType, paramBeanProperty);
return this._factory.createMapLikeDeserializer(paramDeserializationConfig, this, localMapLikeType, paramBeanProperty);
}
if (paramJavaType.isCollectionLikeType())
{
CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType;
if (localCollectionLikeType.isTrueCollectionType())
return this._factory.createCollectionDeserializer(paramDeserializationConfig, this, (CollectionType)localCollectionLikeType, paramBeanProperty);
return this._factory.createCollectionLikeDeserializer(paramDeserializationConfig, this, localCollectionLikeType, paramBeanProperty);
}
}
if (JsonNode.class.isAssignableFrom(paramJavaType.getRawClass()))
return this._factory.createTreeDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
return this._factory.createBeanDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty);
}
示例5: resolve
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
@Override
public void resolve(SerializerProvider provider)
throws JsonMappingException
{
int filteredCount = (_filteredProps == null) ? 0 : _filteredProps.length;
for (int i = 0, len = _props.length; i < len; ++i) {
BeanPropertyWriter prop = _props[i];
if (prop.hasSerializer()) {
continue;
}
// Was the serialization type hard-coded? If so, use it
JavaType type = prop.getSerializationType();
/* It not, we can use declared return type if and only if
* declared type is final -- if not, we don't really know
* the actual type until we get the instance.
*/
if (type == null) {
type = provider.constructType(prop.getGenericPropertyType());
if (!type.isFinal()) {
/* 18-Feb-2010, tatus: But even if it is non-final, we may
* need to retain some of type information so that we can
* accurately handle contained types
*/
if (type.isContainerType() || type.containedTypeCount() > 0) {
prop.setNonTrivialBaseType(type);
}
continue;
}
}
JsonSerializer<Object> ser = provider.findValueSerializer(type, prop);
/* 04-Feb-2010, tatu: We may have stashed type serializer for content types
* too, earlier; if so, it's time to connect the dots here:
*/
if (type.isContainerType()) {
TypeSerializer typeSer = type.getContentType().getTypeHandler();
if (typeSer != null) {
// for now, can do this only for standard containers...
if (ser instanceof ContainerSerializerBase<?>) {
// ugly casts... but necessary
@SuppressWarnings("unchecked")
JsonSerializer<Object> ser2 = (JsonSerializer<Object>)((ContainerSerializerBase<?>) ser).withValueTypeSerializer(typeSer);
ser = ser2;
}
}
}
prop = prop.withSerializer(ser);
_props[i] = prop;
// and maybe replace filtered property too? (see [JACKSON-364])
if (i < filteredCount) {
BeanPropertyWriter w2 = _filteredProps[i];
if (w2 != null) {
_filteredProps[i] = w2.withSerializer(ser);
}
}
}
// also, any-getter may need to be resolved
if (_anyGetterWriter != null) {
_anyGetterWriter.resolve(provider);
}
}
示例6: findPropertyContentTypeResolver
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
public TypeResolverBuilder<?> findPropertyContentTypeResolver(MapperConfig<?> paramMapperConfig, AnnotatedMember paramAnnotatedMember, JavaType paramJavaType)
{
if (!paramJavaType.isContainerType())
throw new IllegalArgumentException("Must call method with a container type (got " + paramJavaType + ")");
return _findTypeResolver(paramMapperConfig, paramAnnotatedMember, paramJavaType);
}
示例7: findPropertyTypeResolver
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
public TypeResolverBuilder<?> findPropertyTypeResolver(MapperConfig<?> paramMapperConfig, AnnotatedMember paramAnnotatedMember, JavaType paramJavaType)
{
if (paramJavaType.isContainerType())
return null;
return _findTypeResolver(paramMapperConfig, paramAnnotatedMember, paramJavaType);
}
示例8: _constructType
import org.codehaus.jackson.type.JavaType; //導入方法依賴的package包/類
public JavaType _constructType(Type paramType, TypeBindings paramTypeBindings)
{
JavaType localJavaType;
if ((paramType instanceof Class))
{
Class localClass = (Class)paramType;
if (paramTypeBindings == null)
paramTypeBindings = new TypeBindings(this, localClass);
localJavaType = _fromClass(localClass, paramTypeBindings);
}
while ((this._modifiers != null) && (!localJavaType.isContainerType()))
{
TypeModifier[] arrayOfTypeModifier = this._modifiers;
int i = arrayOfTypeModifier.length;
int j = 0;
while (true)
if (j < i)
{
localJavaType = arrayOfTypeModifier[j].modifyType(localJavaType, paramType, paramTypeBindings, this);
j++;
continue;
if ((paramType instanceof ParameterizedType))
{
localJavaType = _fromParamType((ParameterizedType)paramType, paramTypeBindings);
break;
}
if ((paramType instanceof GenericArrayType))
{
localJavaType = _fromArrayType((GenericArrayType)paramType, paramTypeBindings);
break;
}
if ((paramType instanceof TypeVariable))
{
localJavaType = _fromVariable((TypeVariable)paramType, paramTypeBindings);
break;
}
if ((paramType instanceof WildcardType))
{
localJavaType = _fromWildcard((WildcardType)paramType, paramTypeBindings);
break;
}
throw new IllegalArgumentException("Unrecognized Type: " + paramType.toString());
}
}
return localJavaType;
}