private boolean isValid(StringBuilder builder) {
			String valueString = builder.toString();

			// Depending on configuration and input string, determine if we should parse as hex.
			// If we don't allow "0x" prefix, then use the current hex/integer mode, Otherwise,
			// parse as hex depending on whether or not the input string starts with the
			// "0x" prefix.
			boolean parseAsHex = shouldParseAsHex(valueString);

			// allow the string if it is the beginning of a valid string even though
			// it doesn't evaluate to a number yet.
			if (isValidPrefix(valueString)) {
				// When the input is valid, update the hex mode to match how the text was parsed.
				// See parseAsHex variable comment above.
				setHexMode(parseAsHex);
				return true;
			}

			// otherwise, it must parse to a number to be valid.
			try {
				BigInteger value = computeValueFromString(valueString, parseAsHex);
				if (isNonAllowedNegativeNumber(value)) {
					return false;
				}
				if (passesMaxCheck(value) && passesMinCheck(value)) {
					// When the input is valid, update the hex mode to match how the text was parsed.
					// See parseAsHex variable comment above.
					setHexMode(parseAsHex);
					return true;
				}
			}
			catch (NumberFormatException e) {
				return false;
			}
			return false;
		}
DocumentFilter that prevents users from entering invalid data into the field.
Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/IntegerTextField.java