• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XNIException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.XNIException的典型用法代码示例。如果您正苦于以下问题:Java XNIException类的具体用法?Java XNIException怎么用?Java XNIException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XNIException类属于com.sun.org.apache.xerces.internal.xni包,在下文中一共展示了XNIException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: textDecl

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * Notifies of the presence of a TextDecl line in an entity. If present,
 * this method will be called immediately following the startEntity call.
 * <p>
 * <strong>Note:</strong> This method will never be called for the
 * document entity; it is only called for external general entities
 * referenced in document content.
 * <p>
 * <strong>Note:</strong> This method is not called for entity references
 * appearing as part of attribute values.
 *
 * @param version  The XML version, or null if not specified.
 * @param encoding The IANA encoding name of the entity.
 * @param augs       Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void textDecl (String version, String encoding, Augmentations augs) throws XNIException {
    if (fInDTD){
        return;
    }
    if (!fDeferNodeExpansion) {
        if (fCurrentEntityDecl != null && !fFilterReject) {
            fCurrentEntityDecl.setXmlEncoding (encoding);
            if (version != null)
                fCurrentEntityDecl.setXmlVersion (version);
        }
    }
    else {
        if (fDeferredEntityDecl !=-1) {
            fDeferredDocumentImpl.setEntityInfo (fDeferredEntityDecl, version, encoding);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:AbstractDOMParser.java


示例2: endDTD

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * The end of the DTD.
 *
 * @param augs Additional information that may include infoset
 *                      augmentations.
 * @throws XNIException Thrown by handler to signal an error.
 */
public void endDTD(Augmentations augs) throws XNIException {
    fIsImmutable = true;
    // make sure our description contains useful stuff...
    if (fGrammarDescription.getRootName() == null) {
        // we don't know what the root is; so use possibleRoots...
        int chunk, index = 0;
        String currName = null;
        final int size = fElementDeclCount;
        ArrayList elements = new ArrayList(size);
        for (int i = 0; i < size; ++i) {
            chunk = i >> CHUNK_SHIFT;
            index = i & CHUNK_MASK;
            currName = fElementDeclName[chunk][index].rawname;
            elements.add(currName);
        }
        fGrammarDescription.setPossibleRoots(elements);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:DTDGrammar.java


示例3: startPE

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * start a parameter entity dealing with the textdecl if there is any
 *
 * @param name The name of the parameter entity to start (without the '%')
 * @param literal Whether this is happening within a literal
 */
protected void startPE(String name, boolean literal)
throws IOException, XNIException {
    int depth = fPEDepth;
    String pName = "%"+name;
    if (fValidation && !fEntityStore.isDeclaredEntity(pName)) {
        fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
        new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
    }
    fEntityManager.startEntity(fSymbolTable.addSymbol(pName),
    literal);
    // if we actually got a new entity and it's external
    // parse text decl if there is any
    if (depth != fPEDepth && fEntityScanner.isExternal()) {
        scanTextDecl();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:XMLDTDScannerImpl.java


示例4: startDTD

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * The start of the DTD.
 *
 * @param locator  The document locator, or null if the document
 *                 location cannot be reported during the parsing of
 *                 the document DTD. However, it is <em>strongly</em>
 *                 recommended that a locator be supplied that can
 *                 at least report the base system identifier of the
 *                 DTD.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void startDTD (XMLLocator locator, Augmentations augs) throws XNIException {
    if (DEBUG_EVENTS) {
        System.out.println ("==>startDTD");
        if (DEBUG_BASEURI) {
            System.out.println ("   expandedSystemId: "+locator.getExpandedSystemId ());
            System.out.println ("   baseURI:"+ locator.getBaseSystemId ());
        }
    }

    fInDTD = true;
    if (locator != null) {
        fBaseURIStack.push (locator.getBaseSystemId ());
    }
    if (fDeferNodeExpansion || fDocumentImpl != null) {
        fInternalSubset = new StringBuilder (1024);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:AbstractDOMParser.java


示例5: startElement

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * The start of an element.
 *
 * @param element    The name of the element.
 * @param attributes The element attributes.
 * @param augs       Additional information that may include infoset augmentations
 *
 * @exception XNIException
 *                   Thrown by handler to signal an error.
 */
public void startElement(QName element, XMLAttributes attributes,
        Augmentations augs) throws XNIException {
    if (!resolveXPointer(element, attributes, augs,
            XPointerPart.EVENT_ELEMENT_START)) {

        // xml:base and xml:lang processing
            if (fFixupBase) {
            processXMLBaseAttributes(attributes);
            }
        if (fFixupLang) {
            processXMLLangAttributes(attributes);
        }

        // set the context invalid if the element till an element from the result infoset is included
        fNamespaceContext.setContextInvalid();

        return;
    }
    super.startElement(element, attributes, augs);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:XPointerHandler.java


示例6: endNamespaceScope

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/** Handles end element. */
protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty)
    throws XNIException {

    // bind element
    String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
    element.uri = fNamespaceContext.getURI(eprefix);
    if (element.uri != null) {
        element.prefix = eprefix;
    }

    // call handlers
    if (fDocumentHandler != null) {
        if (!isEmpty) {
            fDocumentHandler.endElement(element, augs);
        }
    }

    // pop context
    fNamespaceContext.popContext();

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:XML11NSDTDValidator.java


示例7: startDocument

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
public void startDocument(XMLLocator locator, String encoding,
        NamespaceContext namespaceContext, Augmentations augs)
throws XNIException {
    fErrorReporter = (XMLErrorReporter)config.getProperty(ERROR_REPORTER);
    fGenerateSyntheticAnnotation = config.getFeature(GENERATE_SYNTHETIC_ANNOTATION);
    fHasNonSchemaAttributes.clear();
    fSawAnnotation.clear();
    schemaDOM = new SchemaDOM();
    fCurrentAnnotationElement = null;
    fAnnotationDepth = -1;
    fInnerAnnotationDepth = -1;
    fDepth = -1;
    fLocator = locator;
    fNamespaceContext = namespaceContext;
    schemaDOM.setDocumentURI(locator.getExpandedSystemId());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:SchemaDOMParser.java


示例8: startParameterEntity

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * This method notifies of the start of a parameter entity. The parameter
 * entity name start with a '%' character.
 *
 * @param name     The name of the parameter entity.
 * @param identifier The resource identifier.
 * @param encoding 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).
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void startParameterEntity (String name,
XMLResourceIdentifier identifier,
String encoding,
Augmentations augs) throws XNIException {
    if (DEBUG_EVENTS) {
        System.out.println ("==>startParameterEntity: "+name);
        if (DEBUG_BASEURI) {
            System.out.println ("   expandedSystemId: "+identifier.getExpandedSystemId ());
            System.out.println ("   baseURI:"+ identifier.getBaseSystemId ());
        }
    }
    if (augs != null && fInternalSubset != null &&
        !fInDTDExternalSubset &&
        Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
        fInternalSubset.append(name).append(";\n");
    }
    fBaseURIStack.push (identifier.getExpandedSystemId ());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:AbstractDOMParser.java


示例9: unparsedEntityDecl

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
@Override
public void unparsedEntityDecl(
    String name,
    XMLResourceIdentifier identifier,
    String notation,
    Augmentations augmentations)
    throws XNIException {
    this.addUnparsedEntity(name, identifier, notation, augmentations);
    if (fDTDHandler != null) {
        fDTDHandler.unparsedEntityDecl(
            name,
            identifier,
            notation,
            augmentations);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XIncludeHandler.java


示例10: unparsedEntityDecl

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * An unparsed entity declaration.
 *
 * @param name     The name of the entity.
 * @param identifier    An object containing all location information
 *                      pertinent to this entity.
 * @param notation The name of the notation.
 *
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
                               String notation,
                               Augmentations augs) throws XNIException {
    try {
        // SAX2 extension
        if (fDTDHandler != null) {
            String publicId = identifier.getPublicId();
            String systemId = fResolveDTDURIs ?
                identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
            fDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation);
        }
    }
    catch (SAXException e) {
        throw new XNIException(e);
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:AbstractSAXParser.java


示例11: reset

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * Reset all components before parsing.
 *
 * @throws XNIException Thrown if an error occurs during initialization.
 */
protected void reset() throws XNIException {

    if (fValidationManager != null)
        fValidationManager.reset();
    // configure the pipeline and initialize the components
    configurePipeline();
    super.reset();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:DTDConfiguration.java


示例12: ignorableWhitespace

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
public void ignorableWhitespace(char[] ch, int start, int len) throws SAXException {
    try {
        handler().ignorableWhitespace(new XMLString(ch,start,len),aug());
    } catch( XNIException e ) {
        throw toSAXException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:JAXPValidatorComponent.java


示例13: endParameterEntity

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
@Override
public void endParameterEntity(String name, Augmentations augmentations)
    throws XNIException {
    if (fDTDHandler != null) {
        fDTDHandler.endParameterEntity(name, augmentations);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:XIncludeHandler.java


示例14: convertToSAXException

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
static void convertToSAXException(XNIException e) throws SAXException {
    Exception ex = e.getException();
    if (ex == null) {
        throw new SAXException(e.getMessage());
    }
    if (ex instanceof SAXException) {
        throw (SAXException) ex;
    }
    throw new SAXException(ex);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SchemaContentHandler.java


示例15: endGroup

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * The end of a group for mixed or children content models.
 *
 * @param augs Additional information that may include infoset
 *                      augmentations.
 * @throws XNIException Thrown by handler to signal an error.
 */
public void endGroup(Augmentations augs) throws XNIException {

    if (!fMixed) {
        if (fPrevNodeIndexStack[fDepth] != -1) {
            fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
        }
        int nodeIndex = fNodeIndexStack[fDepth--];
        fNodeIndexStack[fDepth] = nodeIndex;
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:DTDGrammar.java


示例16: endElement

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * The end of an element.
 *
 * @param element The name of the element.
 * @param augs    Additional information that may include infoset augmentations
 *
 * @exception XNIException
 *                   Thrown by handler to signal an error.
 */
public void endElement(QName element, Augmentations augs) throws XNIException {

    // when we reach the endElement of xs:appinfo or xs:documentation,
    // change fInnerAnnotationDepth to -1
    if(fAnnotationDepth > -1) {
        if (fInnerAnnotationDepth == fDepth) {
            fInnerAnnotationDepth = -1;
            schemaDOM.endAnnotationElement(element);
            schemaDOM.endElement();
        } else if (fAnnotationDepth == fDepth) {
            fAnnotationDepth = -1;
            schemaDOM.endAnnotation(element, fCurrentAnnotationElement);
            schemaDOM.endElement();
        } else { // inside a child of annotation
            schemaDOM.endAnnotationElement(element);
        }
    } else { // not in an annotation at all
        if(element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && fGenerateSyntheticAnnotation) {
            boolean value = fHasNonSchemaAttributes.pop();
            boolean sawann = fSawAnnotation.pop();
            if (value && !sawann) {
                String schemaPrefix = fNamespaceContext.getPrefix(SchemaSymbols.URI_SCHEMAFORSCHEMA);
                final String annRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_ANNOTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_ANNOTATION);
                schemaDOM.startAnnotation(annRawName, fEmptyAttr, fNamespaceContext);
                final String elemRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_DOCUMENTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_DOCUMENTATION);
                schemaDOM.startAnnotationElement(elemRawName, fEmptyAttr);
                schemaDOM.charactersRaw("SYNTHETIC_ANNOTATION");
                schemaDOM.endSyntheticAnnotationElement(elemRawName, false);
                schemaDOM.endSyntheticAnnotationElement(annRawName, true);
            }
        }
        schemaDOM.endElement();
    }
    fDepth--;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:46,代码来源:SchemaDOMParser.java


示例17: startDocument

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * The start of the document.
 *
 * @param locator The document locator, or null if the document
 *                 location cannot be reported during the parsing
 *                 of this document. However, it is <em>strongly</em>
 *                 recommended that a locator be supplied that can
 *                 at least report the system identifier of the
 *                 document.
 * @param encoding 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 entities or a document entity that is
 *                 parsed from a java.io.Reader).
 * @param namespaceContext
 *                 The namespace context in effect at the
 *                 start of this document.
 *                 This object represents the current context.
 *                 Implementors of this class are responsible
 *                 for copying the namespace bindings from the
 *                 the current context (and its parent contexts)
 *                 if that information is important.
 * @param augs     Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void startDocument(XMLLocator locator, String encoding,
                          NamespaceContext namespaceContext, Augmentations augs)
    throws XNIException {

    fNamespaceContext = namespaceContext;

    try {
        // SAX1
        if (fDocumentHandler != null) {
            if (locator != null) {
                fDocumentHandler.setDocumentLocator(new LocatorProxy(locator));
            }
            fDocumentHandler.startDocument();
        }

        // SAX2
        if (fContentHandler != null) {
            if (locator != null) {
                fContentHandler.setDocumentLocator(new LocatorProxy(locator));
            }
            fContentHandler.startDocument();
        }
    }
    catch (SAXException e) {
        throw new XNIException(e);
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:AbstractSAXParser.java


示例18: reportWarning

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * Reports XPointer Warnings
 *
 */
private void reportWarning(String key, Object[] arguments)
        throws XNIException {
    fXPointerErrorReporter.reportError(
            XPointerMessageFormatter.XPOINTER_DOMAIN, key, arguments,
            XMLErrorReporter.SEVERITY_WARNING);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:XPointerHandler.java


示例19: reportFatalError

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
 * Convenience function used in all XML scanners.
 */
protected void reportFatalError(String msgId, Object[] args)
throws XNIException {
    fErrorReporter.reportError(fEntityScanner, XMLMessageFormatter.XML_DOMAIN,
            msgId, args,
            XMLErrorReporter.SEVERITY_FATAL_ERROR);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:XMLScanner.java


示例20: handleEndElement

import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/** Handle end element. */
protected void handleEndElement(QName element) throws XNIException {
    if (fDTDGrammar == null) return;
    fElementDepth--;
    if (fElementDepth < -1) {
        throw new RuntimeException("FWK008 Element stack underflow");
    }
    if (fElementDepth < 0) {
        fCurrentElementIndex = -1;
        fCurrentContentSpecType = -1;
        fInElementContent = false;
        return;
    }
    fInElementContent =  fElementContentState[fElementDepth];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:DTDGrammarUtil.java



注:本文中的com.sun.org.apache.xerces.internal.xni.XNIException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LineArray类代码示例发布时间:2022-05-22
下一篇:
Java HttpUrlConnectorProvider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap