Class Config

java.lang.Object
org.casbin.jcasbin.config.Config

public class Config extends Object
  • Field Details

  • Constructor Details

    • Config

      public Config()
      Config represents the configuration parser.
  • Method Details

    • newConfig

      public static Config newConfig(String confName)
      newConfig create an empty configuration representation from file.
      Parameters:
      confName - the path of the model file.
      Returns:
      the constructor of Config.
    • newConfigFromText

      public static Config newConfigFromText(String text)
      newConfigFromText create an empty configuration representation from text.
      Parameters:
      text - the model text.
      Returns:
      the constructor of Config.
    • addConfig

      private boolean addConfig(String section, String option, String value)
      addConfig adds a new section->key:value to the configuration.
    • parse

      private void parse(String fname)
    • parseBuffer

      private void parseBuffer(BufferedReader buf) throws IOException
      Throws:
      IOException
    • getBool

      public boolean getBool(String key)
    • getInt

      public int getInt(String key)
    • getFloat

      public float getFloat(String key)
    • getString

      public String getString(String key)
    • getStrings

      public String[] getStrings(String key)
    • set

      public void set(String key, String value)
    • get

      public String get(String key)