MCPcopy Create free account
hub / github.com/badvision/jace / addNumericValidator

Method addNumericValidator

src/main/java/jace/cheat/MetaCheat.java:93–102  ·  view source on GitHub ↗
(StringProperty stringProperty)

Source from the content-addressed store, hash-verified

91 }
92
93 private void addNumericValidator(StringProperty stringProperty) {
94 stringProperty.addListener((ObservableValue<? extends String> prop, String oldVal, String newVal) -> {
95 if (newVal == null || newVal.isEmpty()) {
96 return;
97 }
98 if (!newVal.matches("(\\+|-)?(x|$)?[0-9a-fA-F]*")) {
99 stringProperty.set("");
100 }
101 });
102 }
103
104 public int parseInt(String s) throws NumberFormatException {
105 if (s == null || s.isEmpty()) {

Callers 1

MetaCheatMethod · 0.95

Calls 2

setMethod · 0.80
addListenerMethod · 0.45

Tested by

no test coverage detected