use of org.apache.felix.metatype.DefaultMetaTypeProvider in project felix by apache.
the class MetaTypeInformationImpl method addMetaData.
// ---------- setters to fill the values -----------------------------------
protected void addMetaData(MetaData md) {
if (md.getDesignates() != null) {
// meta type provide to register by PID
DefaultMetaTypeProvider dmtp = new DefaultMetaTypeProvider(this.bundle, md);
Iterator designates = md.getDesignates().iterator();
while (designates.hasNext()) {
Designate designate = (Designate) designates.next();
// get the OCD reference, ignore the designate if none
DesignateObject object = designate.getObject();
String ocdRef = (object == null) ? null : object.getOcdRef();
if (ocdRef == null) {
continue;
}
// get ocd for the reference, ignore designate if none
final Map map = md.getObjectClassDefinitions();
OCD ocd = (OCD) (map == null ? null : map.get(ocdRef));
if (ocd == null) {
continue;
}
// gather pids and factory pids and register provider
if (designate.getFactoryPid() != null) {
this.factoryPids.add(designate.getFactoryPid());
this.addMetaTypeProvider(designate.getFactoryPid(), dmtp);
} else {
this.pids.add(designate.getPid());
this.addMetaTypeProvider(designate.getPid(), dmtp);
}
}
}
}
Aggregations