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


Java QName.equals方法代码示例

本文整理汇总了Java中javax.xml.namespace.QName.equals方法的典型用法代码示例。如果您正苦于以下问题:Java QName.equals方法的具体用法?Java QName.equals怎么用?Java QName.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.namespace.QName的用法示例。


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

示例1: processAttribute

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
    Policy policy = (Policy) xmlObject;
    
    QName nameQName = new QName(Policy.NAME_ATTRIB_NAME);
    
    QName attribQName = 
        XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix());
    
    if (nameQName.equals(attribQName)) {
        policy.setName(attribute.getValue());
    } else if (Policy.WSU_ID_ATTR_NAME.equals(attribQName)) {
        policy.setWSUId(attribute.getValue());
        attribute.getOwnerElement().setIdAttributeNode(attribute, true);
    } else {
        XMLHelper.unmarshallToAttributeMap(policy.getUnknownAttributes(), attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:PolicyUnmarshaller.java

示例2: getSymTabEntry

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/**
 * Method getSymTabEntry
 *
 * @param qname
 * @param cls
 *
 * @return
 */
public SymTabEntry getSymTabEntry(QName qname, Class cls) {
    HashMap map = wsdlParser.getSymbolTable().getHashMap();
    Iterator iterator = map.entrySet().iterator();

    while (iterator.hasNext()) {
        Map.Entry entry = (Map.Entry) iterator.next();
        QName key = (QName) entry.getKey();
        Vector v = (Vector) entry.getValue();

        if ((qname == null) || qname.equals(qname)) {
            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry symTabEntry = (SymTabEntry) v.elementAt(i);

                if (cls.isInstance(symTabEntry)) {
                    return symTabEntry;
                }
            }
        }
    }
    return null;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:DynamicInvoker.java

示例3: compare

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public int compare(final QName qn1, final QName qn2) {
    if (qn1 == qn2 || qn1.equals(qn2)) {
        return 0;
    }

    int result;

    result = qn1.getNamespaceURI().compareTo(qn2.getNamespaceURI());
    if (result != 0) {
        return result;
    }

    return qn1.getLocalPart().compareTo(qn2.getLocalPart());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:PolicyUtils.java

示例4: toNextTag

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public static void toNextTag(XMLStreamReader reader, QName name) {
    // skip any whitespace
    if (reader.getEventType() != XMLStreamConstants.START_ELEMENT &&
            reader.getEventType() != XMLStreamConstants.END_ELEMENT) {
        XMLStreamReaderUtil.nextElementContent(reader);
    }
    if(reader.getEventType() == XMLStreamConstants.END_ELEMENT && name.equals(reader.getName())) {
        XMLStreamReaderUtil.nextElementContent(reader);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:XMLStreamReaderUtil.java

示例5: isSupported

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private boolean isSupported( QName returnType ) {
   // XPathConstants.STRING
   if ( ( returnType.equals( XPathConstants.STRING ) ) ||
        ( returnType.equals( XPathConstants.NUMBER ) ) ||
        ( returnType.equals( XPathConstants.BOOLEAN ) ) ||
        ( returnType.equals( XPathConstants.NODE ) ) ||
        ( returnType.equals( XPathConstants.NODESET ) )  ) {

       return true;
   }
   return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:XPathExpressionImpl.java

示例6: checkElementIsTarget

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/**
 * Checks that the given DOM Element's XSI type or namespace qualified element name matches the target QName of this
 * unmarshaller.
 * 
 * @param domElement the DOM element to check
 * 
 * @throws UnmarshallingException thrown if the DOM Element does not match the target of this unmarshaller
 */
protected void checkElementIsTarget(Element domElement) throws UnmarshallingException {
    QName elementName = XMLHelper.getNodeQName(domElement);

    if (targetQName == null) {
        log.trace(
                "Targeted QName checking is not available for this unmarshaller, DOM Element {} was not verified",
                elementName);
        return;
    }

    log.trace("Checking that {} meets target criteria.", elementName);

    QName type = XMLHelper.getXSIType(domElement);

    if (type != null && type.equals(targetQName)) {
        log.trace("{} schema type matches target.", elementName);
        return;
    } else {
        if (elementName.equals(targetQName)) {
            log.trace("{} element name matches target.", elementName);
            return;
        } else {
            String errorMsg = "This unmarshaller only operates on " + targetQName + " elements not " + elementName;
            log.error(errorMsg);
            throw new UnmarshallingException(errorMsg);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:AbstractXMLObjectUnmarshaller.java

示例7: getResultAsType

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private Object getResultAsType( XObject resultObject, QName returnType )
    throws javax.xml.transform.TransformerException {
    // XPathConstants.STRING
    if ( returnType.equals( XPathConstants.STRING ) ) {
        return resultObject.str();
    }
    // XPathConstants.NUMBER
    if ( returnType.equals( XPathConstants.NUMBER ) ) {
        return new Double ( resultObject.num());
    }
    // XPathConstants.BOOLEAN
    if ( returnType.equals( XPathConstants.BOOLEAN ) ) {
        return new Boolean( resultObject.bool());
    }
    // XPathConstants.NODESET ---ORdered, UNOrdered???
    if ( returnType.equals( XPathConstants.NODESET ) ) {
        return resultObject.nodelist();
    }
    // XPathConstants.NODE
    if ( returnType.equals( XPathConstants.NODE ) ) {
        NodeIterator ni = resultObject.nodeset();
        //Return the first node, or null
        return ni.nextNode();
    }
    String fmsg = XSLMessages.createXPATHMessage(
            XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
            new Object[] { returnType.toString()});
    throw new IllegalArgumentException( fmsg );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:XPathImpl.java

示例8: getEndpoints

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/** {@inheritDoc} */
public List<Endpoint> getEndpoints(QName type) {
    if(type.equals(AssertionConsumerService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(assertionConsumerServices));
    }else{
        return super.getEndpoints(type);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:SPSSODescriptorImpl.java

示例9: getEndpoints

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/** {@inheritDoc} */
public List<Endpoint> getEndpoints(QName type) {
    if(type.equals(AuthzService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(authzServices));
    }else if(type.equals(AssertionIDRequestService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(assertionIDRequestServices));
    }
    
    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:PDPDescriptorImpl.java

示例10: handleAttribute

import javax.xml.namespace.QName; //导入方法依赖的package包/类
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:WSDLPatcher.java

示例11: addressibleElement

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private boolean addressibleElement(XMLStreamReader reader, WSDLFeaturedObject binding) {
    QName ua = reader.getName();
    if (ua.equals(AddressingVersion.MEMBER.wsdlExtensionTag)) {
        String required = reader.getAttributeValue(WSDLConstants.NS_WSDL, "required");
        binding.addFeature(new MemberSubmissionAddressingFeature(Boolean.parseBoolean(required)));
        XMLStreamReaderUtil.skipElement(reader);
        return true;        // UsingAddressing is consumed
    }

    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:MemberSubmissionAddressingWSDLParserExtension.java

示例12: getEndpoints

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/** {@inheritDoc} */
public List<Endpoint> getEndpoints(QName type) {
    if(type.equals(SingleSignOnService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(singleSignOnServices));
    }else if(type.equals(NameIDMappingService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(nameIDMappingServices));
    }else if(type.equals(AssertionIDRequestService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(assertionIDRequestServices));
    }else{
        return super.getEndpoints(type);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:IDPSSODescriptorImpl.java

示例13: processStartTag

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private void processStartTag(final StartElement element, final StartElement parent,
        final XMLEventReader reader, final Map<URI, Policy> map)
        throws PolicyException {
    try {
        final QName name = element.getName();
        if (parent == null) {
            if (!name.equals(POLICIES)) {
                throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0089_EXPECTED_ELEMENT("<Policies>", name, element.getLocation())));
            }
        } else {
            final QName parentName = parent.getName();
            if (parentName.equals(POLICIES)) {
                if (!name.equals(POLICY_ATTACHMENT)) {
                    throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0089_EXPECTED_ELEMENT("<PolicyAttachment>", name, element.getLocation())));
                }
            } else if (parentName.equals(POLICY_ATTACHMENT)) {
                if (name.equals(POLICY)) {
                    readPolicy(reader);
                    return;
                } else if (!name.equals(APPLIES_TO)) {
                    throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0089_EXPECTED_ELEMENT("<AppliesTo> or <Policy>", name, element.getLocation())));
                }
            } else if (parentName.equals(APPLIES_TO)) {
                if (!name.equals(URI)) {
                    throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0089_EXPECTED_ELEMENT("<URI>", name, element.getLocation())));
                }
            } else {
                throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0090_UNEXPECTED_ELEMENT(name, element.getLocation())));
            }
        }
        reader.nextEvent();
        this.unmarshal(reader, element);
    } catch (XMLStreamException e) {
        throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0088_FAILED_PARSE(element.getLocation()), e));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:ExternalAttachmentsUnmarshaller.java

示例14: findImplementation

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private ImplementationRecord findImplementation(QName implementationName) {
    final Iterator<PolicyAssertion> parameters = getParametersIterator();
    while (parameters.hasNext()) {
        final PolicyAssertion parameter = parameters.next();
        if (implementationName.equals(parameter.getName())) {
            return getImplementation(parameter);
        }
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:ManagedServiceAssertion.java

示例15: checkArgument

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private static void checkArgument(QName wqname, QName qname) {
    if (! wqname.equals(qname)) {
        throw new IllegalArgumentException("Invalid element "+qname.getLocalPart()); //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:WSDLElementFactoryProvider.java


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