Metamodel constraints can be specified in declarative languages (e.g. OCL, Prolog) or, alternatively, in Java.
Metamodel constraints are defined in two ways: using declarative languages (like OCL and Prolog) or by writing Java code.