Package com.fasterxml.jackson.annotation

Examples of com.fasterxml.jackson.annotation.JsonTypeName


        ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
        classes.add(baseType.getRawClass());
        classes.addAll(Arrays.asList(DtoModule$.MODULE$.extension_classes()));
        for ( Class<?> c : classes) {
            if( baseType.getRawClass().isAssignableFrom(c) ) {
                JsonTypeName jsonAnnoation = c.getAnnotation(JsonTypeName.class);
                if(jsonAnnoation!=null && jsonAnnoation.value()!=null) {
                    typeToId.put(c, jsonAnnoation.value());
                    idToType.put(jsonAnnoation.value(), TypeFactory.defaultInstance().constructSpecializedType(baseType, c));
                    idToType.put(c.getName(), TypeFactory.defaultInstance().constructSpecializedType(baseType, c));
                } else {
                    XmlRootElement xmlAnnoation = c.getAnnotation(XmlRootElement.class);
                    if(xmlAnnoation!=null && xmlAnnoation.name()!=null) {
                        typeToId.put(c, xmlAnnoation.name());
View Full Code Here


                if (type.name() != null && !type.name().isEmpty()) {
                    JClassType typeClass = BaseSourceCreator.find(type.value(), logger, context);
                    if (!isLeaf || classType.equals(typeClass))
                    possibleTypes.add(new Subtype(type.name(), typeClass));
                } else {
                    JsonTypeName nameAnnotation = type.value().getAnnotation(JsonTypeName.class);
                    if (nameAnnotation == null || nameAnnotation.value() == null || nameAnnotation.value().isEmpty())
                    {
                        logger.log(BaseSourceCreator.ERROR, "Cannot find @JsonTypeName annotation for type: " + type.value());
                        throw new UnableToCompleteException();
                    }
                    JClassType typeClass = BaseSourceCreator.find(type.value(), logger, context);
                    if (!isLeaf || classType.equals(typeClass))
                        possibleTypes.add(new Subtype(nameAnnotation.value(), typeClass));
                }

            }
            if (isLeaf && possibleTypes.size() == 0)
            {
View Full Code Here

TOP

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

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.