com.sun.xml.stream
Class Entity.ScannedEntity

java.lang.Object
  extended by com.sun.xml.stream.Entity
      extended by com.sun.xml.stream.Entity.ScannedEntity
Enclosing class:
Entity

public static class Entity.ScannedEntity
extends Entity

Entity state.

Author:
nb131165

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.stream.Entity
Entity.ExternalEntity, Entity.InternalEntity, Entity.ScannedEntity
 
Field Summary
 char[] ch
          Character buffer.
 int columnNumber
           
 int count
          Count of characters present in buffer.
static int DEFAULT_BUFFER_SIZE
          Default buffer size (4096).
static int DEFAULT_INTERNAL_BUFFER_SIZE
          Default internal entity buffer size (1024).
static int DEFAULT_XMLDECL_BUFFER_SIZE
          Default buffer size before we've finished with the XMLDecl:
 java.lang.String encoding
          Auto-detected encoding.
 org.apache.xerces.xni.XMLResourceIdentifier entityLocation
          entity location information
 int fBufferSize
          Buffer size.
 int fLastCount
          This variable stores the number of characters read during the load() operation.
 int fTotalCountTillLastLoad
          This variable is used to calculate the current position in the XML stream.
 boolean isExternal
           
 int lineNumber
           
 boolean literal
          True if in a literal.
 boolean mayReadChunks
           
 int position
          Position in character buffer at any point of time.
 java.io.Reader reader
          XXX let these field remain public right now, though we have defined methods for them.
 java.io.InputStream stream
          XXX let these field remain public right now, though we have defined methods for them.
 java.lang.String version
           
 
Fields inherited from class com.sun.xml.stream.Entity
inExternalSubset, name
 
Constructor Summary
Entity.ScannedEntity(java.lang.String name, org.apache.xerces.xni.XMLResourceIdentifier entityLocation, java.io.InputStream stream, java.io.Reader reader, java.lang.String encoding, boolean literal, boolean mayReadChunks, boolean isExternal)
          Constructs a scanned entity.
 
Method Summary
 void close()
          Release any resources associated with this entity.
 java.lang.String getEncodingName()
          returns the name of the current encoding
 java.io.InputStream getEntityInputStream()
          if entity was opened using the stream, return the associated inputstream with this entity
 java.io.Reader getEntityReader()
          Returns the java.io.Reader associated with this entity.Readers are used to read from the file.
 java.lang.String getEntityVersion()
          each 'external' parsed entity may have xml/text declaration containing version information
 boolean isExternal()
          Returns true if this is an external entity.
 boolean isUnparsed()
          Returns true if this is an unparsed entity.
 void setEntityVersion(java.lang.String version)
          each 'external' parsed entity may have xml/text declaration containing version information
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class com.sun.xml.stream.Entity
clear, isEntityDeclInExternalSubset, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
Default buffer size (4096).

See Also:
Constant Field Values

fBufferSize

public int fBufferSize
Buffer size. We get this value from a property. The default size is used if the input buffer size property is not specified. REVISIT: do we need a property for internal entity buffer size?


DEFAULT_XMLDECL_BUFFER_SIZE

public static final int DEFAULT_XMLDECL_BUFFER_SIZE
Default buffer size before we've finished with the XMLDecl:

See Also:
Constant Field Values

DEFAULT_INTERNAL_BUFFER_SIZE

public static final int DEFAULT_INTERNAL_BUFFER_SIZE
Default internal entity buffer size (1024).

See Also:
Constant Field Values

stream

public java.io.InputStream stream
XXX let these field remain public right now, though we have defined methods for them. Input stream.


reader

public java.io.Reader reader
XXX let these field remain public right now, though we have defined methods for them. Reader.


entityLocation

public org.apache.xerces.xni.XMLResourceIdentifier entityLocation
entity location information


encoding

public java.lang.String encoding
Auto-detected encoding.


literal

public boolean literal
True if in a literal.


isExternal

public boolean isExternal

version

public java.lang.String version

ch

public char[] ch
Character buffer.


position

public int position
Position in character buffer at any point of time.


count

public int count
Count of characters present in buffer.


lineNumber

public int lineNumber

columnNumber

public int columnNumber

fTotalCountTillLastLoad

public int fTotalCountTillLastLoad
This variable is used to calculate the current position in the XML stream. Note that fCurrentEntity.position maintains the position relative to the buffer. At any point of time absolute position in the XML stream can be calculated as fTotalCountTillLastLoad + fCurrentEntity.position


fLastCount

public int fLastCount
This variable stores the number of characters read during the load() operation. It is used to calculate fTotalCountTillLastLoad


mayReadChunks

public boolean mayReadChunks
Constructor Detail

Entity.ScannedEntity

public Entity.ScannedEntity(java.lang.String name,
                            org.apache.xerces.xni.XMLResourceIdentifier entityLocation,
                            java.io.InputStream stream,
                            java.io.Reader reader,
                            java.lang.String encoding,
                            boolean literal,
                            boolean mayReadChunks,
                            boolean isExternal)
Constructs a scanned entity.

Method Detail

getEncodingName

public java.lang.String getEncodingName()
returns the name of the current encoding

Returns:
current encoding name

getEntityVersion

public java.lang.String getEntityVersion()
each 'external' parsed entity may have xml/text declaration containing version information

Returns:
String version of the enity, for an internal entity version would be null

setEntityVersion

public void setEntityVersion(java.lang.String version)
each 'external' parsed entity may have xml/text declaration containing version information

Parameters:
String - version of the external parsed entity

getEntityReader

public java.io.Reader getEntityReader()
Returns the java.io.Reader associated with this entity.Readers are used to read from the file. Readers wrap any particular InputStream that was used to open the entity.

Returns:
java.io.Reader Reader associated with this entity

getEntityInputStream

public java.io.InputStream getEntityInputStream()
if entity was opened using the stream, return the associated inputstream with this entity

Returns:
java.io.InputStream InputStream associated with this entity

close

public void close()
           throws java.io.IOException
Release any resources associated with this entity.

Throws:
java.io.IOException

isExternal

public final boolean isExternal()
Returns true if this is an external entity.

Specified by:
isExternal in class Entity

isUnparsed

public final boolean isUnparsed()
Returns true if this is an unparsed entity.

Specified by:
isUnparsed in class Entity

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object


Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.