Class MessageUtil


  • class MessageUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static XmlException createEntryBestEffort​(OoxmlFacade ooxml, XmlPositioner positioner, XmlSeverity severity, java.lang.Throwable exception)
      Creates an entry for the given exception.
      (package private) static java.lang.String enquote​(java.lang.String it)  
      private static java.lang.String extractKind​(java.lang.Throwable exception)  
      (package private) static XmlPosition extractPosition​(java.lang.Throwable throwable)
      Tries to retrieve the position where the given exception occurred.
      private static java.lang.String extractSimpleMessage​(java.lang.Throwable exception)  
      static java.lang.String headerOnly​(NiceXmlMessageSpec spec, java.lang.String message, boolean singleLine)  
      (package private) static java.lang.String readFully​(java.io.Reader reader)  
      • Methods inherited from class java.lang.Object

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

      • KIND_SCHEMA_VALIDATION

        private static final java.lang.String KIND_SCHEMA_VALIDATION
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageUtil

        MessageUtil()
    • Method Detail

      • enquote

        static java.lang.String enquote​(java.lang.String it)
      • extractPosition

        static XmlPosition extractPosition​(java.lang.Throwable throwable)
        Tries to retrieve the position where the given exception occurred. This is a best-effort approach, trying several known exception types (eg SAXParseException, TransformerException).
      • createEntryBestEffort

        static XmlException createEntryBestEffort​(OoxmlFacade ooxml,
                                                  XmlPositioner positioner,
                                                  XmlSeverity severity,
                                                  java.lang.Throwable exception)
        Creates an entry for the given exception. Tries to recover the position from the exception.
        Parameters:
        exception - Exception
        Returns:
        An exception, possibly enriched with context information
      • extractKind

        private static java.lang.String extractKind​(java.lang.Throwable exception)
      • extractSimpleMessage

        private static java.lang.String extractSimpleMessage​(java.lang.Throwable exception)
      • readFully

        static java.lang.String readFully​(java.io.Reader reader)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • headerOnly

        public static java.lang.String headerOnly​(NiceXmlMessageSpec spec,
                                                  java.lang.String message,
                                                  boolean singleLine)