*
* @param classes
* @return
*/
public static JavaQName getCommonJavaType(List types) {
JavaQName parentType = null;
JavaQName ownType = null;
boolean ownTypeIsObject = false;
boolean parentTypeIsObject = false;
for(int i=0;i<types.size();i++) {
XmlSchemaType type = (XmlSchemaType)types.get(i);
JavaQName currentOwnType = getOwnType(type);
JavaQName currentParentType = getParentType(type);
if(log.isDebugEnabled())
log.debug(type.getQName().toString()+" [ownType="+currentOwnType.getClassName()
+",parentType="+currentParentType.getClassName()+"]");
if(ownType==null)
ownType = currentOwnType;
else if(!ownTypeIsObject && !ownType.getClassName().equals(currentOwnType.getClassName())) {
ownType = JavaQNameImpl.getInstance(Object.class);
ownTypeIsObject = true;
}
if(parentType==null)
parentType = currentParentType;
else if(!parentTypeIsObject && !parentType.getClassName().equals(currentParentType.getClassName())) {
parentType = JavaQNameImpl.getInstance(Object.class);
parentTypeIsObject = true;
}
}