CubaTextFieldWidget

Hello everyone.
I implemented a CubaTextFieldWidget by extending CubaTextFieldWidget. Is there a possibility to understand the type of data to which the textfield is linked programmatically? my goal is to replace characters after typing but only if the data is a BigDecimal.
Thank you and greetings