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


Java QName.getLocalPart方法代码示例

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


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

示例1: getAttributeByName

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private Attribute getAttributeByName(final StartElement element,
        final QName attributeName) {
    // call standard API method to retrieve the attribute by name
    Attribute attribute = element.getAttributeByName(attributeName);

    // try to find the attribute without a prefix.
    if (attribute == null) {
        final String localAttributeName = attributeName.getLocalPart();
        final Iterator iterator = element.getAttributes();
        while (iterator.hasNext()) {
            final Attribute nextAttribute = (Attribute) iterator.next();
            final QName aName = nextAttribute.getName();
            final boolean attributeFoundByWorkaround = aName.equals(attributeName) || (aName.getLocalPart().equals(localAttributeName) && (aName.getPrefix() == null || "".equals(aName.getPrefix())));
            if (attributeFoundByWorkaround) {
                attribute = nextAttribute;
                break;
            }

        }
    }

    return attribute;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:XmlPolicyModelUnmarshaller.java

示例2: handleEndElement

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private void handleEndElement(EndElement event) throws SAXException {
    if(!seenText && predictor.expectText()) {
        visitor.text("");
    }

    // fire endElement
    QName qName = event.getName();
    tagName.uri = fixNull(qName.getNamespaceURI());
    tagName.local = qName.getLocalPart();
    visitor.endElement(tagName);

    // end namespace bindings
    for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
        String prefix = fixNull(i.next().getPrefix());  // be defensive
        visitor.endPrefixMapping(prefix);
    }

    seenText = false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:StAXEventConnector.java

示例3: setElementQName

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public SOAPElement setElementQName(QName newName) throws SOAPException {
    log.log(Level.SEVERE,
            "SAAJ0146.impl.invalid.name.change.requested",
            new Object[] {elementQName.getLocalPart(),
                          newName.getLocalPart()});
    throw new SOAPException("Cannot change name for "
                            + elementQName.getLocalPart() + " to "
                            + newName.getLocalPart());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:BodyImpl.java

示例4: setElementQName

import javax.xml.namespace.QName; //导入方法依赖的package包/类
@Override
public SOAPElement setElementQName(QName newName) throws SOAPException {
   log.log(Level.SEVERE,
           "SAAJ0146.impl.invalid.name.change.requested",
           new Object[] {elementQName.getLocalPart(),
                         newName.getLocalPart()});
   throw new SOAPException("Cannot change name for "
                           + elementQName.getLocalPart() + " to "
                           + newName.getLocalPart());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:EnvelopeImpl.java

示例5: _printQName

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public static String _printQName(QName val, NamespaceContext nsc) {
    // Double-check
    String qname;
    String prefix = nsc.getPrefix(val.getNamespaceURI());
    String localPart = val.getLocalPart();

    if (prefix == null || prefix.length() == 0) { // be defensive
        qname = localPart;
    } else {
        qname = prefix + ':' + localPart;
    }

    return qname;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:DatatypeConverterImpl.java

示例6: create

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public WSDLComponent create(WSDLComponent parent, QName qName) {
   String q = qName.getPrefix();
   if (q == null || q.length() == 0) {
       q = qName.getLocalPart();
   } else {
       q = q + ":" + qName.getLocalPart();
   }

   ElementFactory factory = ElementFactoryRegistry.getDefault().get(qName);
   Element element = model.getDocument().createElementNS(qName.getNamespaceURI(), q);
   return create(factory, element, parent);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:WSDLComponentFactoryImpl.java

示例7: setElementQName

import javax.xml.namespace.QName; //导入方法依赖的package包/类
@Override
public SOAPElement setElementQName(QName newName) throws SOAPException {
    log.log(Level.SEVERE,
            "SAAJ0146.impl.invalid.name.change.requested",
            new Object[] {elementQName.getLocalPart(),
                          newName.getLocalPart()});
    throw new SOAPException("Cannot change name for "
                            + elementQName.getLocalPart() + " to "
                            + newName.getLocalPart());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:BodyImpl.java

示例8: Operation

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public Operation(QName name, Entity entity) {
    super(entity);
    _name = name;
    _uniqueName = name.getLocalPart();
    _faultNames = new HashSet<String>();
    _faults = new HashSet<Fault>();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Operation.java

示例9: handleStartElement

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private void handleStartElement() throws XMLStreamException {

        try {
            // start namespace bindings
            int nsCount = staxStreamReader.getNamespaceCount();
            for (int i = 0; i < nsCount; i++) {
                saxHandler.startPrefixMapping(
                    fixNull(staxStreamReader.getNamespacePrefix(i)),
                    fixNull(staxStreamReader.getNamespaceURI(i)));
            }

            // fire startElement
            QName qName = staxStreamReader.getName();
            String prefix = qName.getPrefix();
            String rawname;
            if(prefix==null || prefix.length()==0)
                rawname = qName.getLocalPart();
            else
                rawname = prefix + ':' + qName.getLocalPart();
            Attributes attrs = getAttributes();
            saxHandler.startElement(
                qName.getNamespaceURI(),
                qName.getLocalPart(),
                rawname,
                attrs);
        } catch (SAXException e) {
            throw new XMLStreamException2(e);
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:XMLStreamReaderToContentHandler.java

示例10: addToNameTable

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private void addToNameTable(QName n, QualifiedNameArray a,
        boolean isAttribute,
        StringIntMap prefixMap, StringIntMap namespaceNameMap,
        StringIntMap localNameMap) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceNameMap.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.getSize();
            namespaceName.add(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefixMap.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.getSize();
                prefix.add(n.getPrefix());
            }
        }
    }

    int localNameIndex = localNameMap.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.getSize();
        localName.add(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            a.getSize(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    a.add(name);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:ParserVocabulary.java

示例11: getTypesListFromXsd

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private ArrayList<String> getTypesListFromXsd() {
	ArrayList<String> types = new ArrayList<String>();
	try {
		String tns = transaction.getProject().getTargetNamespace();
		String projectName = transaction.getProject().getName();
		XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(projectName);
		QName responseTypeQName = new QName(tns, transaction.getXsdResponseTypeName());
		XmlSchemaComplexType xmlSchemaType = (XmlSchemaComplexType) schema.getTypeByName(responseTypeQName);
		XmlSchemaParticle xmlSchemaParticle = xmlSchemaType.getParticle();
		if (xmlSchemaParticle != null && xmlSchemaParticle instanceof XmlSchemaSequence) {
			XmlSchemaObjectCollection xmlSchemaObjectCollection = ((XmlSchemaSequence)xmlSchemaParticle).getItems();
			for (int i=0;i<xmlSchemaObjectCollection.getCount();i++) {
				XmlSchemaObject xso = xmlSchemaObjectCollection.getItem(i);
				if (xso instanceof XmlSchemaElement) {
					XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)xso;
					String elName = xmlSchemaElement.getName();
					QName elType = xmlSchemaElement.getSchemaTypeName();
					String value = "<xsd:element name=\""+elName+"\" type=\""+elType.getPrefix()+":"+elType.getLocalPart()+"\"/>";
					types.add(value);
				}
			}
		}
	}
	catch (Exception e) {
	}
	return types;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:28,代码来源:TransactionXSDTypesDialogComposite.java

示例12: JAXBHeader

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public JAXBHeader(XMLBridge bridge, Object jaxbObject) {
    this.jaxbObject = jaxbObject;
    this.bridge = bridge;

    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:JAXBHeader.java

示例13: parseServiceName

import javax.xml.namespace.QName; //导入方法依赖的package包/类
public static String parseServiceName(SOAPMessageContext context) {
    String serviceName = "";
    QName serviceQName = (QName) context.get(MessageContext.WSDL_SERVICE);
    if (serviceQName != null) {
        serviceName = serviceQName.getLocalPart();
    }
    return serviceName;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:9,代码来源:SoapRequestParser.java

示例14: annotateAttribute

import javax.xml.namespace.QName; //导入方法依赖的package包/类
/**
 * Annotate the attribute property 'field'
 */
private void annotateAttribute(JAnnotatable field) {
    CAttributePropertyInfo ap = (CAttributePropertyInfo) prop;
    QName attName = ap.getXmlName();

    // [RESULT]
    // @XmlAttribute(name="foo", required=true, namespace="bar://baz")
    XmlAttributeWriter xaw = field.annotate2(XmlAttributeWriter.class);

    final String generatedName = attName.getLocalPart();
    final String generatedNS = attName.getNamespaceURI();

    // Issue 570; always force generating name="" when do it when globalBindings underscoreBinding is set to non default value
    // generate name property?
    if(!generatedName.equals(ap.getName(false)) || !generatedName.equals(ap.getName(true)) || (outline.parent().getModel().getNameConverter() != NameConverter.standard)) {
        xaw.name(generatedName);
    }

    // generate namespace property?
    if(!generatedNS.equals("")) { // assume attributeFormDefault == unqualified
        xaw.namespace(generatedNS);
    }

    // generate required property?
    if(ap.isRequired()) {
        xaw.required(true);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:AbstractField.java

示例15: JAXBMessage

import javax.xml.namespace.QName; //导入方法依赖的package包/类
private JAXBMessage(XMLBridge bridge, Object jaxbObject, SOAPVersion soapVer) {
    super(soapVer);
    // TODO: think about a better way to handle BridgeContext
    this.bridge = bridge;
    this.rawContext = null;
    this.jaxbObject = jaxbObject;
    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
    this.attachmentSet = new AttachmentSetImpl();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:JAXBMessage.java


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