private static DataType getDataType(Field field, Object object) {
		Class<?> fieldClazz = field.getType();
		if (fieldClazz.isArray()) {
			return getArrayDataType(field, object, fieldClazz);
		}
		if (fieldClazz.equals(byte.class) || fieldClazz.equals(Byte.class)) {
			return new ByteDataType();
		}
		if (fieldClazz.equals(short.class) || fieldClazz.equals(Short.class)) {
			return new WordDataType();
		}
		if (fieldClazz.equals(int.class) || fieldClazz.equals(Integer.class)) {
			return new DWordDataType();
		}
		if (fieldClazz.equals(long.class) || fieldClazz.equals(Long.class)) {
			return new QWordDataType();
		}
		if (fieldClazz.equals(float.class) || fieldClazz.equals(Float.class)) {
			return new FloatDataType();
		}
		if (fieldClazz.equals(double.class) || fieldClazz.equals(Double.class)) {
			return new DoubleDataType();
		}
		if (StructConverter.class.isAssignableFrom(fieldClazz)) {
			return toDataType(fieldClazz);
		}
		throw new RuntimeException("Unsupported datatype for automatic structure conversion - "+fieldClazz);
	}
This is a convenience method for converting a class into structure.
The class is reflected to extract the field members.
Only private non-static fields are considered.
Any field names that start with underscore ("_") are ignored.
@param clazz the class to reflect
@return a structure representing the class fields.
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/StructConverterUtil.java