Byte key = new Byte(buffer.get());
PacketFieldFactory factory = (PacketFieldFactory) factories.get(key);
if (factory == null) throw new ProtocolException("No factory registered for " + key);
return factory.create(buffer);
}
private MenuItemPacketFieldReader() {
register(MenuItem.CREATE, new CreateInstanceMenuItem());
register(MenuItem.ATTRIBUTE, new SetAttributeMenuItem());