xincludehandler.java

来自「JAVA 所有包」· Java 代码 · 共 1,684 行 · 第 1/5 页

JAVA
1,684
字号
            --fResultDepth;            if (fDocumentHandler != null) {                fDocumentHandler.endElement(element, augs);            }        }        // reset the out of scope stack elements        setSawFallback(fDepth + 1, false);        setSawInclude(fDepth, false);        // check if an xml:base has gone out of scope        if (fBaseURIScope.size() > 0 && fDepth == fBaseURIScope.peek()) {            // pop the values from the stack            restoreBaseURI();        }                // check if an xml:lang has gone out of scope        if (fLanguageScope.size() > 0 && fDepth == fLanguageScope.peek()) {            // pop the language from the stack            fCurrentLanguage = restoreLanguage();        }                fDepth--;    }    public void startGeneralEntity(        String name,        XMLResourceIdentifier resId,        String encoding,        Augmentations augs)        throws XNIException {        if (getState() == STATE_NORMAL_PROCESSING) {            if (fResultDepth == 0) {                if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {                    reportFatalError("UnexpandedEntityReferenceIllegal");                }            }            else if (fDocumentHandler != null) {                fDocumentHandler.startGeneralEntity(name, resId, encoding, augs);            }        }    }    public void textDecl(String version, String encoding, Augmentations augs)        throws XNIException {        if (fDocumentHandler != null            && getState() == STATE_NORMAL_PROCESSING) {            fDocumentHandler.textDecl(version, encoding, augs);        }    }    public void endGeneralEntity(String name, Augmentations augs)        throws XNIException {        if (fDocumentHandler != null            && getState() == STATE_NORMAL_PROCESSING            && fResultDepth != 0) {            fDocumentHandler.endGeneralEntity(name, augs);        }    }    public void characters(XMLString text, Augmentations augs)        throws XNIException {        if (getState() == STATE_NORMAL_PROCESSING) {            if (fResultDepth == 0) {                checkWhitespace(text);            }            else if (fDocumentHandler != null) {                // we need to change the depth like this so that modifyAugmentations() works                fDepth++;                augs = modifyAugmentations(augs);                fDocumentHandler.characters(text, augs);                fDepth--;            }        }    }    public void ignorableWhitespace(XMLString text, Augmentations augs)        throws XNIException {        if (fDocumentHandler != null            && getState() == STATE_NORMAL_PROCESSING            && fResultDepth != 0) {            fDocumentHandler.ignorableWhitespace(text, augs);        }    }    public void startCDATA(Augmentations augs) throws XNIException {        if (fDocumentHandler != null            && getState() == STATE_NORMAL_PROCESSING            && fResultDepth != 0) {            fDocumentHandler.startCDATA(augs);        }    }    public void endCDATA(Augmentations augs) throws XNIException {        if (fDocumentHandler != null            && getState() == STATE_NORMAL_PROCESSING            && fResultDepth != 0) {            fDocumentHandler.endCDATA(augs);        }    }    public void endDocument(Augmentations augs) throws XNIException {        if (isRootDocument()) {            if (!fSeenRootElement) {                reportFatalError("RootElementRequired");            }            if (fDocumentHandler != null) {                fDocumentHandler.endDocument(augs);            }        }    }    public void setDocumentSource(XMLDocumentSource source) {        fDocumentSource = source;    }    public XMLDocumentSource getDocumentSource() {        return fDocumentSource;    }    // DTDHandler methods    // We are only interested in the notation and unparsed entity declarations,    // the rest we just pass on    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void attributeDecl(        String elementName,        String attributeName,        String type,        String[] enumeration,        String defaultType,        XMLString defaultValue,        XMLString nonNormalizedDefaultValue,        Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.attributeDecl(                elementName,                attributeName,                type,                enumeration,                defaultType,                defaultValue,                nonNormalizedDefaultValue,                augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#elementDecl(java.lang.String, java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void elementDecl(        String name,        String contentModel,        Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.elementDecl(name, contentModel, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endAttlist(com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void endAttlist(Augmentations augmentations) throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.endAttlist(augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endConditional(com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void endConditional(Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.endConditional(augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endDTD(com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void endDTD(Augmentations augmentations) throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.endDTD(augmentations);        }        fInDTD = false;    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endExternalSubset(com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void endExternalSubset(Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.endExternalSubset(augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#endParameterEntity(java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void endParameterEntity(String name, Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.endParameterEntity(name, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#externalEntityDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void externalEntityDecl(        String name,        XMLResourceIdentifier identifier,        Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.externalEntityDecl(name, identifier, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#getDTDSource()     */    public XMLDTDSource getDTDSource() {        return fDTDSource;    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#ignoredCharacters(com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void ignoredCharacters(XMLString text, Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.ignoredCharacters(text, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#internalEntityDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.XMLString, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void internalEntityDecl(        String name,        XMLString text,        XMLString nonNormalizedText,        Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.internalEntityDecl(                name,                text,                nonNormalizedText,                augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#notationDecl(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void notationDecl(        String name,        XMLResourceIdentifier identifier,        Augmentations augmentations)        throws XNIException {        this.addNotation(name, identifier, augmentations);        if (fDTDHandler != null) {            fDTDHandler.notationDecl(name, identifier, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#setDTDSource(com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource)     */    public void setDTDSource(XMLDTDSource source) {        fDTDSource = source;    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startAttlist(java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void startAttlist(String elementName, Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.startAttlist(elementName, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startConditional(short, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void startConditional(short type, Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.startConditional(type, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startDTD(com.sun.org.apache.xerces.internal.xni.XMLLocator, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void startDTD(XMLLocator locator, Augmentations augmentations)        throws XNIException {        fInDTD = true;        if (fDTDHandler != null) {            fDTDHandler.startDTD(locator, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startExternalSubset(com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void startExternalSubset(        XMLResourceIdentifier identifier,        Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.startExternalSubset(identifier, augmentations);        }    }    /* (non-Javadoc)     * @see com.sun.org.apache.xerces.internal.xni.XMLDTDHandler#startParameterEntity(java.lang.String, com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, java.lang.String, com.sun.org.apache.xerces.internal.xni.Augmentations)     */    public void startParameterEntity(        String name,        XMLResourceIdentifier identifier,        String encoding,        Augmentations augmentations)        throws XNIException {        if (fDTDHandler != null) {            fDTDHandler.startParameterEntity(                name,                identifier,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?