Class RatesCurveGroupDefinitionCsvLoader


  • public final class RatesCurveGroupDefinitionCsvLoader
    extends Object
    Loads a set of curve group definitions into memory by reading from CSV resources.

    The CSV file has the following header row:
    Group Name, Curve Type, Reference, Curve Name.

    • The 'Group Name' column is the name of the group of curves.
    • The 'Curve Type' column is the type of the curve, "forward" or "discount".
    • The 'Reference' column is the reference the curve is used for, such as "USD" or "USD-LIBOR-3M".
    • The 'Curve Name' column is the name of the curve.

    CSV files sometimes contain a Unicode Byte Order Mark. Callers are responsible for handling this, such as by using UnicodeBom.

    See Also:
    RatesCurveGroupDefinition
    • Method Detail

      • loadCurveGroupDefinitions

        public static List<RatesCurveGroupDefinition> loadCurveGroupDefinitions​(ResourceLocator groupsResource)
        Loads the curve groups definition CSV file.

        The list of NodalCurveDefinition will be empty in the resulting definition.

        Parameters:
        groupsResource - the curve groups CSV resource
        Returns:
        the list of definitions
      • parseCurveGroupDefinitions

        public static List<RatesCurveGroupDefinition> parseCurveGroupDefinitions​(CharSource charSource)
        Parses the curve groups definition CSV file.

        The list of NodalCurveDefinition will be empty in the resulting definition.

        Parameters:
        charSource - the curve groups CSV character source
        Returns:
        the list of definitions
      • writeCurveGroupDefinition

        public static void writeCurveGroupDefinition​(File file,
                                                     RatesCurveGroupDefinition... groups)
        Writes the curve groups definition in a CSV format to a file.
        Parameters:
        file - the destination for the CSV, such as a file
        groups - the curve groups
      • writeCurveGroupDefinition

        public static void writeCurveGroupDefinition​(Appendable underlying,
                                                     RatesCurveGroupDefinition... groups)
        Writes the curve groups definition in a CSV format to an appendable.
        Parameters:
        underlying - the underlying appendable destination
        groups - the curve groups
      • writeCurveGroup

        public static void writeCurveGroup​(File file,
                                           RatesCurveGroup... groups)
        Writes the curve group in a CSV format to a file.
        Parameters:
        file - the file
        groups - the curve groups
      • writeCurveGroup

        public static void writeCurveGroup​(Appendable underlying,
                                           RatesCurveGroup... groups)
        Writes the curve group in a CSV format to an appendable.
        Parameters:
        underlying - the underlying appendable destination
        groups - the curve groups