Class DefaultContext

java.lang.Object
com.puppycrawl.tools.checkstyle.DefaultContext
All Implemented Interfaces:
Context

public final class DefaultContext extends Object implements Context
A default implementation of the Context interface.
  • Field Details

  • Constructor Details

  • Method Details

    • get

      public Object get(String key)
      Description copied from interface: Context
      Searches for the value with the specified attribute key in this context.
      Specified by:
      get in interface Context
      Parameters:
      key - the attribute key.
      Returns:
      the value in this context with the specified attribute key value.
    • getAttributeNames

      Description copied from interface: Context
      Returns the names of all attributes of this context.
      Specified by:
      getAttributeNames in interface Context
      Returns:
      the names of all attributes of this context.
    • add

      public void add(String key, Object value)
      Adds a context entry.
      Parameters:
      key - the context key
      value - the value for key