Tabnine Logo
ClassMappings.findInterfaceMapping
Code IndexAdd Tabnine to your IDE (free)

How to use
findInterfaceMapping
method
in
org.dozer.classmap.ClassMappings

Best Java code snippets using org.dozer.classmap.ClassMappings.findInterfaceMapping (Showing top 2 results out of 315)

origin: net.sf.dozer/dozer

public ClassMap find(Class<?> srcClass, Class<?> destClass, String mapId) {
 final String key = keyFactory.createKey(srcClass, destClass, mapId);
 ClassMap mapping = classMappings.get(key);
 if (mapping == null) {
  mapping = findInterfaceMapping(destClass, srcClass, mapId);
 }
 // one more try...
 // if the mapId is not null looking up a map is easy
 if (!MappingUtils.isBlankOrNull(mapId) && mapping == null) {
  // probably a more efficient way to do this...
  for (Entry<String, ClassMap> entry : classMappings.entrySet()) {
   ClassMap classMap = entry.getValue();
   if (StringUtils.equals(classMap.getMapId(), mapId)
       && classMap.getSrcClassToMap().isAssignableFrom(srcClass)
       && classMap.getDestClassToMap().isAssignableFrom(destClass)) {
    return classMap;
   } else if (StringUtils.equals(classMap.getMapId(), mapId) && srcClass.equals(destClass)) {
    return classMap;
   }
  }
  // If map-id was specified and mapping was not found, then fail
  MappingUtils.throwMappingException("Class mapping not found by map-id: " + key);
 }
 return mapping;
}
origin: org.openl.rules/org.openl.rules.mapping.dev.dozer

public ClassMap find(Class<?> srcClass, Class<?> destClass, String mapId) {
  final String key = keyFactory.createKey(srcClass, destClass, mapId);
  ClassMap mapping = classMappings.get(key);
  if (mapping == null) {
    mapping = findInterfaceMapping(destClass, srcClass, mapId);
  }
  // one more try...
  // if the mapId is not null looking up a map is easy
  if (!MappingUtils.isBlankOrNull(mapId) && mapping == null) {
    // probably a more efficient way to do this...
    for (Entry<String, ClassMap> entry : classMappings.entrySet()) {
      ClassMap classMap = entry.getValue();
      if (StringUtils.equals(classMap.getMapId(), mapId) && classMap.getSrcClassToMap()
        .isAssignableFrom(srcClass) && classMap.getDestClassToMap().isAssignableFrom(destClass)) {
        return classMap;
      } else if (StringUtils.equals(classMap.getMapId(), mapId) && srcClass.equals(destClass)) {
        return classMap;
      }
    }
    // If map-id was specified and mapping was not found, then fail
    MappingUtils.throwMappingException("Class mapping not found by map-id: " + key);
  }
  return mapping;
}
org.dozer.classmapClassMappingsfindInterfaceMapping

Popular methods of ClassMappings

  • find
  • <init>
  • add
  • addDefault
  • addAll
  • failOnDuplicate
  • getAll
  • isAbstract
  • isInterfaceImplementation

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Join (org.hibernate.mapping)
  • Table (org.hibernate.mapping)
    A relational table
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now