private static int parseSize(String size) {

		if (StringUtils.isBlank(size)) {
			throw new NumberFormatException();
		}
		size = size.trim();
		if (StringUtils.startsWithIgnoreCase(size, "0x")) {
			return Integer.parseInt(size.substring(2), 16);
		}
		return Integer.parseInt(size);
	}
Throws exception if the data type does not match the specified {@link AllowedDataTypes}.

@param dt {@link DataType} to check
@param allowedTypes {@link AllowedDataTypes enum} specifying what category of data types are ok
@throws InvalidDataTypeException if dt violates the specified allowedTypes
Ghidra/Features/Base/src/main/java/ghidra/util/data/DataTypeParser.java