Class NameConverter

java.lang.Object
org.openjdk.jmc.common.labelingrules.NameConverter

public class NameConverter extends Object
Converts names according to rules specified with the labelingRules extension point.
  • Field Details

  • Constructor Details

    • NameConverter

      public NameConverter()
      Create a new name converter instance. This should only be used if you want a new, clean instance. Normally the getInstance() method should be used instead to get a singleton instance.
    • NameConverter

      public NameConverter(List<NamingRule> rules)
  • Method Details

    • getInstance

      public static NameConverter getInstance()
      Returns:
      a singleton instance
    • format

      public String format(JVMDescriptor descriptor)
      Parameters:
      descriptor -
      Returns:
      the properly formatted values. If no matching formatter could be found, the default format String as defined in NameConverter_LOCAL_NAME_TEMPLATE will be used.
    • getImageResource

      public Resource getImageResource(JVMDescriptor descriptor)
    • addNamingRule

      public void addNamingRule(NamingRule rule)
      Adds a rule to the name converter.

      Adding rules should normally not be done using this method, but rather through the labelingRules extension point.

      Parameters:
      rule - the rule to add.
    • getRules

      public List<NamingRule> getRules()
      Returns:
      an immutable list of the available rules.
    • setRules

      public void setRules(List<NamingRule> rules)
    • setIdentity

      public void setIdentity(String identity)