Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java MapStruct为实现Iterable的对象生成文件<;T>;接口_Java_Mapstruct_Mapper - Fatal编程技术网

Java MapStruct为实现Iterable的对象生成文件<;T>;接口

Java MapStruct为实现Iterable的对象生成文件<;T>;接口,java,mapstruct,mapper,Java,Mapstruct,Mapper,我有一个给定的场景: class Curve implements Iterable<Point> { protected String curveName; protected Date curveVersion; protected String curveType; protected List<Point> points; <!--- public getter&setters ---> } class Poin

我有一个给定的场景:

class Curve implements Iterable<Point> {

  protected String curveName;
  protected Date curveVersion;
  protected String curveType;
  protected List<Point> points; 

  <!--- public getter&setters  --->
}


class Point {

  protected int x;
  protected int y;
  protected int z;

   <!--- public getter&setters  --->
}
自动生成的CurveMapperImpl类仅为Iterable中的点类字段创建映射。曲线类(子类)的所有字段将被忽略,点字段除外

例如:

所有文件,如
curveName
curveVersion
curveType
都没有映射。即使尝试了源和目标的
@Mapping
注释,它也不起作用。但是如果我删除了实现
Iterable
,它就可以工作了。我无法修改对象类,因为它们来自库


我怎样才能解决这个问题。有什么解决方法吗?

您能与我们共享dto类吗?@lore dto类与实体类相同。绝对没有区别。您能和我们共享dto类吗?@LORE dto类与实体类相同。绝对没有区别。
public abstract class CurveMapper {

 CurveMapper INSTANCE = Mappers.getMapper(CurveMapper.class);

 protected abstract com.entity.Curve map(com.dto.Curve);

}
public class CurveMapperImpl implements CurveMapper {

 @Override 
 public com.entity.Curve map(com.dto.Curve arg0) {

  if (arg0 = bull)
   return null;

  com.entity.Curve curve1 = new com.entity.Curve();
  for (com.dto.Point point : curve.getPoint()) {
   curve1.add(covertPoint(point));
  }
}

protected com.entity.Point convertPoint(com.dto.Point point) {
  com.entity.Point point1 = new com.entity.Point();
  point1.setX(point.getX);
  point1.setY(point.getY);
  point1.setZ(point.getZ);

 return point1;
}