Package com.addthis.codec.annotations

Examples of com.addthis.codec.annotations.Pluggable


        Class<?> findBaseClass = clazz;
        PluginMap findPluginMap = PluginMap.EMPTY;

        Class<?> ptr = clazz;
        while (ptr != null) {
            Pluggable pluggable = ptr.getAnnotation(Pluggable.class);
            if (pluggable != null) {
                String category = pluggable.value();
                findPluginMap = pluginRegistry.asMap().get(category);
                if (findPluginMap != null) {
                    findBaseClass = ptr;
                    break;
                } else {
View Full Code Here


        this.pluginRegistry = pluginRegistry;
    }

    @Override
    public TypeResolverBuilder<?> findTypeResolver(MapperConfig<?> config, AnnotatedClass ac, JavaType baseType) {
        Pluggable pluggable = ac.getAnnotation(Pluggable.class);
        if (pluggable != null) {
            PluginMap pluginMap = pluginRegistry.byCategory().get(pluggable.value());
            if (pluginMap != null) {
                return new CodecTypeResolverBuilder(pluginMap, config.getTypeFactory(), pluginRegistry);
            } else {
                log.warn("missing plugin map for {}, reached from {}", pluggable.value(), ac.getRawType());
            }
        } else if (pluginRegistry.byClass().containsKey(ac.getRawType())) {
            PluginMap pluginMap = pluginRegistry.byClass().get(ac.getRawType());
            return new CodecTypeResolverBuilder(pluginMap, config.getTypeFactory(), pluginRegistry);
        }
View Full Code Here

    }

    /** report all non-alias plugin types */
    @Override
    public List<NamedType> findSubtypes(Annotated a) {
        Pluggable pluggable = a.getAnnotation(Pluggable.class);
        PluginMap pluginMap;
        if (pluggable != null) {
            pluginMap = pluginRegistry.byCategory().get(pluggable.value());
        } else if (pluginRegistry.byClass().containsKey(a.getRawType())) {
            pluginMap = pluginRegistry.byClass().get(a.getRawType());
        } else {
            return null;
        }
View Full Code Here

        Class<?> findBaseClass = clazz;
        PluginMap findPluginMap = PluginMap.EMPTY;

        Class<?> ptr = clazz;
        while (ptr != null) {
            Pluggable pluggable = ptr.getAnnotation(Pluggable.class);
            if (pluggable != null) {
                String category = pluggable.value();
                findPluginMap = pluginRegistry.asMap().get(category);
                if (findPluginMap != null) {
                    findBaseClass = ptr;
                    break;
                } else {
View Full Code Here

        this.pluginRegistry = pluginRegistry;
    }

    @Override
    public TypeResolverBuilder<?> findTypeResolver(MapperConfig<?> config, AnnotatedClass ac, JavaType baseType) {
        Pluggable pluggable = ac.getAnnotation(Pluggable.class);
        if (pluggable != null) {
            PluginMap pluginMap = pluginRegistry.byCategory().get(pluggable.value());
            if (pluginMap != null) {
                return new CodecTypeResolverBuilder(pluginMap, config.getTypeFactory(), pluginRegistry);
            } else {
                log.warn("missing plugin map for {}, reached from {}", pluggable.value(), ac.getRawType());
            }
        }
        return null;
    }
View Full Code Here

    }

    /** report all non-alias plugin types */
    @Override
    public List<NamedType> findSubtypes(Annotated a) {
        Pluggable pluggable = a.getAnnotation(Pluggable.class);
        if (pluggable != null) {
            PluginMap pluginMap = pluginRegistry.byCategory().get(pluggable.value());
            List<NamedType> result = new ArrayList<>(pluginMap.asBiMap().size());
            for (Map.Entry<String, Class<?>> type : pluginMap.asBiMap().entrySet()) {
                result.add(new NamedType(type.getValue(), type.getKey()));
            }
            return result;
View Full Code Here

            if (pluginRegistry.byClass().containsKey(ptr)) {
                findPluginMap = pluginRegistry.byClass().get(ptr);
                findBaseClass = ptr;
                break;
            }
            Pluggable pluggable = ptr.getAnnotation(Pluggable.class);
            if (pluggable != null) {
                String category = pluggable.value();
                findPluginMap = pluginRegistry.asMap().get(category);
                findBaseClass = ptr;
                if (findPluginMap == null) {
                    log.warn("missing plugin map for {}, reached from {}", ptr, clazz);
                    findPluginMap = PluginMap.EMPTY;
View Full Code Here

        Class<?> findBaseClass = clazz;
        PluginMap findPluginMap = PluginMap.EMPTY;

        Class<?> ptr = clazz;
        while (ptr != null) {
            Pluggable pluggable = ptr.getAnnotation(Pluggable.class);
            if (pluggable != null) {
                String category = pluggable.value();
                findPluginMap = pluginRegistry.asMap().get(category);
                if (findPluginMap != null) {
                    findBaseClass = ptr;
                    break;
                } else {
View Full Code Here

        PluginMap findPluginMap = PluginMap.EMPTY;

        // get class annotations
        Class<?> ptr = clazz;
        while (ptr != null) {
            Pluggable pluggable = ptr.getAnnotation(Pluggable.class);
            if (pluggable != null) {
                String category = pluggable.value();
                findPluginMap = pluginRegistry.asMap().get(category);
                if (findPluginMap != null) {
                    findBaseClass = ptr;
                    break;
                } else {
View Full Code Here

TOP

Related Classes of com.addthis.codec.annotations.Pluggable

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.