summaryrefslogtreecommitdiff
path: root/tutorial/examples/verbose/VerboseClass.oj
diff options
context:
space:
mode:
Diffstat (limited to 'tutorial/examples/verbose/VerboseClass.oj')
-rw-r--r--tutorial/examples/verbose/VerboseClass.oj30
1 files changed, 30 insertions, 0 deletions
diff --git a/tutorial/examples/verbose/VerboseClass.oj b/tutorial/examples/verbose/VerboseClass.oj
new file mode 100644
index 0000000..a6ac099
--- /dev/null
+++ b/tutorial/examples/verbose/VerboseClass.oj
@@ -0,0 +1,30 @@
+/*
+ * VerboseClass.java
+ *
+ * @author Michiaki Tatsubori
+ * @version %VERSION% %DATE%
+ * @see java.lang.Object
+ *
+ * COPYRIGHT 1999 by Michiaki Tatsubori, ALL RIGHTS RESERVED.
+ */
+package examples.verbose;
+
+
+import openjava.mop.*;
+import openjava.ptree.*;
+import openjava.syntax.*;
+
+
+public class VerboseClass instantiates Metaclass extends OJClass
+{
+ /* overrides for translation */
+ public void translateDefinition() throws MOPException {
+ OJMethod[] methods = getDeclaredMethods();
+ for (int i = 0; i < methods.length; ++i) {
+ Statement printer = makeStatement(
+ "java.lang.System.out.println( \"" +
+ methods[i].toString() + " was called\" );" );
+ methods[i].getBody().insertElementAt( printer, 0 );
+ }
+ }
+}