Class AbstractErrorReportBuilder

java.lang.Object
jadex.bpmn.model.io.AbstractErrorReportBuilder

public abstract class AbstractErrorReportBuilder extends Object
Helper class for building error reports.
  • Field Details

    • name

      protected String name
      The unqualified (model/file) name.
    • filename

      protected String filename
      The file name with path (optional).
    • categories

      protected String[] categories
      The element categories.
    • entries

      protected jadex.collection.MultiCollection<jadex.common.Tuple,String> entries
      The parse errors (tuple(elements) -> {error messages}).
    • externals

      protected Map<String,String> externals
      The external documents for links in html error reports (id -> html text).
  • Constructor Details

    • AbstractErrorReportBuilder

      public AbstractErrorReportBuilder(String name, String filename, String[] categories, jadex.collection.MultiCollection<jadex.common.Tuple,String> entries, Map<String,String> externals)
      Build the error based on the given entries (if any). Entries represent error messages mapped by the path to the xml element (as a tuple of stack elements).
      Parameters:
      name - The unqualified (model/file) name.
      filename - The file name with path (optional).
      categories - The element categories.
      entries - The parse errors (tuple(stack elements) -> {error messages}).
      externals - The external documents for links in html error reports, if any (id -> html text).
  • Method Details

    • buildErrorReport

      public jadex.model.IErrorReport buildErrorReport()
      Build the error based on the given entries (if any). Entries represent error messages mapped by the path to the xml element (as a tuple of stack elements).
      Returns:
      The error report.
    • getPathElementObject

      public abstract Object getPathElementObject(Object element)
      Get the object of a path element
      Parameters:
      obj - An item (entry) of a tuple in the multi collection.
      Returns:
      The object corresponding to the entry.
    • isInCategory

      public abstract boolean isInCategory(Object obj, String category)
      Test if an object belongs to a category.
      Parameters:
      obj - An item (entry) of a tuple in the multi collection.
      category - the category name.
      Returns:
      True, when the object belongs to the category.
    • getObjectName

      public abstract String getObjectName(Object obj)
      Get the name of an object.
      Parameters:
      obj - An object having an error.
      Returns:
      A human readable name of the object.
    • getElements

      protected jadex.common.Tuple[] getElements()
      Get all invalid elements.
    • getMessages

      protected String[] getMessages(jadex.common.Tuple path)
      Get the messages for a given element.
    • generateErrorText

      protected String generateErrorText()
      Generate a string representation of the report.
    • generateErrorHTML

      protected String generateErrorHTML()
      Generate an html representation of the report.
    • getOwnedElementErrors

      protected Set<Object> getOwnedElementErrors(String category)
      Get elements of the given owner type, which have errors or contain elements with errors.
    • getOtherErrors

      protected Set<Object> getOtherErrors(Set<Object> excludes)
      Get other errors, not in the given tags.
    • getObject

      protected Object getObject(jadex.common.Tuple element)
    • getElementErrors

      protected jadex.common.Tuple[] getElementErrors(Object ancestor)
      Get all elements which have errors and are contained in the given element.
    • generateOverview

      protected void generateOverview(StringBuffer buf, String type, Set<Object> elements)
      Generate overview HTML code for the given elements.
    • generateDetails

      protected void generateDetails(StringBuffer buf, String type, Set<Object> elements)
      Generate detail HTML code for the given elements.