Class StaxUtil


  • public class StaxUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      StaxUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.String sanitizeXmlTypeName​(java.lang.String name)
      Since XML names can not contain all characters JSON names can, we may need to replace characters.
      static <T> T throwAsGenerationException​(javax.xml.stream.XMLStreamException e, com.fasterxml.jackson.core.JsonGenerator g)  
      static <T> T throwAsParseException​(javax.xml.stream.XMLStreamException e, com.fasterxml.jackson.core.JsonParser p)  
      static <T> T throwXmlAsIOException​(javax.xml.stream.XMLStreamException e)
      Deprecated.
      Since 2.9
      • Methods inherited from class java.lang.Object

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

      • StaxUtil

        public StaxUtil()
    • Method Detail

      • throwXmlAsIOException

        @Deprecated
        public static <T> T throwXmlAsIOException​(javax.xml.stream.XMLStreamException e)
                                           throws java.io.IOException
        Deprecated.
        Since 2.9
        Adapter method used when only IOExceptions are declared to be thrown, but a XMLStreamException was caught.

        Note: dummy type variable is used for convenience, to allow caller to claim that this method returns result of any necessary type.

        Throws:
        java.io.IOException
      • throwAsParseException

        public static <T> T throwAsParseException​(javax.xml.stream.XMLStreamException e,
                                                  com.fasterxml.jackson.core.JsonParser p)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
        Since:
        2.9
      • throwAsGenerationException

        public static <T> T throwAsGenerationException​(javax.xml.stream.XMLStreamException e,
                                                       com.fasterxml.jackson.core.JsonGenerator g)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
        Since:
        2.9
      • sanitizeXmlTypeName

        public static java.lang.String sanitizeXmlTypeName​(java.lang.String name)
        Since XML names can not contain all characters JSON names can, we may need to replace characters. Let's start with trivial replacement of ASCII characters that can not be included.