Class NPLDeclarations

java.lang.Object
com.nt.udc.ndk.node.NPLDeclarations
All Implemented Interfaces:
ConfigIfc

public final class NPLDeclarations extends Object implements ConfigIfc
The main purpose of this class is to provide a clean interface to declarations in an NPL file. The user of this class must provide an NPLProgram object, and then will be able to query the NPLProgram object through the ConfigIfc interface. The query should be constructed according to the "block", "sub-block", and "setting" desired. Consider the following 2 examples. Given a ConfigIfc object "cfgifc", and a NPL declaration as follows, Config { ConfigSetting1 "true"; ConfigSetting2 "false"; } Expose for SomeAttrIDList { in.1; in.2; } then a query for the value of "ConfigSetting1" looks like this, Config.ConfigSetting1 which would return a value of: "true" from the following Java method call: String value = cfgifc.getItem("Config.ConfigSetting1"); and a query for the "SomeAttrIDList" declarations looks like this, Expose.SomeAttrIDList which would return a value of: "1,2" from the following Java method call: String value = cfgifc.getItem("Expose.SomeAttrIDList");
  • Constructor Details

    • NPLDeclarations

      public NPLDeclarations(NPLProgramIfc nplProgram)
      Creates an NPLDeclarations object with the given NPL program.
      Parameters:
      nplProgram - NPL Program, containing the NPL declarations
  • Method Details

    • getItem

      public String getItem(String key)
      Returns the desired NPL declaration's value.
      Specified by:
      getItem in interface ConfigIfc
      Parameters:
      key - fully-qualified NPL declaration
      Returns:
      NPL declaration value, or null if not found
    • setItem

      public void setItem(String key, String value)
      This method is not supported in this implementation of ConfigIfc.
      Specified by:
      setItem in interface ConfigIfc
    • main

      public static void main(String[] args)