diff options
author | Kim van der Riet <kpvdr@apache.org> | 2007-01-03 20:15:19 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2007-01-03 20:15:19 +0000 |
commit | a3370e8693452cef1092e3ca21e276d51e9ced98 (patch) | |
tree | 8a1797f4c1ccdef26ba555f9884e6b1767d79674 | |
parent | 82e598422b0c74ead043b7bfd8540f5137c5efe9 (diff) | |
download | qpid-python-a3370e8693452cef1092e3ca21e276d51e9ced98.tar.gz |
Added ability for code generator to omit elements from the XML specification
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@492280 13f79535-47bb-0310-9956-ffa450edef68
17 files changed, 245 insertions, 57 deletions
diff --git a/gentools/src/org/apache/qpid/gentools/AmqpClass.java b/gentools/src/org/apache/qpid/gentools/AmqpClass.java index 3f66e15567..190070ad45 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpClass.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpClass.java @@ -25,7 +25,7 @@ import java.io.PrintStream; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -public class AmqpClass implements Printable, NodeAware +public class AmqpClass implements Printable, NodeAware { public LanguageConverter converter; public AmqpVersionSet versionSet; @@ -44,50 +44,82 @@ public class AmqpClass implements Printable, NodeAware indexMap = new AmqpOrdinalVersionMap(); } - public void addFromNode(Node classNode, int ordinal, AmqpVersion version) + public boolean addFromNode(Node classNode, int ordinal, AmqpVersion version) throws AmqpParseException, AmqpTypeMappingException { versionSet.add(version); int index = Utils.getNamedIntegerAttribute(classNode, "index"); - AmqpVersionSet versionSet = indexMap.get(index); - if (versionSet != null) - versionSet.add(version); + AmqpVersionSet indexVersionSet = indexMap.get(index); + if (indexVersionSet != null) + indexVersionSet.add(version); else { - versionSet = new AmqpVersionSet(); - versionSet.add(version); - indexMap.put(index, versionSet); + indexVersionSet = new AmqpVersionSet(); + indexVersionSet.add(version); + indexMap.put(index, indexVersionSet); } NodeList nList = classNode.getChildNodes(); int fieldCntr = 0; - int methodCntr = 0; for (int i=0; i<nList.getLength(); i++) { Node child = nList.item(i); if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0) { - String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child, Utils.ATTRIBUTE_NAME)); + String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child, + Utils.ATTRIBUTE_NAME)); AmqpField thisField = fieldMap.get(fieldName); if (thisField == null) { thisField = new AmqpField(fieldName, converter); fieldMap.put(fieldName, thisField); } - thisField.addFromNode(child, fieldCntr, version); + if (!thisField.addFromNode(child, fieldCntr++, version)) + { + String className = converter.prepareClassName(Utils.getNamedAttribute(classNode, + Utils.ATTRIBUTE_NAME)); + System.out.println("INFO: Generation supression tag found for field " + + className + "." + fieldName + " - removing."); + thisField.removeVersion(version); + fieldMap.remove(fieldName); + } fieldCntr++; } else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0) { - String methodName = converter.prepareMethodName(Utils.getNamedAttribute(child, Utils.ATTRIBUTE_NAME)); + String methodName = converter.prepareMethodName(Utils.getNamedAttribute(child, + Utils.ATTRIBUTE_NAME)); AmqpMethod thisMethod = methodMap.get(methodName); if (thisMethod == null) { thisMethod = new AmqpMethod(methodName, converter); methodMap.put(methodName, thisMethod); } - thisMethod.addFromNode(child, methodCntr++, version); + if (!thisMethod.addFromNode(child, fieldCntr++, version)) + { + String className = converter.prepareClassName(Utils.getNamedAttribute(classNode, + Utils.ATTRIBUTE_NAME)); + System.out.println("INFO: Generation supression tag found for method " + + className + "." + methodName + " - removing."); + thisMethod.removeVersion(version); + methodMap.remove(methodName); + } + } + else if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0) + { + String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE); + if (value.compareTo("no-gen") == 0) + return false; } } + return true; + } + + public void removeVersion(AmqpVersion version) + { + indexMap.removeVersion(version); + fieldMap.removeVersion(version); + methodMap.removeVersion(version); + versionSet.remove(version); } public void print(PrintStream out, int marginSize, int tabSize) diff --git a/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java b/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java index 732ef46635..7b38f5cf3c 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java @@ -48,7 +48,7 @@ public class AmqpConstantSet extends TreeSet<AmqpConstant> implements Printable, /* (non-Javadoc) * @see org.apache.qpid.gentools.NodeAware#addFromNode(org.w3c.dom.Node, int, org.apache.qpid.gentools.AmqpVersion) */ - public void addFromNode(Node node, int ordinal, AmqpVersion version) + public boolean addFromNode(Node node, int ordinal, AmqpVersion version) throws AmqpParseException, AmqpTypeMappingException { NodeList nodeList = node.getChildNodes(); @@ -95,6 +95,7 @@ public class AmqpConstantSet extends TreeSet<AmqpConstant> implements Printable, } } } + return true; } /* (non-Javadoc) diff --git a/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java b/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java index a2a9ce3aa9..7e2974a444 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java @@ -37,7 +37,7 @@ public class AmqpDomainMap extends TreeMap<String, AmqpDomain> implements Printa this.converter.setDomainMap(this); } - public void addFromNode(Node n, int o, AmqpVersion v) + public boolean addFromNode(Node n, int o, AmqpVersion v) throws AmqpParseException, AmqpTypeMappingException { NodeList nl = n.getChildNodes(); @@ -81,7 +81,8 @@ public class AmqpDomainMap extends TreeMap<String, AmqpDomain> implements Printa { addFromNode(c, 0, v); } - } + } + return true; } public String getDomainType(String domainName, AmqpVersion version) diff --git a/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java b/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java index 6cd632a9d6..f91d98bfe7 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java @@ -20,6 +20,7 @@ */ package org.apache.qpid.gentools; +import java.util.ArrayList; import java.util.TreeMap; @SuppressWarnings("serial") @@ -31,4 +32,27 @@ public class AmqpDomainVersionMap extends TreeMap<String, AmqpVersionSet> implem return false; return get(firstKey()).equals(globalVersionSet); } + + public boolean removeVersion(AmqpVersion version) + { + Boolean res = false; + ArrayList<String> removeList = new ArrayList<String>(); + for (String domainName : keySet()) + { + AmqpVersionSet versionSet = get(domainName); + if (versionSet.contains(version)) + { + versionSet.remove(version); + if (versionSet.isEmpty()) + removeList.add(domainName); + res = true; + } + } + // Get rid of domains no longer in use + for (String domainName : removeList) + { + remove(domainName); + } + return res; + } } diff --git a/gentools/src/org/apache/qpid/gentools/AmqpField.java b/gentools/src/org/apache/qpid/gentools/AmqpField.java index 8e87641445..e1177e0154 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpField.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpField.java @@ -24,6 +24,7 @@ import java.io.PrintStream; import java.util.ArrayList; import org.w3c.dom.Node; +import org.w3c.dom.NodeList; public class AmqpField implements Printable, NodeAware, VersionConsistencyCheck { @@ -42,7 +43,7 @@ public class AmqpField implements Printable, NodeAware, VersionConsistencyCheck ordinalMap = new AmqpOrdinalVersionMap(); } - public void addFromNode(Node fieldNode, int ordinal, AmqpVersion version) + public boolean addFromNode(Node fieldNode, int ordinal, AmqpVersion version) throws AmqpParseException, AmqpTypeMappingException { versionSet.add(version); @@ -70,6 +71,25 @@ public class AmqpField implements Printable, NodeAware, VersionConsistencyCheck ordinalMap.put(ordinal, thisVersionList); } thisVersionList.add(version); + NodeList nList = fieldNode.getChildNodes(); + for (int i=0; i<nList.getLength(); i++) + { + Node child = nList.item(i); + if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0) + { + String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE); + if (value.compareTo("no-gen") == 0) + return false; + } + } + return true; + } + + public void removeVersion(AmqpVersion version) + { + domainMap.removeVersion(version); + ordinalMap.removeVersion(version); + versionSet.remove(version); } public boolean isCodeTypeConsistent(LanguageConverter converter) diff --git a/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java b/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java index 5053fba2aa..c91ec3d623 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java @@ -29,6 +29,17 @@ import java.util.TreeMap; @SuppressWarnings("serial") public class AmqpFieldMap extends TreeMap<String, AmqpField> implements VersionConsistencyCheck { + public void removeVersion(AmqpVersion version) + { + String[] fieldNameArray = new String[size()]; + keySet().toArray(fieldNameArray); + for (String fieldName : fieldNameArray) + { + get(fieldName).removeVersion(version); + remove(fieldName); + } + } + public AmqpFieldMap getFieldMapForOrdinal(int ordinal) { AmqpFieldMap newMap = new AmqpFieldMap(); diff --git a/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java b/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java index 88f337cbe3..048221bda8 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java @@ -20,6 +20,7 @@ */ package org.apache.qpid.gentools; +import java.util.ArrayList; import java.util.TreeMap; @SuppressWarnings("serial") @@ -44,4 +45,27 @@ public class AmqpFlagMap extends TreeMap<Boolean, AmqpVersionSet> implements Ver return false; return get(firstKey()).equals(globalVersionSet); } + + public boolean removeVersion(AmqpVersion version) + { + Boolean res = false; + ArrayList<Boolean> removeList = new ArrayList<Boolean>(); + for (Boolean flag : keySet()) + { + AmqpVersionSet versionSet = get(flag); + if (versionSet.contains(version)) + { + versionSet.remove(version); + if (versionSet.isEmpty()) + removeList.add(flag); + res = true; + } + } + // Get rid of flags no longer in use + for (Boolean flag : removeList) + { + remove(flag); + } + return res; + } } diff --git a/gentools/src/org/apache/qpid/gentools/AmqpMethod.java b/gentools/src/org/apache/qpid/gentools/AmqpMethod.java index 126949b44f..01db9c9356 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpMethod.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpMethod.java @@ -46,21 +46,21 @@ public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck serverMethodFlagMap = new AmqpFlagMap(); } - public void addFromNode(Node methodNode, int ordinal, AmqpVersion version) + public boolean addFromNode(Node methodNode, int ordinal, AmqpVersion version) throws AmqpParseException, AmqpTypeMappingException { + versionSet.add(version); boolean serverChassisFlag = false; boolean clientChassisFlag = false; - versionSet.add(version); int index = Utils.getNamedIntegerAttribute(methodNode, "index"); - AmqpVersionSet versionSet = indexMap.get(index); - if (versionSet != null) - versionSet.add(version); + AmqpVersionSet indexVersionSet = indexMap.get(index); + if (indexVersionSet != null) + indexVersionSet.add(version); else { - versionSet = new AmqpVersionSet(); - versionSet.add(version); - indexMap.put(index, versionSet); + indexVersionSet = new AmqpVersionSet(); + indexVersionSet.add(version); + indexMap.put(index, indexVersionSet); } NodeList nList = methodNode.getChildNodes(); int fieldCntr = 0; @@ -69,16 +69,27 @@ public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck Node child = nList.item(i); if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0) { - String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child, Utils.ATTRIBUTE_NAME)); + String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child, + Utils.ATTRIBUTE_NAME)); AmqpField thisField = fieldMap.get(fieldName); if (thisField == null) { thisField = new AmqpField(fieldName, converter); fieldMap.put(fieldName, thisField); } - thisField.addFromNode(child, fieldCntr++, version); + if (!thisField.addFromNode(child, fieldCntr++, version)) + { + String className = converter.prepareClassName(Utils.getNamedAttribute(methodNode.getParentNode(), + Utils.ATTRIBUTE_NAME)); + String methodName = converter.prepareMethodName(Utils.getNamedAttribute(methodNode, + Utils.ATTRIBUTE_NAME)); + System.out.println("INFO: Generation supression tag found for field " + + className + "." + methodName + "." + fieldName + " - removing."); + thisField.removeVersion(version); + fieldMap.remove(fieldName); + } } - if (child.getNodeName().compareTo(Utils.ELEMENT_CHASSIS) == 0) + else if (child.getNodeName().compareTo(Utils.ELEMENT_CHASSIS) == 0) { String chassisName = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_NAME); if (chassisName.compareTo("server") == 0) @@ -86,8 +97,24 @@ public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck else if (chassisName.compareTo("client") == 0) clientChassisFlag = true; } + else if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0) + { + String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE); + if (value.compareTo("no-gen") == 0) + return false; + } } processChassisFlags(serverChassisFlag, clientChassisFlag, version); + return true; + } + + public void removeVersion(AmqpVersion version) + { + clientMethodFlagMap.removeVersion(version); + serverMethodFlagMap.removeVersion(version); + indexMap.removeVersion(version); + fieldMap.removeVersion(version); + versionSet.remove(version); } public void print(PrintStream out, int marginSize, int tabSize) @@ -96,7 +123,8 @@ public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck String tab = Utils.createSpaces(tabSize); out.println(margin + "[M] " + name + " {" + (serverMethodFlagMap.isSet() ? "S " + serverMethodFlagMap + (clientMethodFlagMap.isSet() ? ", " : "") : "") + - (clientMethodFlagMap.isSet() ? "C " + clientMethodFlagMap : "") + "}" + ": " + versionSet); + (clientMethodFlagMap.isSet() ? "C " + clientMethodFlagMap : "") + "}" + ": " + + versionSet); for (Integer thisIndex : indexMap.keySet()) { diff --git a/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java b/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java index 25a41df131..59eedd2a2b 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java @@ -25,5 +25,12 @@ import java.util.TreeMap; @SuppressWarnings("serial") public class AmqpMethodMap extends TreeMap<String, AmqpMethod> { + public void removeVersion(AmqpVersion version) + { + for (String methodName : keySet()) + { + get(methodName).removeVersion(version); + } + } } diff --git a/gentools/src/org/apache/qpid/gentools/AmqpModel.java b/gentools/src/org/apache/qpid/gentools/AmqpModel.java index caf8bbcdaf..721247a4b2 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpModel.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpModel.java @@ -37,7 +37,7 @@ public class AmqpModel implements Printable, NodeAware classMap = new AmqpClassMap(); } - public void addFromNode(Node n, int o, AmqpVersion v) + public boolean addFromNode(Node n, int o, AmqpVersion v) throws AmqpParseException, AmqpTypeMappingException { NodeList nList = n.getChildNodes(); @@ -54,9 +54,15 @@ public class AmqpModel implements Printable, NodeAware thisClass = new AmqpClass(className, converter); classMap.put(className, thisClass); } - thisClass.addFromNode(c, eCntr++, v); + if (!thisClass.addFromNode(c, eCntr++, v)) + { + System.out.println("INFO: Generation supression tag found for class " + className + " - removing."); + thisClass.removeVersion(v); + classMap.remove(className); + } } - } + } + return true; } public void print(PrintStream out, int marginSize, int tabSize) diff --git a/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java b/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java index 3f4a9f39e6..3706c9391d 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java @@ -20,6 +20,7 @@ */ package org.apache.qpid.gentools; +import java.util.ArrayList; import java.util.TreeMap; @SuppressWarnings("serial") @@ -43,4 +44,29 @@ public class AmqpOrdinalVersionMap extends TreeMap<Integer, AmqpVersionSet> impl } throw new AmqpTypeMappingException("Unable to locate version " + version + " in ordianl version map."); } + + public boolean removeVersion(AmqpVersion version) + { + Boolean res = false; + ArrayList<Integer> removeList = new ArrayList<Integer>(); + for (Integer ordinal : keySet()) + { + AmqpVersionSet versionSet = get(ordinal); + if (versionSet.contains(version)) + { + versionSet.remove(version); + if (versionSet.isEmpty()) + { + removeList.add(ordinal); + } + res = true; + } + } + // Get rid of ordinals no longer in use + for (Integer ordinal : removeList) + { + remove(ordinal); + } + return res; + } } diff --git a/gentools/src/org/apache/qpid/gentools/AmqpVersion.java b/gentools/src/org/apache/qpid/gentools/AmqpVersion.java index 0c0c5a5cbf..579d8e28b2 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpVersion.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpVersion.java @@ -30,6 +30,12 @@ public class AmqpVersion implements Comparable<AmqpVersion> this.major = major; this.minor = minor; } + + public AmqpVersion(AmqpVersion version) + { + this.major = version.major; + this.minor = version.minor; + } public int getMajor() { diff --git a/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java b/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java index 06b10cfda6..4406893cbb 100644 --- a/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java +++ b/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java @@ -30,13 +30,25 @@ public class AmqpVersionSet extends TreeSet<AmqpVersion> implements Printable, C { public AmqpVersionSet() { + super(); } public AmqpVersionSet(AmqpVersion version) { + super(); add(version); } + public AmqpVersion find(AmqpVersion version) + { + for (AmqpVersion v : this) + { + if (v.compareTo(version) == 0) + return v; + } + return null; + } + public void print(PrintStream out, int marginSize, int tabSize) { out.print(Utils.createSpaces(marginSize) + "Version Set: " + toString() + Utils.lineSeparator); diff --git a/gentools/src/org/apache/qpid/gentools/Generator.java b/gentools/src/org/apache/qpid/gentools/Generator.java index 44f15cc71a..e7ccd64fbe 100644 --- a/gentools/src/org/apache/qpid/gentools/Generator.java +++ b/gentools/src/org/apache/qpid/gentools/Generator.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.io.LineNumberReader; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; -import java.util.Iterator; public abstract class Generator implements LanguageConverter { @@ -185,38 +184,29 @@ public abstract class Generator implements LanguageConverter } // Cycle through classes - Iterator<String> citr = model.classMap.keySet().iterator(); - while (citr.hasNext()) + for (String className : model.classMap.keySet()) { - String className = citr.next(); AmqpClass thisClass = model.classMap.get(className); - // Use all class-level templates for (String[] ct : classTemplateList) { processTemplateB(ct, thisClass); } - + // Cycle through all methods - Iterator<String> mitr = thisClass.methodMap.keySet().iterator(); - while (mitr.hasNext()) + for (String methodName : thisClass.methodMap.keySet()) { - String methodName = mitr.next(); AmqpMethod method = thisClass.methodMap.get(methodName); - // Use all method-level templates for (String[] mt : methodTemplateList) { processTemplateC(mt, thisClass, method); } - + // Cycle through all fields - Iterator<String> fitr = method.fieldMap.keySet().iterator(); - while (fitr.hasNext()) + for (String fieldName : method.fieldMap.keySet()) { - String fieldName = fitr.next(); AmqpField field = method.fieldMap.get(fieldName); - // Use all field-level templates for (String[] ft : fieldTemplateList) { diff --git a/gentools/src/org/apache/qpid/gentools/JavaGenerator.java b/gentools/src/org/apache/qpid/gentools/JavaGenerator.java index 36b5f2f6d1..e4d7ae0e78 100644 --- a/gentools/src/org/apache/qpid/gentools/JavaGenerator.java +++ b/gentools/src/org/apache/qpid/gentools/JavaGenerator.java @@ -733,14 +733,12 @@ public class JavaGenerator extends Generator String tab = Utils.createSpaces(tabSize); StringBuffer sb = new StringBuffer(); - Iterator<String> cItr = model.classMap.keySet().iterator(); - while (cItr.hasNext()) + for (String className : model.classMap.keySet()) { - AmqpClass thisClass = model.classMap.get(cItr.next()); - Iterator<String> mItr = thisClass.methodMap.keySet().iterator(); - while (mItr.hasNext()) + AmqpClass thisClass = model.classMap.get(className); + for (String methodName : thisClass.methodMap.keySet()) { - AmqpMethod method = thisClass.methodMap.get(mItr.next()); + AmqpMethod method = thisClass.methodMap.get(methodName); for (AmqpVersion version : globalVersionSet) { // Find class and method index for this version (if it exists) @@ -750,10 +748,10 @@ public class JavaGenerator extends Generator int methodIndex = findIndex(method.indexMap, version); sb.append(indent + "classIDMethodIDVersionBodyMap.put(" + cr); sb.append(indent + tab + "createMapKey((short)" + classIndex + - ", (short)" + methodIndex + ", (byte)" + version.getMajor() + - ", (byte)" + version.getMinor() + "), " + cr); + ", (short)" + methodIndex + ", (byte)" + version.getMajor() + + ", (byte)" + version.getMinor() + "), " + cr); sb.append(indent + tab + Utils.firstUpper(thisClass.name) + - Utils.firstUpper(method.name) + "Body.class);" + cr); + Utils.firstUpper(method.name) + "Body.class);" + cr); } catch (Exception e) {} // Ignore } diff --git a/gentools/src/org/apache/qpid/gentools/NodeAware.java b/gentools/src/org/apache/qpid/gentools/NodeAware.java index a8f20f611a..df4e0ecb02 100644 --- a/gentools/src/org/apache/qpid/gentools/NodeAware.java +++ b/gentools/src/org/apache/qpid/gentools/NodeAware.java @@ -39,7 +39,8 @@ public interface NodeAware * @param v Verion of the DOM from which the node comes. * @throws AmqpParseException * @throws AmqpTypeMappingException + * @returns true if a node was added, false if not */ - public void addFromNode(Node n, int o, AmqpVersion v) + public boolean addFromNode(Node n, int o, AmqpVersion v) throws AmqpParseException, AmqpTypeMappingException; } diff --git a/gentools/src/org/apache/qpid/gentools/Utils.java b/gentools/src/org/apache/qpid/gentools/Utils.java index 705e7dbf19..ade00cd8c7 100644 --- a/gentools/src/org/apache/qpid/gentools/Utils.java +++ b/gentools/src/org/apache/qpid/gentools/Utils.java @@ -46,6 +46,7 @@ public class Utils public final static String ELEMENT_AMQP = "amqp"; public final static String ELEMENT_CHASSIS = "chassis"; public final static String ELEMENT_CLASS = "class"; + public final static String ELEMENT_CODEGEN = "codegen"; public final static String ELEMENT_CONSTANT = "constant"; public final static String ELEMENT_DOMAIN = "domain"; public final static String ELEMENT_METHOD = "method"; |