String compName = ref.componentName();
String desp = ref.description();
String filter = ref.filter();
Class<?> serviceInterface = ref.serviceInterface();
ReferenceListener[] refListeners = ref.referenceListeners();
TreferenceList tref = new TreferenceList();
// can not think of configuring depends on for referencelist
tref.setDependsOn(null);
if (id.length() > 0) {
tref.setId(id);
}
if (availability.length() > 0) {
tref.setAvailability(availability);
}
if (compName.length() > 0) {
tref.setComponentName(compName);
}
if (desp.length() > 0) {
Tdescription value = new Tdescription();
value.getContent().add(desp);
tref.setDescription(value);
}
if (filter.length() > 0) {
tref.setFilter(filter);
}
if (serviceInterface != Object.class) {
tref.setInterface(serviceInterface.getName());
}
for (ReferenceListener rl : refListeners) {
String rf = rl.ref();
TreferenceListener trl = reflMap.get(rf);
if (trl != null) {
trl.setRefAttribute(rf);
tref.getReferenceListener().add(trl);
} else {
throw new BlueprintAnnotationException("Unable to find the ReferenceListener ref " + rf);
}
}