Check out example codes for "java class in dataweave". It will help you in understanding the concepts better.

Code Example 1

%dw 2.0
import java!utils::MyUtils
output application/json
---
{
	a: MyUtils::appendRandom("myString")
}

Learn ReactJs, React Native from akashmittal.com