org.apache.axiom.om.OMAttribute.getAttributeValue()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.apache.axiom.om.OMAttribute.getAttributeValue()方法的一些代码示例,展示了OMAttribute.getAttributeValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OMAttribute.getAttributeValue()方法的具体详情如下:
包路径:org.apache.axiom.om.OMAttribute
类名称:OMAttribute
方法名:getAttributeValue

OMAttribute.getAttributeValue介绍

[英]Get the attribute value.
[中]获取属性值。

代码示例

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-api

/**
 * Retrieves the string-value of an attribute node. This should be the XML 1.0 normalized
 * attribute value. This may be the empty string but must not be null.
 *
 * @param object the attribute node
 * @return Returns the string-value of the node.
 */
public String getAttributeStringValue(Object object) {
  return ((OMAttribute) object).getAttributeValue();
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam2.analyzer

private boolean isEmptyAttribute(OMAttribute attribute) {
  if (attribute == null || attribute.getAttributeValue() == null ||
    attribute.getAttributeValue().equals("")) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.analyzer

private boolean isEmptryAttribute(OMAttribute attr) {
  if (attr == null || attr.getAttributeValue() == null || attr.getAttributeValue().trim().
      equals("")) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.apache.axis2/axis2-adb

public static String getAttvalue(OMAttribute omatribute) {
  String ref;
  ref = omatribute.getAttributeValue();
  if (ref != null) {
    if (ref.charAt(0) == '#') {
      ref = ref.substring(1);
    }
  }
  return ref;
}

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-api

protected boolean matches(OMNode node) {
  if (node instanceof OMElement) {
    OMAttribute attr =
        ((OMElement) node).getAttribute(
            attributeName);
    return (attr != null) && (doCaseSensitiveValueChecks ?
        attr.getAttributeValue().equals(attributeValue) :
        attr.getAttributeValue().equalsIgnoreCase(attributeValue));
  } else {
    return false;
  }
}

代码示例来源:origin: org.apache.synapse/synapse-core

protected String getAttribute(OMElement elt, QName qName) {
  OMAttribute a = elt.getAttribute(qName);
  if (a != null) {
    return a.getAttributeValue();
  }
  return null;
}

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-impl

String getAttributeValue(String s, String s1) {
  if (currentEvent == START_ELEMENT) {
    QName qname = new QName(s, s1);
    OMAttribute attr = ((OMElement)node).getAttribute(qname);
    return attr == null ? null : attr.getAttributeValue();
  } else {
    throw new IllegalStateException(
        "attribute type accessed in illegal event!");
  }
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.application.authentication.framework

private String processAuthEndpointQueryParamElem(OMElement authEndpointQueryParamElem) {
  OMAttribute nameAttr = authEndpointQueryParamElem.getAttribute(new QName(
      FrameworkConstants.Config.ATTR_AUTH_ENDPOINT_QUERY_PARAM_NAME));
  if (nameAttr == null) {
    log.warn("Each Authentication Endpoint Query Param should have a unique name attribute. This Query Param will skipped.");
    return null;
  }
  return nameAttr.getAttributeValue();
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.authentication.framework

private String processAuthEndpointQueryParamElem(OMElement authEndpointQueryParamElem) {
  OMAttribute nameAttr = authEndpointQueryParamElem.getAttribute(new QName(
      FrameworkConstants.Config.ATTR_AUTH_ENDPOINT_QUERY_PARAM_NAME));
  if (nameAttr == null) {
    log.warn("Each Authentication Endpoint Query Param should have a unique name attribute. This Query Param will skipped.");
    return null;
  }
  return nameAttr.getAttributeValue();
}

代码示例来源:origin: org.apache.ws.commons.axiom/om-aspects

String getAttributeValue(String s, String s1) {
  if (currentEvent == START_ELEMENT) {
    QName qname = new QName(s, s1);
    OMAttribute attr = ((OMElement)node).getAttribute(qname);
    return attr == null ? null : attr.getAttributeValue();
  } else {
    throw new IllegalStateException(
        "attribute type accessed in illegal event!");
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

protected String[] processSupportedPolicyNamespaces(
    OMElement supportedPolicyElements) {
  OMAttribute namespaces = supportedPolicyElements
      .getAttribute(new QName(TAG_NAMESPACES));
  if (namespaces != null) {
    String value = namespaces.getAttributeValue();
    if (value.trim().length() != 0) {
      return value.split(" ");
    }
  }
  return null;
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public String getAttributeValue(String qName) {
  String value = null;
  OMAttribute attribute = data.getAttribute(new QName(qName));
  if (attribute != null) {
    value = attribute.getAttributeValue();
  }
  return value;
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

private boolean isEnabled(OMElement element) {
  boolean enabled = true;
  OMAttribute enableAttr = element.getAttribute(new QName("enable"));
  if (enableAttr != null) {
    enabled = Boolean.parseBoolean(enableAttr.getAttributeValue().trim());
  }
  return enabled;
}

代码示例来源:origin: org.apache.axis2/axis2-adb

private void readallChildElements() {
  Iterator childs = parent.getChildElements();
  while (childs.hasNext()) {
    OMElement omElement = (OMElement)childs.next();
    OMAttribute id = omElement.getAttribute(new QName("id"));
    if (id != null) {
      childs.remove();
      elementMap.put(id.getAttributeValue(), omElement);
    }
  }
  filledTable = true;
}

代码示例来源:origin: org.apache.synapse/synapse-core

private static void configureURLMappings(Resource resource, OMElement resourceElt) {
  OMAttribute urlMappingAtt = resourceElt.getAttribute(new QName("url-mapping"));
  OMAttribute uriTemplateAtt = resourceElt.getAttribute(new QName("uri-template"));
  if (urlMappingAtt != null && !"".equals(urlMappingAtt.getAttributeValue())) {
    resource.setDispatcherHelper(new URLMappingHelper(urlMappingAtt.getAttributeValue()));
  } else if (uriTemplateAtt != null && !"".equals(uriTemplateAtt.getAttributeValue())) {
    resource.setDispatcherHelper(new URITemplateHelper(uriTemplateAtt.getAttributeValue()));
  }
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

/**
 * Update the list of modules that is required to be engaged globally.
 */
protected void processModuleRefs(Iterator moduleRefs, AxisConfiguration config) {
  while (moduleRefs.hasNext()) {
    OMElement moduleref = (OMElement) moduleRefs.next();
    OMAttribute moduleRefAttribute = moduleref.getAttribute(new QName(TAG_REFERENCE));
    String refName = moduleRefAttribute.getAttributeValue();
    axisConfig.addGlobalModuleRef(refName);
  }
}

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-truth

public void hasValue(String expected) {
  if (!Objects.equal(getSubject().getAttributeValue(), expected)) {
    fail("has value", expected);
  }
}

代码示例来源:origin: org.apache.synapse/synapse-core

private void setSOAPHeader(HeaderMediator headerMediator, OMElement elem, OMAttribute name) {
  String nameAtt = name.getAttributeValue();
  QName qname = elem.resolveQName(nameAtt);
  if (qname == null) {
    handleException("Invalid QName '" + nameAtt + "' in name attribute");
  } else if (qname.getNamespaceURI().isEmpty()) {
    handleException("Invalid SOAP header: " + nameAtt + " specified at the " +
        "header mediator. All SOAP headers must be namespace qualified.");
  } else {
    headerMediator.setQName(qname);
  }
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public boolean getMustPreserveWhitespace() {
  OMAttribute attr = getAttribute(SPACE);
  String space = (attr != null) ? attr.getAttributeValue() : null;
  Base parent = this.getParentElement();
  return space != null && space.equalsIgnoreCase("preserve") ? true
    : (parent != null && parent instanceof Element) ? ((Element)parent).getMustPreserveWhitespace()
      : (parent != null && parent instanceof Document) ? ((Document)parent).getMustPreserveWhitespace()
        : true;
}

代码示例来源:origin: org.apache.synapse/synapse-core

public Mediator createSpecificMediator(OMElement elem, Properties properties) {
    EventPublisherMediator eventPublisherMediator = new EventPublisherMediator();
    OMAttribute attEventSource = elem.getAttribute(PROP_NAME);
    if (attEventSource != null) {
      eventPublisherMediator.setEventSourceName(attEventSource.getAttributeValue());
    } else {
      handleException(
          "The 'eventSourceName' attribute is required for the EventPublisher mediator");
    }
    return eventPublisherMediator;
  }
}

相关文章