Ejemplo n.º 1
0
 public String componentModel() {
   if (mapperConfigPrism != null && mapperPrism.values.componentModel() == null) {
     return mapperConfigPrism.componentModel();
   } else {
     return mapperPrism.componentModel();
   }
 }
Ejemplo n.º 2
0
 public String implementationPackage() {
   if (mapperConfigPrism != null && mapperPrism.values.implementationPackage() == null) {
     return mapperConfigPrism.implementationPackage();
   } else {
     return mapperPrism.implementationPackage();
   }
 }
Ejemplo n.º 3
0
 public CollectionMappingStrategyPrism getCollectionMappingStrategy() {
   if (mapperConfigPrism != null && mapperPrism.values.collectionMappingStrategy() == null) {
     return CollectionMappingStrategyPrism.valueOf(mapperConfigPrism.collectionMappingStrategy());
   } else {
     return CollectionMappingStrategyPrism.valueOf(mapperPrism.collectionMappingStrategy());
   }
 }
Ejemplo n.º 4
0
 public String unmappedTargetPolicy() {
   if (mapperConfigPrism != null && mapperPrism.values.unmappedTargetPolicy() == null) {
     return mapperConfigPrism.unmappedTargetPolicy();
   } else {
     return mapperPrism.unmappedTargetPolicy();
   }
 }
Ejemplo n.º 5
0
 public MappingInheritanceStrategyPrism getMappingInheritanceStrategy() {
   if (mapperConfigPrism != null && mapperPrism.values.mappingInheritanceStrategy() == null) {
     return MappingInheritanceStrategyPrism.valueOf(
         mapperConfigPrism.mappingInheritanceStrategy());
   } else {
     return MappingInheritanceStrategyPrism.valueOf(mapperPrism.mappingInheritanceStrategy());
   }
 }
Ejemplo n.º 6
0
  private boolean isMapToDefaultOnMapperAndMappingConfigLevel() {
    final NullValueMappingStrategyPrism strategy;
    if (mapperConfigPrism != null && mapperPrism.values.nullValueMappingStrategy() == null) {
      strategy =
          NullValueMappingStrategyPrism.valueOf(mapperConfigPrism.nullValueMappingStrategy());
    } else {
      strategy = NullValueMappingStrategyPrism.valueOf(mapperPrism.nullValueMappingStrategy());
    }

    return NullValueMappingStrategyPrism.RETURN_DEFAULT == strategy;
  }
Ejemplo n.º 7
0
  private MapperConfiguration(MapperPrism mapperPrism) {
    this.mapperPrism = mapperPrism;

    if (mapperPrism.values.config() != null) {
      // TODO #737 Only a declared type makes sense here; Validate and raise graceful error;
      // Also validate that @MapperConfig is present
      this.config = (DeclaredType) mapperPrism.config();
      this.mapperConfigPrism = MapperConfigPrism.getInstanceOn(config.asElement());
    } else {
      this.config = null;
      this.mapperConfigPrism = null;
    }
  }
Ejemplo n.º 8
0
  public Set<DeclaredType> uses() {
    Set<DeclaredType> uses = new LinkedHashSet<DeclaredType>();

    for (TypeMirror usedMapperType : mapperPrism.uses()) {
      // TODO #737 Only declared type make sense here; Validate and raise graceful error;
      uses.add((DeclaredType) usedMapperType);
    }

    if (mapperConfigPrism != null) {
      for (TypeMirror usedMapperType : mapperConfigPrism.uses()) {
        // TODO #737 Only declared type make sense here; Validate and raise graceful error;
        uses.add((DeclaredType) usedMapperType);
      }
    }

    return uses;
  }