Refine search
public DataCenterTypeInfoResolver() { super(TypeFactory.defaultInstance().constructType(DataCenterInfo.class), TypeFactory.defaultInstance()); }
protected JavaType constructType(Type type) { return TypeFactory.defaultInstance().constructType(type); } }
/** * Default constructor. */ public DataCenterTypeInfoResolver() { super(TypeFactory.defaultInstance().constructType(DataCenterInfo.class), TypeFactory.defaultInstance()); }
public InternalTypeDeserializer(Class<T> baseClass, TypeIdResolver typeIdResolver) { super(baseClass); this.typeDeserializer = new AsPropertyTypeDeserializer( TypeFactory.defaultInstance().constructType(baseClass), typeIdResolver, TYPE_PROPERTY, false, null); }
/** * Static helper method that can be called to figure out type-erased * call for given JDK type. It can be called statically since type resolution * process can never change actual type-erased class; thereby static * default instance is used for determination. */ public static Class<?> rawClass(Type t) { if (t instanceof Class<?>) { return (Class<?>) t; } // Should be able to optimize bit more in future... return defaultInstance().constructType(t).getRawClass(); }
/** * Checks if the type is void. * * @param type is the type to check * @return true if the type is void */ public static boolean isVoid(Type type) { final Class<?> cls = TypeFactory.defaultInstance().constructType(type).getRawClass(); return Void.class.isAssignableFrom(cls) || Void.TYPE.isAssignableFrom(cls); }
/** * Returns the Jackson {@link JavaType} for the specific class. * <p> * Default implementation returns {@link TypeFactory#constructType(java.lang.reflect.Type)}, but this can be * overridden in subclasses, to allow for custom generic collection handling. For instance: * * <pre class="code"> * protected JavaType getJavaType(Class<?> clazz) { * if (List.class.isAssignableFrom(clazz)) { * return TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, MyBean.class); * } else { * return super.getJavaType(clazz); * } * } * </pre> * * @param clazz the class to return the java type for * @return the java type */ protected JavaType getJavaType(Class<?> clazz) { return TypeFactory.defaultInstance().constructType(clazz); } }
private boolean shouldProcess(Type type) { final Class<?> cls = TypeFactory.defaultInstance().constructType(type).getRawClass(); if (cls.isPrimitive()) { return false; } String className = cls.getName(); for (String packageName : skippedPackages) { if (className.startsWith(packageName)) { return false; } } for (String classToSkip : skippedClasses) { if (className.equals(classToSkip)) { return false; } } return true; }
public static PrimitiveType fromType(Type type) { final Class<?> raw = TypeFactory.defaultInstance().constructType(type).getRawClass(); final PrimitiveType key = KEY_CLASSES.get(raw); if (key != null) { if (!customExcludedClasses.contains(raw.getName())) { return key; } } final PrimitiveType custom = customClasses.get(raw.getName()); if (custom != null) { return custom; } final PrimitiveType external = EXTERNAL_CLASSES.get(raw.getName()); if (external != null) { return external; } for (Map.Entry<Class<?>, PrimitiveType> entry : BASE_CLASSES.entrySet()) { if (entry.getKey().isAssignableFrom(raw)) { return entry.getValue(); } } return null; }
public Operation parseMethod( Method method, List<Parameter> globalParameters, JsonView jsonViewAnnotation) { JavaType classType = TypeFactory.defaultInstance().constructType(method.getDeclaringClass()); return parseMethod( classType.getClass(), method, globalParameters, null, null, null, null, new ArrayList<>(), Optional.empty(), new HashSet<>(), new ArrayList<>(), false, null, null, jsonViewAnnotation, null, null); }
@Override public <T> Codec<T> get(final Class<T> clazz) { final JavaType javaType = TypeFactory.defaultInstance().constructType(clazz); if (!mapper.canSerialize(clazz) || !mapper.canDeserialize(javaType)) { throw new CodecConfigurationException(String.format("%s (javaType: %s) not supported by Jackson Mapper", clazz, javaType)); } return new JacksonCodec<>(clazz, mapper); } };
JavaType classType = TypeFactory.defaultInstance().constructType(cls); BeanDescription bd = Json.mapper().getSerializationConfig().introspect(classType); Type[] genericParameterTypes = method.getGenericParameterTypes(); for (int i = 0; i < genericParameterTypes.length; i++) { final Type type = TypeFactory.defaultInstance().constructType(genericParameterTypes[i], cls); io.swagger.v3.oas.annotations.Parameter paramAnnotation = AnnotationsUtils.getAnnotation(io.swagger.v3.oas.annotations.Parameter.class, paramAnnotations[i]); Type paramType = ParameterProcessor.getParameterType(paramAnnotation, true); for (int i = 0; i < annotatedMethod.getParameterCount(); i++) { AnnotatedParameter param = annotatedMethod.getParameter(i); final Type type = TypeFactory.defaultInstance().constructType(param.getParameterType(), cls); io.swagger.v3.oas.annotations.Parameter paramAnnotation = AnnotationsUtils.getAnnotation(io.swagger.v3.oas.annotations.Parameter.class, paramAnnotations[i]); Type paramType = ParameterProcessor.getParameterType(paramAnnotation, true); JsonView jsonViewAnnotation, io.swagger.v3.oas.annotations.responses.ApiResponse[] classResponses) { JavaType classType = TypeFactory.defaultInstance().constructType(method.getDeclaringClass()); return parseMethod( classType.getClass(), io.swagger.v3.oas.annotations.responses.ApiResponse[] classResponses, AnnotatedMethod annotatedMethod) { JavaType classType = TypeFactory.defaultInstance().constructType(method.getDeclaringClass()); return parseMethod( classType.getClass(),
public HalResourcesSerializer(BeanProperty property, EmbeddedMapper embeddedMapper) { super(TypeFactory.defaultInstance().constructType(Collection.class)); this.property = property; this.embeddedMapper = embeddedMapper; }
public HalLinkListSerializer(BeanProperty property, CurieProvider curieProvider, EmbeddedMapper mapper, MessageSourceAccessor accessor, HalConfiguration halConfiguration) { super(TypeFactory.defaultInstance().constructType(List.class)); this.property = property; this.curieProvider = curieProvider; this.mapper = mapper; this.accessor = accessor; this.halConfiguration = halConfiguration; }
@Override public JavaType convert(SwaggerToClassGenerator swaggerToClassGenerator, Object def) { return TypeFactory.defaultInstance().constructType(Object.class); } }
CollectionJsonResourcesDeserializer() { this(TypeFactory.defaultInstance().constructType(CollectionJson.class)); }
public ConverterCommon(Type targetType) { targetJavaType = TypeFactory.defaultInstance().constructType(targetType); }
CollectionJsonPagedResourcesDeserializer() { this(TypeFactory.defaultInstance().constructType(CollectionJson.class)); }
CollectionJsonResourceSupportDeserializer() { this(TypeFactory.defaultInstance().constructType(ResourceSupport.class)); }
CollectionJsonResourceDeserializer() { this(TypeFactory.defaultInstance().constructType(CollectionJson.class)); }