Enum Class LineSeparator

java.lang.Object
java.lang.Enum<LineSeparator>
nablarch.test.core.file.LineSeparator
All Implemented Interfaces:
Serializable, Comparable<LineSeparator>, Constable

public enum LineSeparator extends Enum<LineSeparator>
改行コードを列挙するクラス。
  • Enum Constant Details

  • Method Details

    • values

      public static LineSeparator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LineSeparator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<LineSeparator>
      Returns:
      そのインスタンスが表す改行コード
    • evaluate

      public static String evaluate(String expression)
      改行コードの表現を評価する。
      本列挙クラスの要素名である場合、すなわち LineSeparator#valueOf(String)が値を返却する場合は その値が持つ改行コードを返却する。それ以外の場合は、与えられた表現がそれ自身改行コードとみなして、 その引数をそのまま返却する。

      (例) LineSeparator.evaluate("CRLF"); // --> "\r\n"が返却される。 LineSeparator.evaluate(":"); // --> ":"が返却される。

      Parameters:
      expression - 改行コード表現
      Returns:
      評価された値