Class LocationImpl

  • All Implemented Interfaces:
    javax.xml.stream.Location, org.codehaus.stax2.XMLStreamLocation2

    public class LocationImpl
    extends java.lang.Object
    implements org.codehaus.stax2.XMLStreamLocation2
    Basic implementation of XMLStreamLocation2, used by stream readers and writers.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int _charOffset  
      protected int _col  
      protected java.lang.String _desc  
      protected java.lang.String _publicId  
      protected int _row  
      protected java.lang.String _systemId  
      private static LocationImpl EMPTY  
      • Fields inherited from interface org.codehaus.stax2.XMLStreamLocation2

        NOT_AVAILABLE
    • Constructor Summary

      Constructors 
      Constructor Description
      LocationImpl​(java.lang.String pubId, java.lang.String sysId, int charOffset, int row, int col)  
    • Field Detail

      • _publicId

        protected final java.lang.String _publicId
      • _systemId

        protected final java.lang.String _systemId
      • _charOffset

        protected final int _charOffset
      • _col

        protected final int _col
      • _row

        protected final int _row
      • _desc

        protected transient java.lang.String _desc
    • Constructor Detail

      • LocationImpl

        public LocationImpl​(java.lang.String pubId,
                            java.lang.String sysId,
                            int charOffset,
                            int row,
                            int col)
    • Method Detail

      • fromZeroBased

        public static LocationImpl fromZeroBased​(java.lang.String pubId,
                                                 java.lang.String sysId,
                                                 long rawOffset,
                                                 int rawRow,
                                                 int rawCol)
        Helper method that will adjust given internal zero-based values to 1-based values that should be externally visible.
      • getEmptyLocation

        public static LocationImpl getEmptyLocation()
      • getCharacterOffset

        public int getCharacterOffset()
        Specified by:
        getCharacterOffset in interface javax.xml.stream.Location
      • getColumnNumber

        public int getColumnNumber()
        Specified by:
        getColumnNumber in interface javax.xml.stream.Location
      • getLineNumber

        public int getLineNumber()
        Specified by:
        getLineNumber in interface javax.xml.stream.Location
      • getPublicId

        public java.lang.String getPublicId()
        Specified by:
        getPublicId in interface javax.xml.stream.Location
      • getSystemId

        public java.lang.String getSystemId()
        Specified by:
        getSystemId in interface javax.xml.stream.Location
      • getContext

        public org.codehaus.stax2.XMLStreamLocation2 getContext()
        Specified by:
        getContext in interface org.codehaus.stax2.XMLStreamLocation2
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • appendDesc

        private void appendDesc​(java.lang.StringBuffer sb)