当前位置: 首页>>代码示例>>Java>>正文


Java XMLResourceIdentifier类代码示例

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


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

示例1: startGeneralEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * This method notifies the start of a general entity.
 * <p>
 * <strong>Note:</strong> This method is not called for entity references
 * appearing as part of attribute values.
 * 
 * @param name     The name of the general 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 entities or a document entity that is
 *                 parsed from a java.io.Reader).
 * @param augs     Additional information that may include infoset augmentations
 *                 
 * @exception XNIException Thrown by handler to signal an error.
 */
public void startGeneralEntity(String name, 
                               XMLResourceIdentifier identifier,
                               String encoding, 
                               Augmentations augs) throws XNIException {
    if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
        fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
        // fixes E15.1
        if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
            fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, 
                                       "MSG_CONTENT_INVALID_SPECIFIED",
                                       new Object[]{ fCurrentElement.rawname,
                                                     "EMPTY", "ENTITY"},
                                       XMLErrorReporter.SEVERITY_ERROR);                
        }
        if (fGrammarBucket.getStandalone()) {
            XMLDTDLoader.checkStandaloneEntityRef(name, fDTDGrammar, fEntityDecl, fErrorReporter);
        }
    }
    if (fDocumentHandler != null) {
        fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:40,代码来源:XMLDTDValidator.java

示例2: resolveEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
@Override
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException {
	//logger.info("Resolving entity for: " + resourceIdentifier.getExpandedSystemId() + " namespace " + resourceIdentifier.getNamespace());
	
	try{
		URI originalURI = new URI(resourceIdentifier.getExpandedSystemId());
		if(xbrlSchemaRemap.containsKey(originalURI)){
			URI newURI = xbrlSchemaRemap.get(originalURI);
			
			return new XMLInputSource(null, newURI.toString(), newURI.toString(), fileCache.getFileInputStream(newURI.toString()), null);
		}
	}
	catch(URISyntaxException e){
		
	}
	
	return new XMLInputSource(resourceIdentifier.getPublicId(), 
			resourceIdentifier.getExpandedSystemId(), 
			resourceIdentifier.getExpandedSystemId(), 
			fileCache.getFileInputStream(resourceIdentifier.getExpandedSystemId()), 
			null);

}
 
开发者ID:chen4119,项目名称:tempeh,代码行数:24,代码来源:XbrlLoader.java

示例3: startGeneralEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * This method notifies of the start of an entity. The DTD has the
 * pseudo-name of "[dtd]" parameter entity names start with '%'; and
 * general entity names are just the entity name.
 * <p>
 * <strong>Note:</strong> Since the document is an entity, the handler
 * will be notified of the start of the document entity by calling the
 * startEntity method with the entity name "[xml]" <em>before</em> calling
 * the startDocument method. When exposing entity boundaries through the
 * SAX API, the document entity is never reported, however.
 * <p>
 * <strong>Note:</strong> This method is not called for entity references
 * appearing as part of attribute values.
 *
 * @param name     The name of the 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 startGeneralEntity(String name, XMLResourceIdentifier identifier, 
                               String encoding, Augmentations augs)
    throws XNIException {
    
    try {
        // Only report startEntity if this entity was actually read.
        if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
            // report skipped entity to content handler
            if (fContentHandler != null) {
                fContentHandler.skippedEntity(name);
            }
        }
        else {
            // SAX2 extension
            if (fLexicalHandler != null) {
                fLexicalHandler.startEntity(name);
            }
        }
    }
    catch (SAXException e) {
        throw new XNIException(e);
    }

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:49,代码来源:AbstractSAXParserMMImpl.java

示例4: startParameterEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * This method notifies of the start of parameter entity. The DTD has the
 * pseudo-name of "[dtd]" parameter entity names start with '%'; and
 * general entity names are just the entity name.
 * <p>
 * <strong>Note:</strong> Since the document is an entity, the handler
 * will be notified of the start of the document entity by calling the
 * startEntity method with the entity name "[xml]" <em>before</em> calling
 * the startDocument method. When exposing entity boundaries through the
 * SAX API, the document entity is never reported, however.
 * <p>
 * <strong>Note:</strong> This method is not called for entity references
 * appearing as part of attribute values.
 *
 * @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 {

    try {
        // Only report startEntity if this entity was actually read.
        if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
            // report skipped entity to content handler
            if (fContentHandler != null) {
                fContentHandler.skippedEntity(name);
            }
        }
        else {
            // SAX2 extension
            if (fLexicalHandler != null && fLexicalHandlerParameterEntities) {
                fLexicalHandler.startEntity(name);
            }
        }
    }
    catch (SAXException e) {
        throw new XNIException(e);
    }

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:51,代码来源:AbstractSAXParserMMImpl.java

示例5: externalEntityDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * An external entity declaration.
 *
 * @param name     The name of the entity. Parameter entity names start
 *                 with '%', whereas the name of a general entity is just
 *                 the entity name.
 * @param identifier    An object containing all location information 
 *                      pertinent to this entity.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
                               Augmentations augs) throws XNIException {
    try {
        // SAX2 extension
        if (fDeclHandler != null) {
            String publicId = identifier.getPublicId();
            String systemId = fResolveDTDURIs ? 
                identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
            fDeclHandler.externalEntityDecl(name, publicId, systemId);
        }
    }
    catch (SAXException e) {
        throw new XNIException(e);
    }

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:30,代码来源:AbstractSAXParserMMImpl.java

示例6: unparsedEntityDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的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:BowlerHatLLC,项目名称:feathers-sdk,代码行数:31,代码来源:AbstractSAXParserMMImpl.java

示例7: notationDecl

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

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:28,代码来源:AbstractSAXParserMMImpl.java

示例8: startEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * This method notifies of the start of an entity. The DTD has the
 * pseudo-name of "[dtd]" parameter entity names start with '%'; and
 * general entities are just specified by their name.
 *
 * @param name     The name of the 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 entities or a document entity that is
 *                 parsed from a java.io.Reader).
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void startEntity(String name,
                        XMLResourceIdentifier identifier,
                        String encoding, Augmentations augs) throws XNIException {

    super.startEntity(name, identifier, encoding, augs);

    // prepare to look for a TextDecl if external general entity
    if (!name.equals("[xml]") && fEntityScanner.isExternal()) {
        setScannerState(SCANNER_STATE_TEXT_DECL);
    } 

    // call handler
    if (fDocumentHandler != null && name.equals("[xml]")) {
        fDocumentHandler.startDocument(fEntityScanner, encoding, fNamespaceContext, null);
    }

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:33,代码来源:XMLDocumentScannerMMImpl.java

示例9: startParameterEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的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:AaronZhangL,项目名称:SplitCharater,代码行数:34,代码来源:AbstractDOMParser.java

示例10: startParameterEntity

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的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 (fPerformValidation && fDTDGrammar != null &&
            fGrammarBucket.getStandalone()) {
        checkStandaloneEntityRef(name, fDTDGrammar, fEntityDecl, fErrorReporter);
    }
    // call handlers
    if(fDTDGrammar != null )
        fDTDGrammar.startParameterEntity(name, identifier, encoding, augs);
    if (fDTDHandler != null) {
        fDTDHandler.startParameterEntity(name, identifier, encoding, augs);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:32,代码来源:XMLDTDProcessor.java

示例11: externalEntityDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * An external entity declaration.
 * 
 * @param name     The name of the entity. Parameter entity names start
 *                 with '%', whereas the name of a general entity is just
 *                 the entity name.
 * @param identifier    An object containing all location information 
 *                      pertinent to this external entity.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
                               Augmentations augs) throws XNIException {

    DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar:  fGrammarBucket.getActiveGrammar());
    int index = grammar.getEntityDeclIndex(name) ;

    //If the same entity is declared more than once, the first declaration
    //encountered is binding, SAX requires only effective(first) declaration
    //to be reported to the application

    //REVISIT: Does it make sense to pass duplicate entity information across
    //the pipeline -- nb?

    //its a new entity and hasn't been declared.
    if(index == -1){
        //store external entity declaration in grammar
        if(fDTDGrammar != null) 
            fDTDGrammar.externalEntityDecl(name, identifier, augs);
        // call handlers
        if (fDTDHandler != null) {
            fDTDHandler.externalEntityDecl(name, identifier, augs);
        }
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:39,代码来源:XMLDTDProcessor.java

示例12: unparsedEntityDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的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 {

    // VC: Notation declared,  in the production of NDataDecl
    if (fValidation) {
        fNDataDeclNotations.put(name, notation);
    }

    // call handlers
    if(fDTDGrammar != null) 
        fDTDGrammar.unparsedEntityDecl(name, identifier, notation, augs);
    if (fDTDHandler != null) {
        fDTDHandler.unparsedEntityDecl(name, identifier, notation, augs);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:30,代码来源:XMLDTDProcessor.java

示例13: notationDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * A notation declaration
 * 
 * @param name     The name of the notation.
 * @param identifier    An object containing all location information 
 *                      pertinent to this notation.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void notationDecl(String name, XMLResourceIdentifier identifier,
                         Augmentations augs) throws XNIException {

    // VC: Unique Notation Name
    if (fValidation) {
        DTDGrammar grammar = (fDTDGrammar != null ? fDTDGrammar : fGrammarBucket.getActiveGrammar());
        if (grammar.getNotationDeclIndex(name) != -1) {
            fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                       "UniqueNotationName",
                                       new Object[]{name},
                                       XMLErrorReporter.SEVERITY_ERROR);
        }
    }
    
    // call handlers
    if(fDTDGrammar != null) 
        fDTDGrammar.notationDecl(name, identifier, augs);
    if (fDTDHandler != null) {
        fDTDHandler.notationDecl(name, identifier, augs);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:34,代码来源:XMLDTDProcessor.java

示例14: externalEntityDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的package包/类
/**
 * An external entity declaration.
 *
 * @param name     The name of the entity. Parameter entity names start
 *                 with '%', whereas the name of a general entity is just
 *                 the entity name.
 * @param identifier    An object containing all location information
 *                      pertinent to this external entity declaration.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 * @throws XNIException Thrown by handler to signal an error.
 */
public void externalEntityDecl(String name,
                               XMLResourceIdentifier identifier,
                               Augmentations augs) throws XNIException {

    int entityIndex = getEntityDeclIndex(name);
    if( entityIndex == -1){
        entityIndex = createEntityDecl();
        boolean isPE = name.startsWith("%");
        boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);

        XMLEntityDecl  entityDecl = new XMLEntityDecl();
        entityDecl.setValues(name, identifier.getPublicId(), identifier.getLiteralSystemId(),
                            identifier.getBaseSystemId(),
                            null, null, isPE, inExternal);

        setEntityDecl(entityIndex, entityDecl);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:31,代码来源:DTDGrammar.java

示例15: unparsedEntityDecl

import org.apache.xerces.xni.XMLResourceIdentifier; //导入依赖的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 {

    XMLEntityDecl  entityDecl = new XMLEntityDecl();
    boolean isPE = name.startsWith("%");
    boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);

    entityDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
                        identifier.getBaseSystemId(), notation,
                        null, isPE, inExternal);
    int entityIndex = getEntityDeclIndex(name);
    if (entityIndex == -1) {
        entityIndex = createEntityDecl();
        setEntityDecl(entityIndex, entityDecl);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:30,代码来源:DTDGrammar.java


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