Exemplo n.º 1
0
 /**
  * Checks to see if there are any metatypes out there for a particular service.
  *
  * @param metatypeInformations - Where we'll look for metatypes that match our service from.
  * @param service - our service we want metatypes for.
  * @return true if there is, and the service should be added, or false if it shouldn't be.
  */
 private boolean checkForMetaTypesForService(
     Set<MetaTypeInformation> metatypeInformations, Map<String, Object> service) {
   String id = (String) service.get("id");
   boolean ifFactory = (Boolean) service.get("factory");
   if (ifFactory) {
     for (MetaTypeInformation information : metatypeInformations) {
       if (information != null) {
         for (String pid : information.getFactoryPids()) {
           if (pid.equals(id)) {
             return true;
           }
         }
       }
     }
   } else {
     for (MetaTypeInformation information : metatypeInformations) {
       if (information != null) {
         for (String pid : information.getPids()) {
           if (pid.equals(id)) {
             return true;
           }
         }
       }
     }
   }
   return false;
 }