Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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 如何将长度不固定的地图装订在某个位置?_Java_Spring_Annotations_Apache Camel_Bindy - Fatal编程技术网

Java 如何将长度不固定的地图装订在某个位置?

Java 如何将长度不固定的地图装订在某个位置?,java,spring,annotations,apache-camel,bindy,Java,Spring,Annotations,Apache Camel,Bindy,我有一个长字符串,其中有两个字段具有一定长度,另一个字段长度未知。那么在这种情况下如何映射bindy固定长度呢? 我有这样一个字符串: String info ="samulDavidThis is my story"; 我的目标是这样的: @DataField(pos=1, length=4) private String name; @DataField(pos=5, length=4) private String lname; private String story; 在第9位之后

我有一个长字符串,其中有两个字段具有一定长度,另一个字段长度未知。那么在这种情况下如何映射bindy固定长度呢? 我有这样一个字符串:

String info ="samulDavidThis is my story";
我的目标是这样的:

@DataField(pos=1, length=4)
private String name;
@DataField(pos=5, length=4)
private String lname;
private String story;

在第9位之后,故事的长度不是固定的,所以有人能帮我映射故事吗?

lname是最后一个字段吗?然后,我认为您可能不需要设置长度,bindy将一直使用到行尾。lname之后还有另一个字段名,即story。因此需要将所有剩余值放入story字段中