Class Mapping<K>

java.lang.Object
tools.mdsd.jamopp.printer.implementation.Mapping<K>
Type Parameters:
K - Ensures, that the printer can print an instance of the class.

public class Mapping<K> extends Object
Maps a class to a printer. The printer must be able to print an instance of this class. The idea is, that you put a set of mappings in a list, iterate through the list and only print an element, if it is an instance of the class. See e.g. StatementPrinterImpl.
  • Constructor Details

  • Method Details

    • checkAndPrint

      public boolean checkAndPrint(EObject element, BufferedWriter writer) throws IOException
      Prints the element in the buffered writer, if the element is an instance of clazz.
      Parameters:
      element - Element to print
      writer - Writer in which to print
      Returns:
      true, if something was printed, otherwise else
      Throws:
      IOException - if the printer throws an IOException while printing