Package com.fasterxml.jackson.annotation

Examples of com.fasterxml.jackson.annotation.JsonSubTypes


    {
        if (typeInfo == null)
            return Lists.newArrayList(new Subtype(null, source));
        Collection<Type> subTypes = findJsonSubTypes(source);
        if(subTypes.isEmpty()) {
            JsonSubTypes foundAnnotation = getAnnotation(source, JsonSubTypes.class);
            if(foundAnnotation != null) {
                Type[] value = foundAnnotation.value();
                subTypes = Arrays.asList(value);
            }
        }
        PossibleTypesVisitor v = new PossibleTypesVisitor(context, source, isLeaf, getLogger(), subTypes);
        return v.visit(typeInfo.use());
View Full Code Here


    private Collection<Type> findJsonSubTypes(JClassType clazz) {
        if (clazz == null)
            return Collections.emptyList();
        else if (clazz.isAnnotationPresent(JsonSubTypes.class)) {
            JsonSubTypes annotation = getAnnotation(clazz, JsonSubTypes.class);
            Set<Type> result = new HashSet<JsonSubTypes.Type>();
            Type[] value = annotation.value();
            for (Type type : value) {
                result.add(type);
                Class<?> subclazz = type.value();
                String newSubClassName = subclazz.getName().replaceAll("\\$", ".");
                JClassType subJClazz = context.getTypeOracle().findType(newSubClassName);
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.annotation.JsonSubTypes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.