Class StringContext

  • All Implemented Interfaces:
    TypeContext<java.lang.String>

    public final class StringContext
    extends FormatContext<java.lang.String>
    StringContext
    • Field Detail

      • DEFAULT_FORMAT

        private static final java.text.Format DEFAULT_FORMAT
      • myLength

        private final int myLength
    • Constructor Detail

      • StringContext

        public StringContext()
      • StringContext

        public StringContext​(java.text.Format format,
                             int length)
      • StringContext

        public StringContext​(int length)
      • StringContext

        private StringContext​(java.text.Format format)
    • Method Detail

      • enforce

        public java.lang.String enforce​(java.lang.String object)
        Description copied from interface: TypeContext
        Will force the object to conform to the context's specification. The default implementation formats a String and then parses that back to an object (of the original type).
      • configureFormat

        protected void configureFormat​(java.text.Format format,
                                       java.lang.Object object)
        Specified by:
        configureFormat in class FormatContext<java.lang.String>
      • handleFormatException

        protected java.lang.String handleFormatException​(java.text.Format format,
                                                         java.lang.Object object)
        Specified by:
        handleFormatException in class FormatContext<java.lang.String>
      • handleParseException

        protected java.lang.String handleParseException​(java.text.Format format,
                                                        java.lang.String string)
        Specified by:
        handleParseException in class FormatContext<java.lang.String>