@Override
	public boolean export(File file, DomainObject domainObj, AddressSetView addrSet,
			TaskMonitor monitor) throws IOException, ExporterException {

		log.clear();

		if (!(domainObj instanceof Program)) {
			log.appendMsg("Unsupported type: " + domainObj.getClass().getName());
			return false;
		}
		Program program = (Program) domainObj;
		if (program.getMaxAddress().getSize() > 32) {
			log.appendMsg("Cannot be used for programs larger than 32 bits");
			return false;
		}

		if (addressSpaceOption == null || recordSizeOption == null) {
			getOptions(() -> program);
		}

		try (PrintWriter writer = new PrintWriter(new FileOutputStream(file))) {

			Memory memory = program.getMemory();

			if (addrSet == null) {
				addrSet = memory;
			}

			try {
				List<IntelHexRecord> records = dumpMemory(program, memory, addrSet, monitor);
				for (IntelHexRecord record : records) {
					writer.println(record.format());
				}
			}
			catch (MemoryAccessException e) {
				throw new ExporterException(e);
			}
			finally {
				addressSpaceOption = null;
				recordSizeOption = null;
			}
		}

		return true;
	}
Verifier for a {@link HintTextField} that ensures input is a numeric value between
0 and 0xFF.
<p>
Input may be specified in either decimal or hex.
Ghidra/Features/Base/src/main/java/ghidra/app/util/exporter/IntelHexExporter.java