@Override public BasicBeanDescription forClassAnnotations(MapperConfig<?> config, JavaType type, MixInResolver r) { BasicBeanDescription desc = _findStdTypeDesc(type); if (desc == null) { desc = _cachedFCA.get(type); if (desc == null) { desc = BasicBeanDescription.forOtherUse(config, type, _resolveAnnotatedClass(config, type, r)); _cachedFCA.put(type, desc); } } return desc; }
public PropertyName findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); PropertyName name = _rootNames.get(key); if (name != null) { return name; } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); name = intr.findRootName(ac); // No answer so far? Let's just default to using simple class name if (name == null || !name.hasSimpleName()) { // Should we strip out enclosing class tho? For now, nope: name = PropertyName.construct(rootType.getSimpleName()); } _rootNames.put(key, name); return name; }
@Override public String translate(String text, String sourceLanguage, String targetLanguage) throws TikaException, IOException { if (translator == null) { return text; } LRUMap<String, String> translationCache = getTranslationCache(sourceLanguage, targetLanguage); String translatedText = translationCache.get(text); if (translatedText == null) { translatedText = translator.translate(text, sourceLanguage, targetLanguage); translationCache.put(text, translatedText); } return translatedText; }
@Override public String translate(String text, String sourceLanguage, String targetLanguage) throws TikaException, IOException { if (translator == null) { return text; } LRUMap<String, String> translationCache = getTranslationCache(sourceLanguage, targetLanguage); String translatedText = translationCache.get(text); if (translatedText == null) { translatedText = translator.translate(text, sourceLanguage, targetLanguage); translationCache.put(text, translatedText); } return translatedText; }
public QName findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); QName name; synchronized (_rootNames) { name = _rootNames.get(key); } if (name != null) { return name; } name = _findRootName(rootType, config); synchronized (_rootNames) { _rootNames.put(key, name); } return name; }
@Override public BasicBeanDescription forClassAnnotations(MapperConfig<?> config, JavaType type, MixInResolver r) { BasicBeanDescription desc = _findStdTypeDesc(type); if (desc == null) { desc = _cachedFCA.get(type); if (desc == null) { desc = BasicBeanDescription.forOtherUse(config, type, _resolveAnnotatedClass(config, type, r)); _cachedFCA.put(type, desc); } } return desc; }
@Override public BasicBeanDescription forClassAnnotations(MapperConfig<?> config, JavaType type, MixInResolver r) { BasicBeanDescription desc = _findStdTypeDesc(type); if (desc == null) { desc = _cachedFCA.get(type); if (desc == null) { AnnotatedClass ac = AnnotatedClass.construct(type, config, r); desc = BasicBeanDescription.forOtherUse(config, type, ac); _cachedFCA.put(type, desc); } } return desc; }
_typeCache.put(key, result);
_typeCache.put(key, result);
public PropertyName findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); PropertyName name = _rootNames.get(key); if (name != null) { return name; } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); name = intr.findRootName(ac); // No answer so far? Let's just default to using simple class name if (name == null || !name.hasSimpleName()) { // Should we strip out enclosing class tho? For now, nope: name = new PropertyName(rootType.getSimpleName()); } _rootNames.put(key, name); return name; }
_typeCache.put(key, result); // cache object syncs return result;
_typeCache.put(key, result); // cache object syncs return result;
public PropertyName findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); PropertyName name = _rootNames.get(key); if (name != null) { return name; } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); name = intr.findRootName(ac); // No answer so far? Let's just default to using simple class name if (name == null || !name.hasSimpleName()) { // Should we strip out enclosing class tho? For now, nope: name = PropertyName.construct(rootType.getSimpleName()); } _rootNames.put(key, name); return name; }
public PropertyName findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); PropertyName name = _rootNames.get(key); if (name != null) { return name; } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); name = intr.findRootName(ac); // No answer so far? Let's just default to using simple class name if (name == null || !name.hasSimpleName()) { // Should we strip out enclosing class tho? For now, nope: name = PropertyName.construct(rootType.getSimpleName()); } _rootNames.put(key, name); return name; }
public PropertyName findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); PropertyName name = _rootNames.get(key); if (name != null) { return name; } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); name = intr.findRootName(ac); // No answer so far? Let's just default to using simple class name if (name == null || !name.hasSimpleName()) { // Should we strip out enclosing class tho? For now, nope: name = new PropertyName(rootType.getSimpleName()); } _rootNames.put(key, name); return name; }
public synchronized SerializedString findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); if (_rootNames == null) { _rootNames = new LRUMap<ClassKey,SerializedString>(20, 200); } else { SerializedString name = _rootNames.get(key); if (name != null) { return name; } } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); String nameStr = intr.findRootName(ac); // No answer so far? Let's just default to using simple class name if (nameStr == null) { // Should we strip out enclosing class tho? For now, nope: nameStr = rootType.getSimpleName(); } SerializedString name = new SerializedString(nameStr); _rootNames.put(key, name); return name; } }
@Override public BasicBeanDescription forClassAnnotations(MapperConfig<?> cfg, JavaType type, MixInResolver r) { BasicBeanDescription desc = _findStdTypeDesc(type); if (desc == null) { desc = _cachedFCA.get(type); if (desc == null) { boolean useAnnotations = cfg.isAnnotationProcessingEnabled(); AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), (useAnnotations ? cfg.getAnnotationIntrospector() : null), r); desc = BasicBeanDescription.forOtherUse(cfg, type, ac); _cachedFCA.put(type, desc); } } return desc; }
@Override public BasicBeanDescription forClassAnnotations(MapperConfig<?> cfg, JavaType type, MixInResolver r) { BasicBeanDescription desc = _findStdTypeDesc(type); if (desc == null) { desc = _cachedFCA.get(type); if (desc == null) { boolean useAnnotations = cfg.isAnnotationProcessingEnabled(); AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), (useAnnotations ? cfg.getAnnotationIntrospector() : null), r); desc = BasicBeanDescription.forOtherUse(cfg, type, ac); _cachedFCA.put(type, desc); } } return desc; }
public synchronized SerializedString findRootName(Class<?> rootType, MapperConfig<?> config) { ClassKey key = new ClassKey(rootType); if (_rootNames == null) { _rootNames = new LRUMap<ClassKey,SerializedString>(20, 200); } else { SerializedString name = _rootNames.get(key); if (name != null) { return name; } } BeanDescription beanDesc = config.introspectClassAnnotations(rootType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); AnnotatedClass ac = beanDesc.getClassInfo(); PropertyName pname = intr.findRootName(ac); String nameStr; // No answer so far? Let's just default to using simple class name if (pname == null || !pname.hasSimpleName()) { // Should we strip out enclosing class tho? For now, nope: nameStr = rootType.getSimpleName(); } else { nameStr = pname.getSimpleName(); } SerializedString name = new SerializedString(nameStr); _rootNames.put(key, name); return name; } }