APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.xml.internal.stream

public abstract Class Entity

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.xml.internal.stream.Entity.InternalEntity, com.sun.xml.internal.stream.Entity.ExternalEntity, com.sun.xml.internal.stream.Entity.ScannedEntity
Imports
java.io.InputStream, .Reader, .IOException, com.sun.xml.internal.stream.util.BufferAllocator, .ThreadLocalBufferAllocator, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier

Entity information.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Entity.ExternalEntity

External entity.

public static class
Entity.InternalEntity

Internal entity.

public static class
Entity.ScannedEntity

Entity state.

Field Summary

Modifier and TypeField and Description
public boolean
public String
name

Entity name.

Constructor Summary

AccessConstructor and Description
public
Entity()

Default constructor.

public
Entity(String name, boolean inExternalSubset)

Constructs an entity.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clears the entity.

public boolean
isEntityDeclInExternalSubset()

Returns true if this entity was declared in the external subset.

public abstract boolean
isExternal()

Returns true if this is an external entity.

public abstract boolean
isUnparsed()

Returns true if this is an unparsed entity.

public void
setValues(Entity entity)

Sets the values of the entity.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inExternalSubsetback to summary
public boolean inExternalSubset
nameback to summary
public String name

Entity name.

Constructor Detail

Entityback to summary
public Entity()

Default constructor.

Entityback to summary
public Entity(String name, boolean inExternalSubset)

Constructs an entity.

Method Detail

clearback to summary
public void clear()

Clears the entity.

isEntityDeclInExternalSubsetback to summary
public boolean isEntityDeclInExternalSubset()

Returns true if this entity was declared in the external subset.

isExternalback to summary
public abstract boolean isExternal()

Returns true if this is an external entity.

isUnparsedback to summary
public abstract boolean isUnparsed()

Returns true if this is an unparsed entity.

setValuesback to summary
public void setValues(Entity entity)

Sets the values of the entity.

com.sun.xml.internal.stream back to summary

public Class Entity.ExternalEntity

extends Entity
Class Inheritance

External entity.
Author
nb131165

Field Summary

Modifier and TypeField and Description
public XMLResourceIdentifier
entityLocation

container for all relevant entity location information.

public String
notation

Notation name for unparsed entity.

Inherited from com.sun.xml.internal.stream.Entity:
inExternalSubsetname

Constructor Summary

AccessConstructor and Description
public
ExternalEntity()

Default constructor.

public
ExternalEntity(String name, XMLResourceIdentifier entityLocation, String notation, boolean inExternalSubset)

Constructs an internal entity.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides com.sun.xml.internal.stream.Entity.clear.

Clears the entity.

public final boolean
isExternal()

Implements abstract com.sun.xml.internal.stream.Entity.isExternal.

Returns true if this is an external entity.

public final boolean
isUnparsed()

Implements abstract com.sun.xml.internal.stream.Entity.isUnparsed.

Returns true if this is an unparsed entity.

public void
setValues(Entity entity)

Overrides com.sun.xml.internal.stream.Entity.setValues.

Sets the values of the entity.

public void
setValues(Entity.ExternalEntity entity)

Sets the values of the entity.

Inherited from com.sun.xml.internal.stream.Entity:
isEntityDeclInExternalSubset

Field Detail

entityLocationback to summary
public XMLResourceIdentifier entityLocation

container for all relevant entity location information.

notationback to summary
public String notation

Notation name for unparsed entity.

Constructor Detail

ExternalEntityback to summary
public ExternalEntity()

Default constructor.

ExternalEntityback to summary
public ExternalEntity(String name, XMLResourceIdentifier entityLocation, String notation, boolean inExternalSubset)

Constructs an internal entity.

Method Detail

clearback to summary
public void clear()

Overrides com.sun.xml.internal.stream.Entity.clear.

Clears the entity.

isExternalback to summary
public final boolean isExternal()

Implements abstract com.sun.xml.internal.stream.Entity.isExternal.

Returns true if this is an external entity.

isUnparsedback to summary
public final boolean isUnparsed()

Implements abstract com.sun.xml.internal.stream.Entity.isUnparsed.

Returns true if this is an unparsed entity.

setValuesback to summary
public void setValues(Entity entity)

Overrides com.sun.xml.internal.stream.Entity.setValues.

Sets the values of the entity.

setValuesback to summary
public void setValues(Entity.ExternalEntity entity)

Sets the values of the entity.

com.sun.xml.internal.stream back to summary

public Class Entity.InternalEntity

extends Entity
Class Inheritance

Internal entity.
Author
nb131165

Field Summary

Modifier and TypeField and Description
public String
text

Text value of entity.

Inherited from com.sun.xml.internal.stream.Entity:
inExternalSubsetname

Constructor Summary

AccessConstructor and Description
public
InternalEntity()

Default constructor.

public
InternalEntity(String name, String text, boolean inExternalSubset)

Constructs an internal entity.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides com.sun.xml.internal.stream.Entity.clear.

Clears the entity.

public final boolean
isExternal()

Implements abstract com.sun.xml.internal.stream.Entity.isExternal.

Returns true if this is an external entity.

public final boolean
isUnparsed()

Implements abstract com.sun.xml.internal.stream.Entity.isUnparsed.

Returns true if this is an unparsed entity.

public void
setValues(Entity entity)

Overrides com.sun.xml.internal.stream.Entity.setValues.

Sets the values of the entity.

public void
setValues(Entity.InternalEntity entity)

Sets the values of the entity.

Inherited from com.sun.xml.internal.stream.Entity:
isEntityDeclInExternalSubset

Field Detail

textback to summary
public String text

Text value of entity.

Constructor Detail

InternalEntityback to summary
public InternalEntity()

Default constructor.

InternalEntityback to summary
public InternalEntity(String name, String text, boolean inExternalSubset)

Constructs an internal entity.

Method Detail

clearback to summary
public void clear()

Overrides com.sun.xml.internal.stream.Entity.clear.

Clears the entity.

isExternalback to summary
public final boolean isExternal()

Implements abstract com.sun.xml.internal.stream.Entity.isExternal.

Returns true if this is an external entity.

isUnparsedback to summary
public final boolean isUnparsed()

Implements abstract com.sun.xml.internal.stream.Entity.isUnparsed.

Returns true if this is an unparsed entity.

setValuesback to summary
public void setValues(Entity entity)

Overrides com.sun.xml.internal.stream.Entity.setValues.

Sets the values of the entity.

setValuesback to summary
public void setValues(Entity.InternalEntity entity)

Sets the values of the entity.

com.sun.xml.internal.stream back to summary

public Class Entity.ScannedEntity

extends Entity
Class Inheritance

Entity state.
Author
nb131165

Field Summary

Modifier and TypeField and Description
public int
baseCharOffset

Base character offset for computing absolute character offset.

public char[]
ch

Character buffer.

public int
columnNumber

Column number.

public int
count

Count of characters present in buffer.

pack-priv boolean
declaredEncoding

Encoding has been set externally for eg: using DOMInput

public static final int
DEFAULT_BUFFER_SIZE

Default buffer size (4096).

public static final int
DEFAULT_INTERNAL_BUFFER_SIZE

Default internal entity buffer size (1024).

public static final int
DEFAULT_XMLDECL_BUFFER_SIZE

Default buffer size before we've finished with the XMLDecl:

public String
encoding

Auto-detected encoding.

public XMLResourceIdentifier
entityLocation

entity location information

pack-priv boolean
externallySpecifiedEncoding

Encoding has been set externally, for example using a SAX InputSource or a DOM LSInput.

public int
fBufferSize

Buffer size.

public int
fLastCount

This variable stores the number of characters read during the load() operation.

public int
fTotalCountTillLastLoad

This variable is used to calculate the current position in the XML stream.

public boolean
public boolean
public int
lineNumber

Line number.

public boolean
literal

True if in a literal.

public boolean
public int
position

Position in character buffer at any point of time.

public Reader
reader

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

public int
startPosition

Start position in character buffer.

public InputStream
stream

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

public String
public boolean
public String
xmlVersion

XML version.

Inherited from com.sun.xml.internal.stream.Entity:
inExternalSubsetname

Constructor Summary

AccessConstructor and Description
public
ScannedEntity(boolean isGE, String name, XMLResourceIdentifier entityLocation, InputStream stream, Reader reader, String encoding, boolean literal, boolean mayReadChunks, boolean isExternal)

Constructs a scanned entity.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Release any resources associated with this entity.

public String

Returns:

current encoding name
getEncodingName
()

returns the name of the current encoding

public InputStream

Returns:

java.io.InputStream InputStream associated with this entity
getEntityInputStream
()

if entity was opened using the stream, return the associated inputstream with this entity

public Reader

Returns:

java.io.Reader Reader associated with this entity
getEntityReader
()

Returns the java.io.Reader associated with this entity.Readers are used to read from the file.

public String

Returns:

String version of the entity, for an internal entity version would be null
getEntityVersion
()

each 'external' parsed entity may have xml/text declaration containing version information

public boolean
public boolean
isEncodingExternallySpecified()

Returns whether the encoding of this entity was externally specified.

public final boolean
isExternal()

Implements abstract com.sun.xml.internal.stream.Entity.isExternal.

Returns true if this is an external entity.

public final boolean
isUnparsed()

Implements abstract com.sun.xml.internal.stream.Entity.isUnparsed.

Returns true if this is an unparsed entity.

public void
setDeclaredEncoding(boolean value)

public void
setEncodingExternallySpecified(boolean value)

Sets whether the encoding of this entity was externally specified.

public void
setEntityVersion(String version)

each 'external' parsed entity may have xml/text declaration containing version information

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Inherited from com.sun.xml.internal.stream.Entity:
clearisEntityDeclInExternalSubsetsetValues

Field Detail

baseCharOffsetback to summary
public int baseCharOffset

Base character offset for computing absolute character offset.

chback to summary
public char[] ch

Character buffer.

columnNumberback to summary
public int columnNumber

Column number.

countback to summary
public int count

Count of characters present in buffer.

declaredEncodingback to summary
pack-priv boolean declaredEncoding

Encoding has been set externally for eg: using DOMInput

DEFAULT_BUFFER_SIZEback to summary
public static final int DEFAULT_BUFFER_SIZE

Default buffer size (4096).

DEFAULT_INTERNAL_BUFFER_SIZEback to summary
public static final int DEFAULT_INTERNAL_BUFFER_SIZE

Default internal entity buffer size (1024).

DEFAULT_XMLDECL_BUFFER_SIZEback to summary
public static final int DEFAULT_XMLDECL_BUFFER_SIZE

Default buffer size before we've finished with the XMLDecl:

encodingback to summary
public String encoding

Auto-detected encoding.

entityLocationback to summary
public XMLResourceIdentifier entityLocation

entity location information

externallySpecifiedEncodingback to summary
pack-priv boolean externallySpecifiedEncoding

Encoding has been set externally, for example using a SAX InputSource or a DOM LSInput.

fBufferSizeback to summary
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?

fLastCountback to summary
public int fLastCount

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

fTotalCountTillLastLoadback to summary
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

isExternalback to summary
public boolean isExternal
isGEback to summary
public boolean isGE
lineNumberback to summary
public int lineNumber

Line number.

literalback to summary
public boolean literal

True if in a literal.

mayReadChunksback to summary
public boolean mayReadChunks
positionback to summary
public int position

Position in character buffer at any point of time.

readerback to summary
public Reader reader

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

startPositionback to summary
public int startPosition

Start position in character buffer.

streamback to summary
public InputStream stream

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

versionback to summary
public String version
xmlDeclChunkReadback to summary
public boolean xmlDeclChunkRead
xmlVersionback to summary
public String xmlVersion

XML version.

Constructor Detail

ScannedEntityback to summary
public ScannedEntity(boolean isGE, String name, XMLResourceIdentifier entityLocation, InputStream stream, Reader reader, String encoding, boolean literal, boolean mayReadChunks, boolean isExternal)

Constructs a scanned entity.

Method Detail

closeback to summary
public void close() throws IOException

Release any resources associated with this entity.

getEncodingNameback to summary
public String getEncodingName()

returns the name of the current encoding

Returns:String

current encoding name

getEntityInputStreamback to summary
public InputStream getEntityInputStream()

if entity was opened using the stream, return the associated inputstream with this entity

Returns:InputStream

java.io.InputStream InputStream associated with this entity

getEntityReaderback to summary
public 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:Reader

java.io.Reader Reader associated with this entity

getEntityVersionback to summary
public String getEntityVersion()

each 'external' parsed entity may have xml/text declaration containing version information

Returns:String

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

isDeclaredEncodingback to summary
public boolean isDeclaredEncoding()
isEncodingExternallySpecifiedback to summary
public boolean isEncodingExternallySpecified()

Returns whether the encoding of this entity was externally specified.

isExternalback to summary
public final boolean isExternal()

Implements abstract com.sun.xml.internal.stream.Entity.isExternal.

Returns true if this is an external entity.

isUnparsedback to summary
public final boolean isUnparsed()

Implements abstract com.sun.xml.internal.stream.Entity.isUnparsed.

Returns true if this is an unparsed entity.

setDeclaredEncodingback to summary
public void setDeclaredEncoding(boolean value)
setEncodingExternallySpecifiedback to summary
public void setEncodingExternallySpecified(boolean value)

Sets whether the encoding of this entity was externally specified.

setEntityVersionback to summary
public void setEntityVersion(String version)

each 'external' parsed entity may have xml/text declaration containing version information

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.