Class Flags

java.lang.Object
org.tentackle.maven.plugin.mcp.render.Flags

public final class Flags extends Object
Renders the boolean facets of a model element as a compact, greppable list.

A row in a table cannot carry thirty columns of booleans, but it can carry the handful that are true.

Author:
harald
  • Field Details

    • ENTITY_FILTERS

      public static final String[] ENTITY_FILTERS
      The entity filters usable in a listing, in the order they are documented.
  • Method Details

    • of

      public static List<String> of(Entity entity)
      Gets the flags of an entity.
      Parameters:
      entity - the entity
      Returns:
      the flags, empty if the entity is plain
    • matches

      public static boolean matches(Entity entity, String filter)
      Returns whether an entity matches a filter.
      Parameters:
      entity - the entity
      filter - the filter name, see ENTITY_FILTERS
      Returns:
      true if the entity matches
      Throws:
      IllegalArgumentException - if the filter is unknown
    • of

      public static List<String> of(Attribute attribute) throws ModelException
      Gets the flags of an attribute.
      Parameters:
      attribute - the attribute
      Returns:
      the flags, empty if the attribute is plain
      Throws:
      ModelException - if the model is inconsistent
    • of

      public static List<String> of(Relation relation)
      Gets the flags of a relation.
      Parameters:
      relation - the relation
      Returns:
      the flags, empty if the relation is plain
    • join

      public static String join(List<String> flags)
      Joins flags into a single cell value.
      Parameters:
      flags - the flags
      Returns:
      the joined flags, an empty string if there are none