I know that in Cuba we can use this to add a validator to a TextField.
PositiveValidator positiveValidator = beanLocator.getPrototype(PositiveValidator.NAME);
numberField.addValidator(positiveValidator);
But how can I get the equivalent code in Java?