copy = new HashMap<String,String>(4);
for (final String key : SCHEMA_KEYS) {
final Object schema = map.get(key);
if (schema != null) {
if (!(schema instanceof String)) {
throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
name + "[\"" + key + "\"]", value.getClass()));
}
copy.put(key, (String) schema);
}
}
copy = CollectionsExt.unmodifiableOrCopy(copy);
}
schemas = copy;
return;
}
else if (name.equals(XML.GML_VERSION)) {
gmlVersion = (value instanceof CharSequence) ? new Version(value.toString()) : (Version) value;
return;
}
else if (name.equals(XML.RESOLVER)) {
resolver = (ReferenceResolver) value;
return;
}
else if (name.equals(XML.CONVERTER)) {
converter = (ValueConverter) value;
return;
}
else if (name.equals(XML.STRING_SUBSTITUTES)) {
int mask = initialBitMasks();
if (value != null) {
for (final CharSequence substitute : (CharSequence[]) value) {
if (CharSequences.equalsIgnoreCase(substitute, "language")) {
mask |= Context.SUBSTITUTE_LANGUAGE;
} else if (CharSequences.equalsIgnoreCase(substitute, "country")) {
mask |= Context.SUBSTITUTE_COUNTRY;
}
}
}
bitMasks = mask;
return;
}
else if (name.equals(XML.WARNING_LISTENER)) {
warningListener = (WarningListener<?>) value;
return;
}
}
} catch (RuntimeException e) { // (ClassCastException | IllegalArgumentException) on the JDK7 branch.
throw new PropertyException(Errors.format(
Errors.Keys.IllegalPropertyClass_2, name, value.getClass()), e);
}
/*
* If we reach this point, the given name is not a SIS property. Try to handle
* it as a (un)marshaller-specific property, after saving the previous value.