FileDocCategorySizeDatePackage
UnparsedEntityHandler.javaAPI DocApache Xerces 3.0.18804Fri Sep 14 20:33:56 BST 2007org.apache.xerces.jaxp

UnparsedEntityHandler

public final class UnparsedEntityHandler extends Object implements org.apache.xerces.xni.parser.XMLDTDFilter, org.apache.xerces.impl.validation.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 520055 2007-03-19 19:25:57Z mrglavas $

Fields Summary
private org.apache.xerces.xni.parser.XMLDTDSource
fDTDSource
DTD source and handler.
private org.apache.xerces.xni.XMLDTDHandler
fDTDHandler
private final org.apache.xerces.impl.validation.ValidationManager
fValidationManager
Validation manager.
private HashMap
fUnparsedEntities
Map for tracking unparsed entities.
Constructors Summary
UnparsedEntityHandler(org.apache.xerces.impl.validation.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, org.apache.xerces.xni.XMLString defaultValue, org.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.apache.xerces.xni.Augmentations augmentations)

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

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

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

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

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

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

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

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

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

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

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

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

    
public voidinternalEntityDecl(java.lang.String name, org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.XMLString nonNormalizedText, org.apache.xerces.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, org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augmentations)

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

        if (fDTDHandler != null) {
            fDTDHandler.processingInstruction(target, data, augmentations);
        }
    
public voidreset()

        if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) {
            // should only clear this if the last document contained unparsed entities
            fUnparsedEntities.clear();
        }
    
public voidsetDTDHandler(org.apache.xerces.xni.XMLDTDHandler handler)

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

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

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

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

        fValidationManager.setEntityState(this);
        if (fDTDHandler != null) {
            fDTDHandler.startDTD(locator, augmentations);
        }
    
public voidstartExternalSubset(org.apache.xerces.xni.XMLResourceIdentifier identifier, org.apache.xerces.xni.Augmentations augmentations)

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

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

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

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