The PrintTask examines the declaredClass attribute of a layer when generating the web map as json parameter. This makes it tedious to extend a layer and expect the layer to print. Rather, the PrintTask should use the Dojo method isInstanceOf to determine the type of layer. Or, add a method to the top level Layer object, perhaps "getWebMapRepresentation", and then let subclasses override this method as needed. The PrintTask would then call this method to generate the JSON structure for printing.