FileDocCategorySizeDatePackage
UnparsedEntityHandler.javaAPI DocJava SE 6 API8483Tue Jun 10 00:22:48 BST 2008com.sun.org.apache.xerces.internal.jaxp

UnparsedEntityHandler

public final class UnparsedEntityHandler extends Object implements XMLDTDFilter, EntityState

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,v 1.1.4.1 2005/09/08 05:50:09 sunithareddy Exp $

Fields Summary
private XMLDTDSource
fDTDSource
DTD source and handler.
private XMLDTDHandler
fDTDHandler
private final ValidationManager
fValidationManager
Validation manager.
private HashMap
fUnparsedEntities
Map for tracking unparsed entities.
Constructors Summary
UnparsedEntityHandler(ValidationManager manager)

    
      
        fValidationManager = manager;
    
Methods Summary
public voidattributeDecl(java.lang.String elementName, java.lang.String attributeName, java.lang.String type, java.lang.String[] enumeration, java.lang.String defaultType, com.sun.org.apache.xerces.internal.xni.XMLString defaultValue, com.sun.org.apache.xerces.internal.xni.XMLString nonNormalizedDefaultValue, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.attributeDecl(elementName, attributeName,
                    type, enumeration, defaultType,
                    defaultValue, nonNormalizedDefaultValue,
                    augmentations);
        }
    
public voidcomment(com.sun.org.apache.xerces.internal.xni.XMLString text, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.comment(text, augmentations);
        }
    
public voidelementDecl(java.lang.String name, java.lang.String contentModel, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.elementDecl(name, contentModel, augmentations);
        }
    
public voidendAttlist(com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.endAttlist(augmentations);
        }
    
public voidendConditional(com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.endConditional(augmentations);
        }
    
public voidendDTD(com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.endDTD(augmentations);
        }
    
public voidendExternalSubset(com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.endExternalSubset(augmentations);
        }
    
public voidendParameterEntity(java.lang.String name, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.endParameterEntity(name, augmentations);
        }
    
public voidexternalEntityDecl(java.lang.String name, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier identifier, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.externalEntityDecl(name, identifier, augmentations);
        }
    
public com.sun.org.apache.xerces.internal.xni.XMLDTDHandlergetDTDHandler()

        return fDTDHandler;
    
public com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSourcegetDTDSource()

        return fDTDSource;
    
public voidignoredCharacters(com.sun.org.apache.xerces.internal.xni.XMLString text, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.ignoredCharacters(text, augmentations);
        }

    
public voidinternalEntityDecl(java.lang.String name, com.sun.org.apache.xerces.internal.xni.XMLString text, com.sun.org.apache.xerces.internal.xni.XMLString nonNormalizedText, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.internalEntityDecl(name, text,
                    nonNormalizedText, augmentations);
        }
    
public booleanisEntityDeclared(java.lang.String name)

        return false;
    
public booleanisEntityUnparsed(java.lang.String name)

        if (fUnparsedEntities != null) {
            return fUnparsedEntities.containsKey(name);
        }
        return false;
    
public voidnotationDecl(java.lang.String name, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier identifier, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.notationDecl(name, identifier, augmentations);
        }
    
public voidprocessingInstruction(java.lang.String target, com.sun.org.apache.xerces.internal.xni.XMLString data, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.processingInstruction(target, data, augmentations);
        }
    
public voidsetDTDHandler(com.sun.org.apache.xerces.internal.xni.XMLDTDHandler handler)

        fDTDHandler = handler;
    
public voidsetDTDSource(com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource source)

        fDTDSource = source;
    
public voidstartAttlist(java.lang.String elementName, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.startAttlist(elementName, augmentations);
        }
    
public voidstartConditional(short type, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.startConditional(type, augmentations);
        }
    
public voidstartDTD(com.sun.org.apache.xerces.internal.xni.XMLLocator locator, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        fValidationManager.setEntityState(this);
        if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) {
            // should only clear this if the last document contained unparsed entities
            fUnparsedEntities.clear();
        }
        if (fDTDHandler != null) {
            fDTDHandler.startDTD(locator, augmentations);
        }
    
public voidstartExternalSubset(com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier identifier, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.startExternalSubset(identifier, augmentations);
        }
    
public voidstartParameterEntity(java.lang.String name, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier identifier, java.lang.String encoding, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.startParameterEntity(name, identifier, encoding, augmentations);
        }
    
public voidtextDecl(java.lang.String version, java.lang.String encoding, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fDTDHandler != null) {
            fDTDHandler.textDecl(version, encoding, augmentations);
        }
    
public voidunparsedEntityDecl(java.lang.String name, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier identifier, java.lang.String notation, com.sun.org.apache.xerces.internal.xni.Augmentations augmentations)

        if (fUnparsedEntities == null) {
            fUnparsedEntities = new HashMap();
        }
        fUnparsedEntities.put(name, name);
        if (fDTDHandler != null) {
            fDTDHandler.unparsedEntityDecl(name, identifier, notation, augmentations);
        }