Examples
Here are some example MAJ files. You can parse them by calling:
% java maj.Main <filename>
A file with the same name as the input file, but extension
.java instead of .maj will be created. All
the examples files create segments of code, and calls
System.out.println(myMAJCode.unparse()), which
prints out the templated code.
- aspecttest.maj:
a file that generates a couple of aspects.
- classdec.maj:
a file that generates classes.
- cu.maj:
a file that generates some compilation units (package declaration + import
statements + type definitions)
-
GOTECHGenarator.maj:
a file that generates aspects for making local java bean classes conform to
J2EE RMI standards. This is probably the most fun to look at!