options.put(OPTION_EXTENDED_META_DATA, option = new SDOExtendedMetaDataImpl()); // TODO copy (BasicExtendedMetaData)option
/*
* Loads schema if necessary
*/
if (Boolean.TRUE.equals(options.get(SDOUtil.XML_LOAD_SCHEMA))) {
XMLOptions xmlOptions = (XMLOptions) options.get(OPTION_XML_OPTIONS);
if (xmlOptions == null) {
xmlOptions = new XMLOptionsImpl();
options.put(OPTION_XML_OPTIONS, xmlOptions);
}
xmlOptions.setProcessSchemaLocations(true);
if (option == null)
option = getDefaultLoadOptions().get(OPTION_EXTENDED_META_DATA);
ExtendedMetaData extendedMetaData;
final XSDHelper xsdHelper;
if (option == null) {
extendedMetaData = ExtendedMetaData.INSTANCE;
xsdHelper = XSDHelper.INSTANCE;
} else {
extendedMetaData = (ExtendedMetaData) option;
xsdHelper = new XSDHelperImpl(extendedMetaData, null);
}
xmlOptions.setEcoreBuilder(new DefaultEcoreBuilder(extendedMetaData) {
public Collection generate(Map targetNamespaceToURI) throws IOException {
for (Iterator iterator = targetNamespaceToURI.values().iterator(); iterator.hasNext();) {
String uri = iterator.next().toString();
xsdHelper.define(uri.indexOf(":/") == -1 ? Thread.currentThread().getContextClassLoader().getResourceAsStream(uri)
: new URL(uri).openStream(), uri);