final String elementName, final String collectionName,
final JavaNaming javaNaming, final boolean useJava50) {
String temp = collectionName;
if (temp == null || temp.length() == 0) { temp = _default; }
final CollectionInfo cInfo;
if (temp.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_VECTOR)) {
cInfo = new CollectionInfo(contentType, name, elementName, useJava50,
this.collectionMemberAndAccessorFactory, this.fieldMemberAndAccessorFactory);
} else if (temp.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_ARRAY_LIST)) {
cInfo = new CollectionInfoJ2(contentType, name, elementName, "arraylist", useJava50,
this.collectionJ2MemberAndAccessorFactory, this.fieldMemberAndAccessorFactory);
} else if (temp.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_ODMG)) {
cInfo = new CollectionInfoODMG30(contentType, name, elementName, useJava50,
this.collectionODMG30MemberAndAccessorFactory, this.fieldMemberAndAccessorFactory);
} else if (temp.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_COLLECTION)) {
cInfo = new CollectionInfoJ2Collection(contentType, name, elementName, useJava50,
this.collectionJ2NoIndexMemberAndAccessorFactory, this.fieldMemberAndAccessorFactory);
} else if (temp.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_SET)) {
cInfo = new CollectionInfoJ2Set(contentType, name, elementName, useJava50,
this.collectionJ2NoIndexMemberAndAccessorFactory, this.fieldMemberAndAccessorFactory);
} else if (temp.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_SORTED_SET)) {
cInfo = new CollectionInfoJ2SortedSet(contentType, name, elementName, useJava50,
this.collectionJ2NoIndexMemberAndAccessorFactory, this.fieldMemberAndAccessorFactory);
} else {
throw new InvalidParameterException("Unrecognized collection type: " + temp);
}
//--not sure it is pluggable enough, it is not really beautiful to specify
//--the collection to use here
cInfo.setCreateExtraMethods(_extraMethods);
if (_referenceSuffix != null) {
cInfo.setReferenceMethodSuffix(_referenceSuffix);
}
if (_bound) { cInfo.setBound(true); }
return cInfo;
}