use helper methods to read the primitive nested types like BrokerId

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@366551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-01-06 19:18:02 +00:00
parent 2942846abc
commit 034949a481
1 changed files with 22 additions and 14 deletions

View File

@ -106,16 +106,12 @@ namespace OpenWire.Core.IO
}
out << " info.${propertyName} = "
type = property.type.qualifiedName
type = property.type.simpleName
switch (type) {
case "java.lang.String":
case "String":
out << "dataIn.ReadString()"
break;
case "org.apache.activemq.command.ActiveMQDestination":
out << "ReadDestination(dataIn)"
break;
case "boolean":
out << "dataIn.ReadBoolean()"
break;
@ -148,8 +144,16 @@ namespace OpenWire.Core.IO
out << "dataIn.ReadDouble()"
break;
case "ActiveMQDestination":
out << "ReadDestination(dataIn)"
break;
case "BrokerId[]":
out << "ReadBrokerIds(dataIn)"
break;
default:
out << "(${property.type.simpleName}) ReadCommand(dataIn, \"${type}\")"
out << "Read${type}(dataIn)"
}
out << """;
"""
@ -176,16 +180,12 @@ namespace OpenWire.Core.IO
def getter = "info." + propertyName
out << " "
type = property.type.qualifiedName
type = property.type.simpleName
switch (type) {
case "java.lang.String":
case "String":
out << "dataOut.Write($getter);"
break;
case "org.apache.activemq.command.ActiveMQDestination":
out << "WriteDestination($getter, dataOut);"
break;
case "boolean":
out << "dataOut.Write($getter);"
break;
@ -218,8 +218,16 @@ namespace OpenWire.Core.IO
out << "dataOut.Write($getter);"
break;
case "ActiveMQDestination":
out << "WriteDestination($getter, dataOut);"
break;
case "BrokerId[]":
out << "dataOut.WriteBrokerIds($getter);"
break;
default:
out << "WriteCommand($getter, dataOut, \"${type}\");"
out << "Write${type}($getter, dataOut);"
}
out << """
"""