}
String descriptorName = rdesc.getName();
// Use a caseless version of the key.
CaselessStringKey key = new CaselessStringKey(descriptorName);
// If the key has already been added bail out ...
if (descriptorNames.containsKey(key) == true) {
throw new IllegalArgumentException(
JaiI18N.formatMsg("DescriptorCache0",
new Object[] {descriptorName, modeName}));
}
// Store the RegistryElementDescriptor hashed by its global name
descriptorNames.put(key, rdesc);
// Store the ProductOperationGraph hashed by the caseless
// descriptor name
if (arePreferencesSupported)
products.put(key, new ProductOperationGraph());
// if properties arent supported by this descriptor we are done.
if (rdesc.arePropertiesSupported() == false)
return true;
// Store the Property Generators associated with this descriptor
// for the specified mode.
PropertyGenerator props[] = rdesc.getPropertyGenerators(modeName);
if (props != null) {
for (int i=0; i<props.length; i++) {
Vector v = (Vector)properties.get(key);
if (v == null) {
v = new Vector();
v.addElement(props[i]);
properties.put(key, v);
} else {
v.addElement(props[i]);
}
v = (Vector)suppressed.get(key);
Hashtable h = (Hashtable)sourceForProp.get(key);
String names[] = props[i].getPropertyNames();
for (int j=0; j<names.length; j++) {
CaselessStringKey name = new CaselessStringKey(names[j]);
if (v != null) v.remove(name);
if (h != null) h.remove(name);
}
}