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


Java QName类代码示例

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


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

示例1: reset

import org.apache.xerces.xni.QName; //导入依赖的package包/类
/** Resets the component. */
public void reset(XMLComponentManager manager)
    throws XMLConfigurationException {

    // get features
    fNamespaces = manager.getFeature(NAMESPACES);
    fAugmentations = manager.getFeature(AUGMENTATIONS);
    fReportErrors = manager.getFeature(REPORT_ERRORS);
    fDocumentFragment = manager.getFeature(DOCUMENT_FRAGMENT) ||
                        manager.getFeature(DOCUMENT_FRAGMENT_DEPRECATED);
    fIgnoreOutsideContent = manager.getFeature(IGNORE_OUTSIDE_CONTENT);

    // get properties
    fNamesElems = getNamesValue(String.valueOf(manager.getProperty(NAMES_ELEMS)));
    fNamesAttrs = getNamesValue(String.valueOf(manager.getProperty(NAMES_ATTRS)));
    fErrorReporter = (HTMLErrorReporter)manager.getProperty(ERROR_REPORTER);
    
    fragmentContextStack_ = (QName[]) manager.getProperty(FRAGMENT_CONTEXT_STACK);

}
 
开发者ID:carson0321,项目名称:node-boilerpipe,代码行数:21,代码来源:HTMLTagBalancer.java

示例2: Info

import org.apache.xerces.xni.QName; //导入依赖的package包/类
/**
 * Creates an element information object.
 * <p>
 * <strong>Note:</strong>
 * This constructor makes a copy of the element information.
 *
 * @param element The element qualified name.
 * @param attributes The element attributes.
 */
public Info(HTMLElements.Element element,
            QName qname, XMLAttributes attributes) {
    this.element = element;
    this.qname = new QName(qname);
    if (attributes != null) {
        int length = attributes.getLength();
        if (length > 0) {
            QName aqname = new QName();
            XMLAttributes newattrs = new XMLAttributesImpl();
            for (int i = 0; i < length; i++) {
                attributes.getName(i, aqname);
                String type = attributes.getType(i);
                String value = attributes.getValue(i);
                String nonNormalizedValue = attributes.getNonNormalizedValue(i);
                boolean specified = attributes.isSpecified(i);
                newattrs.addAttribute(aqname, type, value);
                newattrs.setNonNormalizedValue(i, nonNormalizedValue);
                newattrs.setSpecified(i, specified);
            }
            this.attributes = newattrs;
        }
    }
}
 
开发者ID:carson0321,项目名称:node-boilerpipe,代码行数:33,代码来源:HTMLTagBalancer.java

示例3: createQName

import org.apache.xerces.xni.QName; //导入依赖的package包/类
private static QName createQName(XmlTag tag) {
  //todo don't use intern to not pollute PermGen
  String namespace = tag.getNamespace();
  return new QName(tag.getNamespacePrefix().intern(),
                   tag.getLocalName().intern(),
                   tag.getName().intern(),
                   namespace.isEmpty() ? null : namespace.intern());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XsContentDFA.java

示例4: createElementNode

import org.apache.xerces.xni.QName; //导入依赖的package包/类
protected Element createElementNode (QName element) {
    Element el = null;

    if (fNamespaceAware) {
        // if we are using xerces DOM implementation, call our
        // own constructor to reuse the strings we have here.
        if (fDocumentImpl != null) {
            el = fDocumentImpl.createElementNS (element.uri, element.rawname,
            element.localpart);
        }
        else {
            el = fDocument.createElementNS (element.uri, element.rawname);
        }
    }
    else {
        el = fDocument.createElement (element.rawname);
    }

    return el;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:21,代码来源:AbstractDOMParser.java

示例5: emptyElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
/**
 * An empty 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 emptyElement(QName element, XMLAttributes attributes,
        Augmentations augs) throws XNIException {
    if (!resolveXPointer(element, attributes, augs,
            XPointerPart.EVENT_ELEMENT_EMPTY)) {
        // xml:base and xml:lang processing
    	if (fFixupBase) {
            processXMLBaseAttributes(attributes);
    	}    
        if (fFixupLang) {
            processXMLLangAttributes(attributes);
        }
        // no need to restore restoreBaseURI() for xml:base and xml:lang processing
        
        // set the context invalid if the element till an element from the result infoset is included
        fNamespaceContext.setContextInvalid(); 
        return;
    }
    super.emptyElement(element, attributes, augs);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:30,代码来源:XPointerHandler.java

示例6: startElement

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

示例7: endElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    final Node currentElement = fDOMValidatorHelper.getCurrentElement();
    // Write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl) currentElement).setType(type);
        }
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:19,代码来源:DOMResultAugmentor.java

示例8: endElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    // write type information to this element
    if (augs != null && fDocumentImpl != null) {
        ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
        if (elementPSVI != null) {
            if (fStorePSVI) {
                ((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
            }
            XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
            if (type == null) {
                type = elementPSVI.getTypeDefinition();
            }
            ((ElementNSImpl)fCurrentNode).setType(type);
        }
    }
    
    // adjust current node reference
    if (fCurrentNode == fFragmentRoot) {
        fCurrentNode = null;
        fFragmentRoot = null;
        return;
    }
    fCurrentNode = fCurrentNode.getParentNode();
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:26,代码来源:DOMResultBuilder.java

示例9: emptyElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
/**
 * An empty element.
 *
 * @param element    The name of the element.
 * @param attributes The element attributes.
 * @param augs   Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void emptyElement(
    QName element,
    XMLAttributes attributes,
    Augmentations augs)
    throws XNIException {
    if (fDocumentHandler == null)
        return;

    checkForChildren();
    sendIndentedElement("element");
    sendElementEvent("namespaceName", element.uri);
    sendElementEvent("localName", element.localpart);
    sendElementEvent("prefix", element.prefix);
    processAttributes(attributes);
    processInScopeNamespaces();
    sendElementEvent("baseURI", fDocumentLocation.getBaseSystemId());
    if (fPSVInfoset) {
        processPSVIStartElement(augs);
    }
    sendEmptyElementEvent("children");
    if (fPSVInfoset) {
        processPSVIEndElement(augs);
    }
    sendUnIndentedElement("element");
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:35,代码来源:PSVIWriter.java

示例10: endElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
        throws XNIException {
    if (fContentHandler != null) {
        try {
            fTypeInfoProvider.beginEndElement(augs);
            fContentHandler.endElement((element.uri != null) ? element.uri : XMLSymbols.EMPTY_STRING,
                    element.localpart, element.rawname);
        }
        catch (SAXException e) {
            throw new XNIException(e);
        }
        finally {
            fTypeInfoProvider.finishEndElement();
        }
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:17,代码来源:ValidatorHandlerImpl.java

示例11: fillQName

import org.apache.xerces.xni.QName; //导入依赖的package包/类
/** Fills in a QName object. */
private void fillQName(QName toFill, String uri, String localpart, String raw) {
    if (!fStringsInternalized) {
        uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null;
        localpart = (localpart != null) ? fSymbolTable.addSymbol(localpart) : XMLSymbols.EMPTY_STRING;
        raw = (raw != null) ? fSymbolTable.addSymbol(raw) : XMLSymbols.EMPTY_STRING;
    }
    else {
        if (uri != null && uri.length() == 0) {
            uri = null;
        }
        if (localpart == null) {
            localpart = XMLSymbols.EMPTY_STRING;
        }
        if (raw == null) {
            raw = XMLSymbols.EMPTY_STRING;
        }
    }
    String prefix = XMLSymbols.EMPTY_STRING;
    int prefixIdx = raw.indexOf(':');
    if (prefixIdx != -1) {
        prefix = fSymbolTable.addSymbol(raw.substring(0, prefixIdx));
    }
    toFill.setValues(prefix, localpart, raw, uri);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:26,代码来源:ValidatorHandlerImpl.java

示例12: findMatchingDecl

import org.apache.xerces.xni.QName; //导入依赖的package包/类
Object findMatchingDecl(QName curElem, SubstitutionGroupHandler subGroupHandler) {
    Object matchingDecl = null;

    for (int elemIndex = 0; elemIndex < fElemMapSize; elemIndex++) {
        int type = fElemMapType[elemIndex] ;
        if (type == XSParticleDecl.PARTICLE_ELEMENT) {
            matchingDecl = subGroupHandler.getMatchingElemDecl(curElem, (XSElementDecl)fElemMap[elemIndex]);
            if (matchingDecl != null) {
                return matchingDecl;
            }
        }
        else if (type == XSParticleDecl.PARTICLE_WILDCARD) {
            if(((XSWildcardDecl)fElemMap[elemIndex]).allowNamespace(curElem.uri))
                return fElemMap[elemIndex];
        }
    }

    return null;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:20,代码来源:XSDFACM.java

示例13: endElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs) throws XNIException {
    try {
        String uri = element.uri != null ? element.uri : "";
        String localpart = element.localpart;
        fContentHandler.endElement(uri, localpart, element.rawname);
        
        // send endPrefixMapping events
        int count = fNamespaceContext.getDeclaredPrefixCount();
        if (count > 0) {
            for (int i = 0; i < count; i++) {
                fContentHandler.endPrefixMapping(fNamespaceContext.getDeclaredPrefixAt(i));
            }
        }
    } catch( SAXException e ) {
        throw new XNIException(e);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:18,代码来源:JAXPValidatorComponent.java

示例14: endElement

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

    ElementState fElementState = (ElementState)_elementState.peek();
    if (fElementState.isEmpty) {
        sendEmptyElementEvent("children");
    }
    else {
        sendUnIndentedElement("children");
    }
    _elementState.pop();
    if (fPSVInfoset) {
        processPSVIStartElement(augs);
        processPSVIEndElement(augs);
    }
    sendUnIndentedElement("element");
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:28,代码来源:PSVIWriter.java

示例15: startElement

import org.apache.xerces.xni.QName; //导入依赖的package包/类
/**
 * Binds the namespaces. This method will handle calling the
 * document handler to start the prefix mappings.
 * <p>
 * <strong>Note:</strong> This method makes use of the
 * fAttributeQName variable. Any contents of the variable will
 * be destroyed. Caller should copy the values out of this
 * temporary variable before calling this method.
 *
 * @param element    The name of the element.
 * @param attributes The element attributes.
 * @param augs   Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void startElement(
    QName element,
    XMLAttributes attributes,
    Augmentations augs)
    throws XNIException {
    if (fDocumentHandler == null)
        return;

    checkForChildren();

    _elementState.push(new ElementState(true));

    sendIndentedElement("element");
    sendElementEvent("namespaceName", element.uri);
    sendElementEvent("localName", element.localpart);
    sendElementEvent("prefix", element.prefix);
    processAttributes(attributes);
    processInScopeNamespaces();
    sendElementEvent("baseURI", fDocumentLocation.getBaseSystemId());
    if (fPSVInfoset) {
        processPSVIStartElement(augs);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:39,代码来源:PSVIWriter.java


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