本文整理匯總了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);
}
}
示例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;
}
示例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());
}
示例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);
}
}
示例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;
}
示例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);
}
}
}
示例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 );
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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));
}
}
示例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;
}
示例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
}
}