Class TransformException

    • Constructor Summary

      Constructors 
      Constructor Description
      TransformException()
      Constructs an exception with no detail message.
      TransformException​(String message)
      Constructs an exception with the specified detail message.
      TransformException​(String message, Throwable cause)
      Constructs an exception with the specified detail message and cause.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Throwable fillInStackTrace()  
      MathTransform getLastCompletedTransform()
      Returns the last transform that either transformed successfuly all coordinates, or filled the untransformable coordinates with NaN values.
      static <T> T runWithoutStackTraces​(Callable<T> callable)
      This allows executing a callable with TransformException not filling its stack trace while being thrown.
      void setLastCompletedTransform​(MathTransform transform)
      Sets the last transform that either transformed successfuly all coordinates, or filled the untransformable coordinates with NaN values.
      • Methods inherited from class Throwable

        addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TransformException

        public TransformException()
        Constructs an exception with no detail message.
      • TransformException

        public TransformException​(String message)
        Constructs an exception with the specified detail message.
        Parameters:
        message - The detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
      • TransformException

        public TransformException​(String message,
                                  Throwable cause)
        Constructs an exception with the specified detail message and cause.
        Parameters:
        message - The detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
        cause - The cause for this exception. The cause is saved for later retrieval by the Throwable.getCause() method.
    • Method Detail

      • getLastCompletedTransform

        public MathTransform getLastCompletedTransform()
        Returns the last transform that either transformed successfuly all coordinates, or filled the untransformable coordinates with NaN values. This information is useful in the context of concatenated transforms. May be null if unknown.
        Returns:
        The last reliable transform.
        Since:
        GeoAPI 2.2
      • setLastCompletedTransform

        public void setLastCompletedTransform​(MathTransform transform)
        Sets the last transform that either transformed successfuly all coordinates, or filled the untransformable coordinates with NaN values.
        Parameters:
        transform - The last reliable transform.
        Since:
        GeoAPI 2.2
      • fillInStackTrace

        public Throwable fillInStackTrace()
        Overrides:
        fillInStackTrace in class Throwable
      • runWithoutStackTraces

        public static <T> T runWithoutStackTraces​(Callable<T> callable)
        This allows executing a callable with TransformException not filling its stack trace while being thrown. This is useful when the exception is expected to be caught and handled without the need to fill the stack trace (which can be quite expensive, if done many times in a tight loop).

        An eventual exception thrown by the callable will be wrapped in a RuntimeException and rethrown.