private void setElementClassName()

in src/main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/AnnotationDescriptorReader.java [280:309]


	private void setElementClassName(CollectionDescriptor collectionDescriptor, Type type) {
		if (type instanceof ParameterizedType)
		{
			Type[] paramType = ((ParameterizedType) type).getActualTypeArguments();
			//TODO : change this condition. No sure if it will be all the time true.
			// If only one type argument, the object is certainly a collection
			if (paramType.length == 1)
			{
				collectionDescriptor.setElementClassName(paramType[0].toString().replace("class ", "").replace("interface ", ""));

			}
			// either, it is certainly a map
			else
			{
				collectionDescriptor.setElementClassName(paramType[1].toString().replace("class ", "").replace("interface ", ""));
			}

		}
		else
		{
			Type ancestorType = ((Class)type).getGenericSuperclass();
            if ( ancestorType!= null)
            {
			   setElementClassName(collectionDescriptor,ancestorType);
            }
            else{
            	collectionDescriptor.setElementClassName(Object.class.getName());
            }
		}
	}