You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ErrorMessage.java 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import java.io.Serializable;
  18. import com.vaadin.shared.ui.ErrorLevel;
  19. /**
  20. * Interface for rendering error messages to terminal. All the visible errors
  21. * shown to user must implement this interface.
  22. *
  23. * @author Vaadin Ltd.
  24. * @since 3.0
  25. */
  26. public interface ErrorMessage extends Serializable {
  27. /**
  28. * @deprecated As of 7.0, use {@link ErrorLevel#SYSTEM} instead    
  29. */
  30. @Deprecated
  31. public static final ErrorLevel SYSTEMERROR = ErrorLevel.SYSTEM;
  32. /**
  33. * @deprecated As of 7.0, use {@link ErrorLevel#CRITICAL} instead    
  34. */
  35. @Deprecated
  36. public static final ErrorLevel CRITICAL = ErrorLevel.CRITICAL;
  37. /**
  38. * @deprecated As of 7.0, use {@link ErrorLevel#ERROR} instead    
  39. */
  40. @Deprecated
  41. public static final ErrorLevel ERROR = ErrorLevel.ERROR;
  42. /**
  43. * @deprecated As of 7.0, use {@link ErrorLevel#WARNING} instead    
  44. */
  45. @Deprecated
  46. public static final ErrorLevel WARNING = ErrorLevel.WARNING;
  47. /**
  48. * @deprecated As of 7.0, use {@link ErrorLevel#INFO} instead    
  49. */
  50. @Deprecated
  51. public static final ErrorLevel INFORMATION = ErrorLevel.INFO;
  52. /**
  53. * Gets the errors level.
  54. *
  55. * @return the level of error as an integer.
  56. */
  57. public ErrorLevel getErrorLevel();
  58. /**
  59. * Returns the HTML formatted message to show in as the error message on the
  60. * client.
  61. *
  62. * This method should perform any necessary escaping to avoid XSS attacks.
  63. *
  64. * TODO this API may still change to use a separate data transfer object
  65. *
  66. * @return HTML formatted string for the error message
  67. * @since 7.0
  68. */
  69. public String getFormattedHtmlMessage();
  70. }