public static TypeAndDefault<?> parse(Location loc, String typeName, String defaultString,
				Map<String, UserType<?>> userEnums) throws ParseException {
			OptType<?> tac = OptType.parse(loc, typeName, userEnums);
			Object value = tac.decode(loc, defaultString);
			return tac.withCastDefault(new ValStr<>(value, defaultString));
		}
A parser for reading attributes from a script header
Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/ScriptAttributesParser.java