TypeMirror mapKeyType = findMapType(keyType, context); newMapType.keyType = mapKeyType == null ? keyType : mapKeyType; TypeMirror mapValueType = findMapType(valueType, context); newMapType.valueType = mapValueType == null ? valueType : mapValueType;
((AdapterType) declaredType).getAdaptingType().accept(this, context); else if (MapType.findMapType(declaredType, EnunciateJackson1Context.this) == null) { String qualifiedName = declaration.getQualifiedName().toString(); if (Object.class.getName().equals(qualifiedName)) {
TypeMirror mapKeyType = findMapType(keyType, context); newMapType.keyType = mapKeyType == null ? keyType : mapKeyType; TypeMirror mapValueType = findMapType(valueType, context); newMapType.valueType = mapValueType == null ? valueType : mapValueType;
((AdapterType) declaredType).getAdaptingType().accept(this, context); else if (MapType.findMapType(declaredType, EnunciateJackson1Context.this) == null) { String qualifiedName = declaration.getQualifiedName().toString(); if (Object.class.getName().equals(qualifiedName)) {
/** * The type of the accessor. * * @return The type of the accessor. */ public DecoratedTypeMirror getAccessorType() { DecoratedTypeMirror accessorType = (DecoratedTypeMirror) asType(); accessorType = OptionalUtils.stripOptional(accessorType, this.context.getContext().getProcessingEnvironment()); accessorType = this.context.resolveSyntheticType(accessorType); DecoratedDeclaredType normalizedCollection = JacksonUtil.getNormalizedCollection(accessorType, this.context.getContext().getProcessingEnvironment()); if (normalizedCollection != null) { accessorType = normalizedCollection; } else { MapType mapType = MapType.findMapType(accessorType, this.context); if (mapType != null) { accessorType = mapType; } } return accessorType; }
/** * The type of the accessor. * * @return The type of the accessor. */ public DecoratedTypeMirror getAccessorType() { DecoratedTypeMirror accessorType = (DecoratedTypeMirror) asType(); accessorType = OptionalUtils.stripOptional(accessorType, this.context.getContext().getProcessingEnvironment()); accessorType = this.context.resolveSyntheticType(accessorType); DecoratedDeclaredType normalizedCollection = JacksonUtil.getNormalizedCollection(accessorType, this.context.getContext().getProcessingEnvironment()); if (normalizedCollection != null) { accessorType = normalizedCollection; } else { MapType mapType = MapType.findMapType(accessorType, this.context); if (mapType != null) { accessorType = mapType; } } return accessorType; }
public DecoratedTypeMirror resolveSyntheticType(DecoratedTypeMirror type) { if (type instanceof DeclaredType && !type.isCollection() && MapType.findMapType(type, this) == null) { if (!((DeclaredType) type).getTypeArguments().isEmpty()) { //if type arguments apply, create a new "synthetic" declared type that captures the type arguments. type = new ParameterizedJackson1DeclaredType((DeclaredType) type, getContext().getProcessingEnvironment()); } else if (type.isInterface()) { //if it's an interface, create a "synthetic" type that pretends like it's an abstract class. type = new InterfaceJackson1DeclaredType((DeclaredType) type, getContext().getProcessingEnvironment()); } } else if (type != null) { DecoratedTypeMirror componentType = TypeMirrorUtils.getComponentType(type, getContext().getProcessingEnvironment()); if (componentType != null) { DecoratedTypeMirror resolved = resolveSyntheticType(componentType); if (componentType != resolved) { return new SyntheticJackson1ArrayType(getContext().getProcessingEnvironment().getTypeUtils().getArrayType(resolved), resolved, getContext().getProcessingEnvironment()); } } } return type; }
public DecoratedTypeMirror resolveSyntheticType(DecoratedTypeMirror type) { if (type instanceof DeclaredType && !type.isCollection() && MapType.findMapType(type, this) == null) { if (!((DeclaredType) type).getTypeArguments().isEmpty()) { //if type arguments apply, create a new "synthetic" declared type that captures the type arguments. type = new ParameterizedJackson1DeclaredType((DeclaredType) type, getContext().getProcessingEnvironment()); } else if (type.isInterface()) { //if it's an interface, create a "synthetic" type that pretends like it's an abstract class. type = new InterfaceJackson1DeclaredType((DeclaredType) type, getContext().getProcessingEnvironment()); } } else if (type != null) { DecoratedTypeMirror componentType = TypeMirrorUtils.getComponentType(type, getContext().getProcessingEnvironment()); if (componentType != null) { DecoratedTypeMirror resolved = resolveSyntheticType(componentType); if (componentType != resolved) { return new SyntheticJackson1ArrayType(getContext().getProcessingEnvironment().getTypeUtils().getArrayType(resolved), resolved, getContext().getProcessingEnvironment()); } } } return type; }
MapType mapType = MapType.findMapType(declaredType, context.getContext()); if (mapType != null) { JsonType keyType = mapType.getKeyType().accept(this, new Context(context.getContext(), false, false, context.getStack()));
MapType mapType = MapType.findMapType(declaredType, context.getContext()); if (mapType != null) { JsonType keyType = mapType.getKeyType().accept(this, new Context(context.getContext(), false, false, context.getStack()));
MapType mapType = MapType.findMapType(accessorType, context); if (mapType != null) { DecoratedTypeMirror keyAs = Annotations.mirrorOf(new Callable<Class<?>>() {
MapType mapType = MapType.findMapType(accessorType, context); if (mapType != null) { DecoratedTypeMirror keyAs = Annotations.mirrorOf(new Callable<Class<?>>() {