+
+ List<QName> objectClasses = content.getTypes();
+ Set<String> types = new TreeSet<>();
+ for (QName cc : objectClasses) {
+ String type = cc.getPrefix() + ":" + cc.getLocalPart();
+ if (byType.containsKey(type))
+ types.add(type);
+ }
+ if (types.size() == 0)
+ throw new IllegalArgumentException("No type found for " + content + " (" + objectClasses + ")");
+ String type = types.iterator().next();
+ if (!byType.containsKey(type))
+ throw new IllegalArgumentException("No component found for " + content + " with type " + type);
+ return byType.get(type).get();
+ // throw new UnsupportedOperationException("Content " +
+ // content.getClass().getName() + " is not supported.");