List of usage examples for javax.xml.registry.infomodel RegistryObject addSlots
void addSlots(Collection slots) throws JAXRException;
From source file:it.cnr.icar.eric.client.xml.registry.util.JAXRUtility.java
/** * Adds slots specified by slotsMap to RegistryObject ro. * *//*from w ww . j av a 2 s. c o m*/ public static void addSlotsToRegistryObject(RegistryObject ro, Map<?, ?> slotsMap) throws JAXRException { ArrayList<Slot> slots = new ArrayList<Slot>(); Iterator<?> iter = slotsMap.keySet().iterator(); while (iter.hasNext()) { Object key = iter.next(); Object slotValue = slotsMap.get(key); Slot slot = null; //slotValue must either be a String or a Collection of Strings if (slotValue instanceof String) { slot = ro.getLifeCycleManager().createSlot((String) key, (String) slotValue, (String) null); } else if (slotValue instanceof Collection) { Collection<?> c = (Collection<?>) slotValue; slot = ro.getLifeCycleManager().createSlot((String) key, c, (String) null); } else { //??throw new IllegalArgumentException(resourceBundle.getString("message.addingParameter", // new String[]{slotValue.getClass().getName()})); } if (slot != null) { slots.add(slot); } } ro.addSlots(slots); }