diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2008-12-19 03:57:23 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2008-12-19 03:57:23 +0000 |
| commit | a8960649bcd365ef70a5de7812f5910222388a6d (patch) | |
| tree | ef84f2ee22165c4bb0d82fc65873342ac4c9f113 /RC4/java/common/StructFactory.tpl | |
| parent | 08c4b3bfc56387cd2d6f0be5cf544300c0d33148 (diff) | |
| download | qpid-python-a8960649bcd365ef70a5de7812f5910222388a6d.tar.gz | |
Tagging RC4 for M4 release
git-svn-id: https://svn.apache.org/repos/asf/qpid/tags/M4@727913 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'RC4/java/common/StructFactory.tpl')
| -rw-r--r-- | RC4/java/common/StructFactory.tpl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/RC4/java/common/StructFactory.tpl b/RC4/java/common/StructFactory.tpl new file mode 100644 index 0000000000..f3dcbbd68a --- /dev/null +++ b/RC4/java/common/StructFactory.tpl @@ -0,0 +1,39 @@ +package org.apache.qpid.transport; + +class StructFactory { + + public static Struct create(int type) + { + switch (type) + { +${ +from genutil import * + +fragment = """ case $name.TYPE: + return new $name(); +""" + +for c in composites: + name = cname(c) + if c.name == "struct": + out(fragment) +} default: + throw new IllegalArgumentException("type: " + type); + } + } + + public static Struct createInstruction(int type) + { + switch (type) + { +${ +for c in composites: + name = cname(c) + if c.name in ("command", "control"): + out(fragment) +} default: + throw new IllegalArgumentException("type: " + type); + } + } + +} |
