Class QuantityConversionException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    QuantityConversionException.Persisted, QuantityConversionException.Quantity

    public abstract class QuantityConversionException
    extends java.lang.Exception
    Exception denoting problem converting between representations of physical quantities ("numbers with units"). Has a problem enum designating the kind of problem and is able to return a prototype value that could be used to circumvent that problem. Has different representations for persisting/logging (locale independent) and presenting to a human (using the default locale). Be sure to use getLocalizedMessage() for error dialogs.
    See Also:
    Serialized Form
    • Method Detail

      • conflictingConstraints

        public static QuantityConversionException conflictingConstraints​(java.lang.Object value,
                                                                         java.lang.String key)
      • getBadString

        public java.lang.String getBadString()
        The string where the problem was encountered, so that it might be highlighted. May be the entire string on which parsing was attempted. May be null if this problem was detected after parsing, such as out of range.
        Returns:
        a substring of the parser input, or null
      • getPersistablePrototype

        public abstract java.lang.String getPersistablePrototype()
        Prototype value suitable to be persisted or logged.
        Returns:
        a non-localized (English) value that will prevent this particular problem when parsed.
      • getInteractivePrototype

        public abstract java.lang.String getInteractivePrototype()
        Prototype value suitable to be presented to a human. Must not be persisted or logged.
        Returns:
        a localized value that will prevent this particular problem when parsed using interactive parsing.
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage()
        Overrides:
        getLocalizedMessage in class java.lang.Throwable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable