JAXB
v0.21

javax.xml.marshal
Class StreamScanPosition

java.lang.Object
  |
  +--javax.xml.marshal.ScanPosition
        |
        +--javax.xml.marshal.StreamScanPosition

public final class StreamScanPosition
extends ScanPosition

An object describing a scanner's position in an input stream.

A stream-scan position contains a line number and an optional column number and source URI.

Both line and column numbers start at one. Lines are terminated by a LINE FEED character ('\u000A'), a CARRIAGE RETURN character ('\u000D'), or a CARRIAGE-RETURN character followed immediately by a LINE FEED character. Columns are counted in terms of sixteen-bit Unicode characters, in UTF-16, rather than bytes in any particular encoding.

Version:
1.4, 01/05/31

Constructor Summary
StreamScanPosition(int line)
          Constructs a new scan position with the given line, column, and source URI.
StreamScanPosition(int line, int col)
          Constructs a new scan position with the given line, column, and source URI.
StreamScanPosition(int line, int col, String uri)
          Constructs a new scan position with the given line, column, and source URI.
 
Method Summary
 int column()
          Returns this position's column number.
 int line()
          Returns this position's line number.
 String toString()
          Returns a string describing this position.
 String uriString()
          Returns this position's source URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamScanPosition

public StreamScanPosition(int line)
Constructs a new scan position with the given line, column, and source URI.

Parameters:
line - The line number, a positive integer

StreamScanPosition

public StreamScanPosition(int line,
                          int col)
Constructs a new scan position with the given line, column, and source URI.

Parameters:
line - The line number, a positive integer
col - The column number, or zero if the column number is not known

StreamScanPosition

public StreamScanPosition(int line,
                          int col,
                          String uri)
Constructs a new scan position with the given line, column, and source URI.

Parameters:
line - The line number, a positive integer
col - The column number, or zero if the column number is not known
uri - The source URI string, or null if the source URI is not known
Method Detail

column

public int column()
Returns this position's column number.

Returns:
This position's column number, a positive integer, or zero if it is not known

line

public int line()
Returns this position's line number.

Returns:
This position's line number, a positive integer

toString

public String toString()
Returns a string describing this position.

The returned string has the format uri: line i, column j, where uri is the URI, i is the line number, and j is the column number. If the URI is not known then the URI and the colon and space characters that follow it are omitted; if the column number is not known then the column number and the comma and space characters that precede it are omitted.

Overrides:
toString in class Object
Returns:
A string describing this position

uriString

public String uriString()
Returns this position's source URI.

Returns:
This position's source URI, or null if it is not known

JAXB
v0.21


Comments to: jaxb-comments@java.sun.com
More information at: http://java.sun.com/xml/jaxb

Copyright © 2001 by Sun Microsystems, Inc., 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.