1
我有这个类:蓖麻:创建映射文件有抽象类属性
public class Source extends Node {
protected DistributionSampler delay ;
protected DistributionSampler batchsize ;
/**
* @param name The name of the source node
* @param d The {@link DistributionSampler} used to generate the
* inter-arrival times
*/
public Source(String name, DistributionSampler d) {
super(name) ;
delay = d ;
batchsize = new Deterministic(1) ;
Sim.schedule(new Arrival(Sim.now() + delay.next())) ;
}
/**
* @param name The name of the source node
* @param d The {@link DistributionSampler} used to generate the
* inter-arrival times
* @param b The {@link DistributionSampler} used to generate the
batch sizes
*/
public Source(String name, DistributionSampler d, DistributionSampler b) {
super(name) ;
delay = d ;
batchsize = b ;
Sim.schedule(new Arrival(Sim.now() + delay.next())) ;
}
....
}
DistributionSampler是一个抽象类。
在从XML到Java Object的转换时,我会知道要使用哪个抽象类的具体实现(通过bean名称)。
但是,我并不完全知道如何编写映射文件来告诉脚轮如何进行翻译。
任何帮助将不胜感激。