Class WasmException

  • All Implemented Interfaces:
    java.io.Serializable

    public class WasmException
    extends java.lang.RuntimeException
    If there any error occur on converting a class file to a WebAssembly module.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String className  
      private int lineNumber  
      private java.lang.String methodName  
      private java.lang.String sourceFile  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        WasmException​(java.lang.String message, int lineNumber)
      Create a new instance.
        WasmException​(java.lang.String message, java.lang.String sourceFile, java.lang.String className, int lineNumber)
      Create a new instance.
      private WasmException​(java.lang.String message, java.lang.Throwable cause)
      Create a new instance with a cause.
      private WasmException​(java.lang.Throwable cause)
      Create a new instance with a cause.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static WasmException create​(java.lang.String message, java.lang.Throwable cause)
      Create a wrapped exception needed with an additional message.
      static WasmException create​(java.lang.Throwable cause)
      Create a wrapped exception needed.
      static WasmException create​(java.lang.Throwable cause, int lineNumber)
      Create a wrapped exception needed.
      static WasmException create​(java.lang.Throwable cause, java.lang.String sourceFile, java.lang.String className, java.lang.String methodName, int lineNumber)
      Create a wrapped exception needed.
      int getLineNumber()
      Get the line number in Java code on which the error occurred.
      java.lang.String getMessage()
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

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

      • lineNumber

        private int lineNumber
      • sourceFile

        private java.lang.String sourceFile
      • className

        private java.lang.String className
      • methodName

        private java.lang.String methodName
    • Constructor Detail

      • WasmException

        public WasmException​(java.lang.String message,
                             int lineNumber)
        Create a new instance.
        Parameters:
        message - the error message
        lineNumber - the line number in Java Code
      • WasmException

        public WasmException​(java.lang.String message,
                             java.lang.String sourceFile,
                             java.lang.String className,
                             int lineNumber)
        Create a new instance.
        Parameters:
        message - the error message
        sourceFile - the sourceFile of the Java code
        className - the class name of the Java code
        lineNumber - the line number in Java Code
      • WasmException

        private WasmException​(java.lang.Throwable cause)
        Create a new instance with a cause.
        Parameters:
        cause - the cause
      • WasmException

        private WasmException​(java.lang.String message,
                              java.lang.Throwable cause)
        Create a new instance with a cause.
        Parameters:
        message - the detail message
        cause - the cause
    • Method Detail

      • create

        public static WasmException create​(java.lang.Throwable cause,
                                           int lineNumber)
        Create a wrapped exception needed.
        Parameters:
        cause - the wrapped cause
        lineNumber - the line number in Java Code
        Returns:
        a new instance
      • create

        public static WasmException create​(java.lang.Throwable cause,
                                           java.lang.String sourceFile,
                                           java.lang.String className,
                                           java.lang.String methodName,
                                           int lineNumber)
        Create a wrapped exception needed.
        Parameters:
        cause - the wrapped cause
        sourceFile - the source file of the Java code
        className - the class name of the Java code
        methodName - the method of the Java code
        lineNumber - the line number in Java Code
        Returns:
        a new instance
      • create

        public static WasmException create​(java.lang.Throwable cause)
        Create a wrapped exception needed.
        Parameters:
        cause - the wrapped cause
        Returns:
        a new instance
      • create

        public static WasmException create​(java.lang.String message,
                                           java.lang.Throwable cause)
        Create a wrapped exception needed with an additional message.
        Parameters:
        cause - the wrapped cause
        message - the message
        Returns:
        a new instance
      • getLineNumber

        public int getLineNumber()
        Get the line number in Java code on which the error occurred.
        Returns:
        the line number or -1
      • getMessage

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