Top Description Fields Constructors Methods
org.apache.xerces.jaxp

pack-priv final Class UnparsedEntityHandler

extends Object
implements XMLDTDFilter, EntityState
Class Inheritance
All Implemented Interfaces
org.apache.xerces.impl.validation.EntityState, org.apache.xerces.xni.parser.XMLDTDFilter, org.apache.xerces.xni.parser.XMLDTDSource, org.apache.xerces.xni.XMLDTDHandler
Imports
java.util.HashMap, org.apache.xerces.impl.validation.EntityState, .ValidationManager, org.apache.xerces.xni.Augmentations, .XMLDTDHandler, .XMLLocator, .XMLResourceIdentifier, .XMLString, .XNIException, org.apache.xerces.xni.parser.XMLDTDFilter, .XMLDTDSource

This filter records which unparsed entities have been declared in the DTD and provides this information to a ValidationManager. Events are forwarded to the registered XMLDTDHandler without modification.

Author
Michael Glavassevich, IBM
Version
$Id: UnparsedEntityHandler.java 520055 2007-03-19 19:25:57Z mrglavas $

Field Summary

Modifier and TypeField and Description
private XMLDTDHandler
private XMLDTDSource
fDTDSource

DTD source and handler.

private HashMap<K, V>
fUnparsedEntities

Map for tracking unparsed entities.

private final ValidationManager
fValidationManager

Validation manager.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
attributeDecl(String
The name of the element that this attribute is associated with.
elementName
,
String
The name of the attribute.
attributeName
,
String
The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION".
type
,
String[]
If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null.
enumeration
,
String
The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null.
defaultType
,
XMLString
The attribute default value, or null if no default value is specified.
defaultValue
,
XMLString
The attribute default value with no normalization performed, or null if no default value is specified.
nonNormalizedDefaultValue
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.attributeDecl.

An attribute declaration.
public void
comment(XMLString
The text in the comment.
text
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.comment.

A comment.
public void
elementDecl(String
The name of the element.
name
,
String
The element content model.
contentModel
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.elementDecl.

An element declaration.
public void
endAttlist(Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.endAttlist.

The end of an attribute list.
public void
endConditional(Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.endConditional.

The end of a conditional section.
public void
endDTD(Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.endDTD.

The end of the DTD.
public void
endExternalSubset(Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.endExternalSubset.

The end of the DTD external subset.
public void
endParameterEntity(String
The name of the parameter entity.
name
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.endParameterEntity.

This method notifies the end of a parameter entity.
public void
externalEntityDecl(String
The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this external entity.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.externalEntityDecl.

An external entity declaration.
public XMLDTDHandler
public XMLDTDSource
public void
ignoredCharacters(XMLString
The ignored text.
text
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.ignoredCharacters.

Characters within an IGNORE conditional section.
public void
internalEntityDecl(String
The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.
name
,
XMLString
The value of the entity.
text
,
XMLString
The non-normalized value of the entity. This value contains the same sequence of characters that was in the internal entity declaration, without any entity references expanded.
nonNormalizedText
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.internalEntityDecl.

An internal entity declaration.
public boolean
isEntityDeclared(String name)

Implements org.apache.xerces.impl.validation.EntityState.isEntityDeclared.

Query method to check if entity with this name was declared.
public boolean
isEntityUnparsed(String name)

Implements org.apache.xerces.impl.validation.EntityState.isEntityUnparsed.

Query method to check if entity is unparsed.
public void
notationDecl(String
The name of the notation.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this notation.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.notationDecl.

A notation declaration
public void
processingInstruction(String
The target.
target
,
XMLString
The data or null if none specified.
data
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.processingInstruction.

A processing instruction.
public void
public void
public void
public void
startAttlist(String
The name of the element that this attribute list is associated with.
elementName
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.startAttlist.

The start of an attribute list.
public void
startConditional(short
The type of the conditional section. This value will either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
type
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.startConditional.

The start of a conditional section.
public void
startDTD(XMLLocator
The document locator, or null if the document location cannot be reported during the parsing of the document DTD. However, it is strongly recommended that a locator be supplied that can at least report the base system identifier of the DTD.
locator
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.startDTD.

The start of the DTD.
public void
startExternalSubset(XMLResourceIdentifier
The resource identifier.
identifier
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.startExternalSubset.

The start of the DTD external subset.
public void
startParameterEntity(String
The name of the parameter entity.
name
,
XMLResourceIdentifier
The resource identifier.
identifier
,
String
The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal parameter entities).
encoding
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.startParameterEntity.

This method notifies of the start of a parameter entity.
public void
textDecl(String
The XML version, or null if not specified.
version
,
String
The IANA encoding name of the entity.
encoding
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.textDecl.

Notifies of the presence of a TextDecl line in an entity.
public void
unparsedEntityDecl(String
The name of the entity.
name
,
XMLResourceIdentifier
An object containing all location information pertinent to this unparsed entity declaration.
identifier
,
String
The name of the notation.
notation
,
Augmentations
Additional information that may include infoset augmentations.
augmentations
)

Implements org.apache.xerces.xni.XMLDTDHandler.unparsedEntityDecl.

An unparsed entity declaration.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fDTDHandlerback to summary
private XMLDTDHandler fDTDHandler
fDTDSourceback to summary
private XMLDTDSource fDTDSource

DTD source and handler.

fUnparsedEntitiesback to summary
private HashMap<K, V> fUnparsedEntities

Map for tracking unparsed entities.

fValidationManagerback to summary
private final ValidationManager fValidationManager

Validation manager.

Constructor Detail

UnparsedEntityHandlerback to summary
pack-priv UnparsedEntityHandler(ValidationManager manager)

Method Detail

attributeDeclback to summary
public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.attributeDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.attributeDecl.

An attribute declaration.

Parameters
elementName:String

The name of the element that this attribute is associated with.

attributeName:String

The name of the attribute.

type:String

The attribute type. This value will be one of the following: "CDATA", "ENTITY", "ENTITIES", "ENUMERATION", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", or "NOTATION".

enumeration:String[]

If the type has the value "ENUMERATION" or "NOTATION", this array holds the allowed attribute values; otherwise, this array is null.

defaultType:String

The attribute default type. This value will be one of the following: "#FIXED", "#IMPLIED", "#REQUIRED", or null.

defaultValue:XMLString

The attribute default value, or null if no default value is specified.

nonNormalizedDefaultValue:XMLString

The attribute default value with no normalization performed, or null if no default value is specified.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
commentback to summary
public void comment(XMLString text, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.comment.

Doc from org.apache.xerces.xni.XMLDTDHandler.comment.

A comment.

Parameters
text:XMLString

The text in the comment.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by application to signal an error.
elementDeclback to summary
public void elementDecl(String name, String contentModel, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.elementDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.elementDecl.

An element declaration.

Parameters
name:String

The name of the element.

contentModel:String

The element content model.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endAttlistback to summary
public void endAttlist(Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.endAttlist.

Doc from org.apache.xerces.xni.XMLDTDHandler.endAttlist.

The end of an attribute list.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endConditionalback to summary
public void endConditional(Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.endConditional.

Doc from org.apache.xerces.xni.XMLDTDHandler.endConditional.

The end of a conditional section.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endDTDback to summary
public void endDTD(Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.endDTD.

Doc from org.apache.xerces.xni.XMLDTDHandler.endDTD.

The end of the DTD.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endExternalSubsetback to summary
public void endExternalSubset(Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.endExternalSubset.

Doc from org.apache.xerces.xni.XMLDTDHandler.endExternalSubset.

The end of the DTD external subset.

Parameters
augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
endParameterEntityback to summary
public void endParameterEntity(String name, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.endParameterEntity.

Doc from org.apache.xerces.xni.XMLDTDHandler.endParameterEntity.

This method notifies the end of a parameter entity. Parameter entity names begin with a '%' character.

Parameters
name:String

The name of the parameter entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
externalEntityDeclback to summary
public void externalEntityDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.externalEntityDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.externalEntityDecl.

An external entity declaration.

Parameters
name:String

The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this external entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
getDTDHandlerback to summary
public XMLDTDHandler getDTDHandler()

Implements org.apache.xerces.xni.parser.XMLDTDSource.getDTDHandler.

Doc from org.apache.xerces.xni.parser.XMLDTDSource.getDTDHandler.

Returns the DTD handler.

getDTDSourceback to summary
public XMLDTDSource getDTDSource()

Implements org.apache.xerces.xni.XMLDTDHandler.getDTDSource.

ignoredCharactersback to summary
public void ignoredCharacters(XMLString text, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.ignoredCharacters.

Doc from org.apache.xerces.xni.XMLDTDHandler.ignoredCharacters.

Characters within an IGNORE conditional section.

Parameters
text:XMLString

The ignored text.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
internalEntityDeclback to summary
public void internalEntityDecl(String name, XMLString text, XMLString nonNormalizedText, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.internalEntityDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.internalEntityDecl.

An internal entity declaration.

Parameters
name:String

The name of the entity. Parameter entity names start with '%', whereas the name of a general entity is just the entity name.

text:XMLString

The value of the entity.

nonNormalizedText:XMLString

The non-normalized value of the entity. This value contains the same sequence of characters that was in the internal entity declaration, without any entity references expanded.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
isEntityDeclaredback to summary
public boolean isEntityDeclared(String name)

Implements org.apache.xerces.impl.validation.EntityState.isEntityDeclared.

Doc from org.apache.xerces.impl.validation.EntityState.isEntityDeclared.

Query method to check if entity with this name was declared.

Returns:boolean

true if name is a declared entity

isEntityUnparsedback to summary
public boolean isEntityUnparsed(String name)

Implements org.apache.xerces.impl.validation.EntityState.isEntityUnparsed.

Doc from org.apache.xerces.impl.validation.EntityState.isEntityUnparsed.

Query method to check if entity is unparsed.

Returns:boolean

true if name is an unparsed entity

notationDeclback to summary
public void notationDecl(String name, XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.notationDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.notationDecl.

A notation declaration

Parameters
name:String

The name of the notation.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this notation.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
processingInstructionback to summary
public void processingInstruction(String target, XMLString data, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.processingInstruction.

Doc from org.apache.xerces.xni.XMLDTDHandler.processingInstruction.

A processing instruction. Processing instructions consist of a target name and, optionally, text data. The data is only meaningful to the application.

Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.

Parameters
target:String

The target.

data:XMLString

The data or null if none specified.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
resetback to summary
public void reset()
setDTDHandlerback to summary
public void setDTDHandler(XMLDTDHandler handler)

Implements org.apache.xerces.xni.parser.XMLDTDSource.setDTDHandler.

Doc from org.apache.xerces.xni.parser.XMLDTDSource.setDTDHandler.

Sets the DTD handler.

setDTDSourceback to summary
public void setDTDSource(XMLDTDSource source)

Implements org.apache.xerces.xni.XMLDTDHandler.setDTDSource.

startAttlistback to summary
public void startAttlist(String elementName, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.startAttlist.

Doc from org.apache.xerces.xni.XMLDTDHandler.startAttlist.

The start of an attribute list.

Parameters
elementName:String

The name of the element that this attribute list is associated with.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startConditionalback to summary
public void startConditional(short type, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.startConditional.

Doc from org.apache.xerces.xni.XMLDTDHandler.startConditional.

The start of a conditional section.

Parameters
type:short

The type of the conditional section. This value will either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startDTDback to summary
public void startDTD(XMLLocator locator, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.startDTD.

Doc from org.apache.xerces.xni.XMLDTDHandler.startDTD.

The start of the DTD.

Parameters
locator:XMLLocator

The document locator, or null if the document location cannot be reported during the parsing of the document DTD. However, it is strongly recommended that a locator be supplied that can at least report the base system identifier of the DTD.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startExternalSubsetback to summary
public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.startExternalSubset.

Doc from org.apache.xerces.xni.XMLDTDHandler.startExternalSubset.

The start of the DTD external subset.

Parameters
identifier:XMLResourceIdentifier

The resource identifier.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
startParameterEntityback to summary
public void startParameterEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.startParameterEntity.

Doc from org.apache.xerces.xni.XMLDTDHandler.startParameterEntity.

This method notifies of the start of a parameter entity. The parameter entity name start with a '%' character.

Parameters
name:String

The name of the parameter entity.

identifier:XMLResourceIdentifier

The resource identifier.

encoding:String

The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal parameter entities).

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
textDeclback to summary
public void textDecl(String version, String encoding, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.textDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.textDecl.

Notifies of the presence of a TextDecl line in an entity. If present, this method will be called immediately following the startEntity call.

Note

This method is only called for external parameter entities referenced in the DTD.

Parameters
version:String

The XML version, or null if not specified.

encoding:String

The IANA encoding name of the entity.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.
unparsedEntityDeclback to summary
public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier, String notation, Augmentations augmentations) throws XNIException

Implements org.apache.xerces.xni.XMLDTDHandler.unparsedEntityDecl.

Doc from org.apache.xerces.xni.XMLDTDHandler.unparsedEntityDecl.

An unparsed entity declaration.

Parameters
name:String

The name of the entity.

identifier:XMLResourceIdentifier

An object containing all location information pertinent to this unparsed entity declaration.

notation:String

The name of the notation.

augmentations:Augmentations

Additional information that may include infoset augmentations.

Exceptions
XNIException:
Thrown by handler to signal an error.