Class PropertyFileUtil.Arg

java.lang.Object
jp.ecuacion.lib.core.util.PropertyFileUtil.Arg
Enclosing class:
PropertyFileUtil

public static class PropertyFileUtil.Arg extends Object
Is considered as an argument string, but you can set message ID replaced to message string with PropertyFileUtil.getMessage(String).

In UI application like web, usually "throw new AppException" part does not care about the locale. It's taken care at ExceptionHandler.
So you also don't want obtain an appropriate locale when you put message obtained from PropertyFileUtil.getMsg(...) into the argument of AppException.

That's why this is needed.

Usually message argument is like {0}, {1}, ... but BeanValidation message argument is like {value}, {min}, ... so it supports both of them. When you want to use the former format you need to set value to messageArgs, the latter messageArgMap.

  • Method Details

    • string

      public static PropertyFileUtil.Arg string(String argString)
      Constructs a new instance of normal string.
      Parameters:
      argString - normal string
      Returns:
      Arg
    • strings

      public static PropertyFileUtil.Arg[] strings(String... argStrings)
      Constructs an array of new instances of normal string.
      Parameters:
      argStrings - an array of normal string
      Returns:
      Arg[]
    • message

      public static PropertyFileUtil.Arg message(String messageId)
      Constructs a new instance of messageId and messageArgs.
      Parameters:
      messageId - messageId
      Returns:
      Arg
    • message

      public static PropertyFileUtil.Arg message(String messageId, String... stringArgs)
      Constructs a new instance of messageId and messageArgs.
      Parameters:
      messageId - messageId
      stringArgs - stringArgs
      Returns:
      Arg
    • message

      public static PropertyFileUtil.Arg message(String messageId, PropertyFileUtil.Arg... messageArgs)
      Constructs a new instance of messageId and messageArgs.
      Parameters:
      messageId - messageId
      messageArgs - messageArgs
      Returns:
      Arg
    • getArgString

      public String getArgString()
    • isMessageId

      public boolean isMessageId()
    • getMessageArgs

      public PropertyFileUtil.Arg[] getMessageArgs()