Class Factory

java.lang.Object
eu.bandm.tools.umod.Factory

public class Factory extends Object
Collection of methods for easy programmatic creation of a umod model description. Usage:
  1. Create an instance of this class.
  2. Create the meta-model by its methods.
  3. call new Checker.check(myFactory.model, msg)
  4. call GeneratedPackage gp = new UMod2Java().translate(myFactory.model)
  5. call new Unparser.write(gp)

((FIXME: these further stages of processing could be integrated in this Factory by further convenience wrapper methods, if desired.))
The original umod model is a umod model itself, and is accessible throughout by the field model. The umod model classes defined in UMod are returned as results and accessible via model and can be manipulated directly, if required. But the factory methods are preferred, because of implied consistency.
The basic umod rules are tested anyhow:
  • There is one single namespace for the model itself, model clases, enumerations, imports, exported interfaces, and visitor base classes. Identifiers are unique among all these.
  • No shadowing/re-usage of field names on a path to the classs tree root(s).

The additional rules imposed by the umod parser front-end are ensured additionally, if parameter parserLike is set to true:
  • Field names start lower case; class names start upper case.