return javaClass;
}
private Class generateCollectionValue(JavaClass collectionClass, TypeMappingInfo typeMappingInfo, Class xmlElementType, List<JavaClass> classesToProcess) {
JavaClass componentClass;
if (typeMappingInfo != null && xmlElementType != null) {
componentClass = helper.getJavaClass(xmlElementType);
} else{
Collection args = collectionClass.getActualTypeArguments();
if(args.size() >0 ){
componentClass = ((JavaClass) args.toArray()[0]);
}else{
componentClass = helper.getJavaClass(Object.class);
}
}
boolean multiDimensional = false;
if (componentClass.isPrimitive()) {
Class primitiveClass = getPrimitiveClass(componentClass.getRawName());
componentClass = helper.getJavaClass(getObjectClass(primitiveClass));
} else if(helper.getJavaClass(Collection.class).isAssignableFrom(componentClass)) {
multiDimensional = true;
Class nestedCollectionClass = collectionClassesToGeneratedClasses.get(componentClass.getName());
if (nestedCollectionClass == null) {
nestedCollectionClass = generateCollectionValue(componentClass, typeMappingInfo, xmlElementType, classesToProcess);
arrayClassesToGeneratedClasses.put(componentClass.getName(), nestedCollectionClass);
classesToProcess.add(helper.getJavaClass(nestedCollectionClass));
}
componentClass = helper.getJavaClass(nestedCollectionClass);
} else if(componentClass.isArray()) {
if(componentClass.getName().equals("[B")) {
multiDimensional = false;
} else {
multiDimensional = true;
Class nestedArrayClass = arrayClassesToGeneratedClasses.get(componentClass.getName());
if (nestedArrayClass == null) {
nestedArrayClass = generateWrapperForArrayClass(componentClass, typeMappingInfo, xmlElementType, classesToProcess);
arrayClassesToGeneratedClasses.put(componentClass.getName(), nestedArrayClass);
}
componentClass = helper.getJavaClass(nestedArrayClass);
}
}
PackageInfo packageInfo = packageToPackageInfoMappings.get(collectionClass.getPackageName());
String namespace = EMPTY_STRING;
if (this.defaultTargetNamespace != null) {
namespace = this.defaultTargetNamespace;
}
PackageInfo componentNamespaceInfo = getPackageInfoForPackage(componentClass);
String packageName = componentClass.getPackageName();
packageName = "jaxb.dev.java.net." + packageName;
if (packageInfo == null) {
packageInfo = getPackageToPackageInfoMappings().get(packageName);
} else {
getPackageToPackageInfoMappings().put(packageName, packageInfo);
if (packageInfo.getNamespace() != null) {
namespace = packageInfo.getNamespace();
}
}
if (packageInfo == null) {
if (componentNamespaceInfo != null) {
packageInfo = componentNamespaceInfo;
} else {
packageInfo = new PackageInfo();
packageInfo.setNamespaceInfo(new NamespaceInfo());
packageInfo.setNamespaceResolver(new NamespaceResolver());
}
getPackageToPackageInfoMappings().put(packageName, packageInfo);
}
String name = componentClass.getName();
if("[B".equals(name)) {
name = "byteArray";
}
int beginIndex = name.lastIndexOf(DOT_CHR) + 1;