本文整理了Java中org.apache.axiom.om.OMElement.getAttributeValue()
方法的一些代码示例,展示了OMElement.getAttributeValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OMElement.getAttributeValue()
方法的具体详情如下:
包路径:org.apache.axiom.om.OMElement
类名称:OMElement
方法名:getAttributeValue
[英]Returns a named attribute's value, if present.
[中]返回命名属性的值(如果存在)。
代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core
private static String getConfigId(OMElement configEl) {
String configId = configEl.getAttributeValue(new QName(DBSFields.ID));
if (configId == null) {
configId = DBConstants.DEFAULT_CONFIG_ID;
}
return configId;
}
代码示例来源:origin: org.wso2.maven/maven-synapse-plugin
/**
* {@inheritDoc}
*/
protected String getArtifactName(OMElement artifactDefinition) {
return artifactDefinition.getAttributeValue(new QName("name"));
}
代码示例来源:origin: org.wso2.maven/maven-synapse-plugin
/**
* {@inheritDoc}
*/
protected String getArtifactName(OMElement artifactDefinition) {
return artifactDefinition.getAttributeValue(new QName("name"));
}
代码示例来源:origin: org.apache.synapse/synapse-core
/**
* This method will check the given OMElement represent either a static property or not
*
* @param property - OMElement to be checked for the static property
* @return boolean true if the elemet represents a static property element false otherwise
*/
public static boolean isStaticProperty(OMElement property) {
return "property".equals(property.getLocalName().toLowerCase())
&& (property.getAttributeValue(new QName("expression")) == null);
}
代码示例来源:origin: org.apache.synapse/synapse-core
private void setParameter(Endpoint endpoint, OMElement paramEle) throws IllegalAccessException,
InvocationTargetException,
NoSuchMethodException {
String name = paramEle.getAttributeValue(new QName("name"));
String value = paramEle.getText();
PropertyHelper.setInstanceProperty(name, value, endpoint);
}
}
代码示例来源:origin: org.ow2.petals/petals-bc-soap
/**
* Get the HREF ID from the givem element if exists.
*
* @param element
* to get HREF id from
* @return id or empty string if not found
*/
public static String getHrefId(OMElement element) {
return ((element != null) && (element.getAttribute(HREF) != null)) ? element
.getAttributeValue(HREF).substring(1)
: "";
}
代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core
private static PatternValidator getPatternValidator(OMElement valEl) {
String regEx = valEl.getAttributeValue(new QName(DBSFields.PATTERN));
PatternValidator validator = new PatternValidator(regEx);
return validator;
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
public void setStates(OMElement locationConfiguration) throws RegistryException {
Iterator confElements = locationConfiguration.getChildElements();
while (confElements.hasNext()) {
OMElement confElement = (OMElement)confElements.next();
if (confElement.getQName().equals(new QName("state"))) {
states.put(confElement.getAttributeValue(new QName("key")), confElement.getText());
}
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
public static PermissionsBean createPermissionBean(OMElement permChild) {
PermissionsBean permBean = new PermissionsBean();
permBean.setForEvent(permChild.getAttributeValue(new QName(LifecycleConstants.FOR_EVENT)));
if (permChild.getAttributeValue(new QName("roles")) != null)
permBean.setRoles(Arrays.asList(permChild.getAttributeValue(new QName("roles"))
.split(",")));
return permBean;
}
代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core
public static EventTrigger createEventTrigger(DataService dataService,
OMElement eventEl) throws DataServiceFault {
String language = eventEl.getAttributeValue(new QName(DBSFields.LANGUAGE));
/* default language is 'XPath' */
if (language == null || language.equals(EventTriggerLanguages.XPATH)) {
return createXPathEventTrigger(dataService, eventEl);
} else {
return null;
}
}
代码示例来源:origin: org.apache.synapse/synapse-commons
/**
* This method will check the given OMElement represent either a static property or not
*
* @param property - OMElement to be checked for the static property
* @return boolean true if the elemet represents a static property element false otherwise
*/
public static boolean isStaticProperty(OMElement property) {
return "property".equals(property.getLocalName().toLowerCase())
&& (property.getAttributeValue(new QName("expression")) == null);
}
代码示例来源:origin: org.apache.axis2/axis2-kernel
HandlerDescription makeHandler(OMElement handlerElement) {
String name = handlerElement.getAttributeValue(new QName("name"));
QName qname = handlerElement.resolveQName(name);
HandlerDescription desc = new HandlerDescription(qname.getLocalPart());
String className = handlerElement.getAttributeValue(new QName("class"));
desc.setClassName(className);
return desc;
}
代码示例来源:origin: org.wso2.mercury/mercury-core
public static AcknowledgmentRange fromOM(OMElement omElement) throws RMMessageBuildingException {
String rmNamespace = omElement.getNamespace().getNamespaceURI();
long upperLimit = Long.parseLong(omElement.getAttributeValue(new QName(null, MercuryConstants.UPPER)));
long lowerLimit = Long.parseLong(omElement.getAttributeValue(new QName(null, MercuryConstants.LOWER)));
AcknowledgmentRange acknowledgmentRange = new AcknowledgmentRange(rmNamespace);
acknowledgmentRange.setUpper(upperLimit);
acknowledgmentRange.setLower(lowerLimit);
return acknowledgmentRange;
}
代码示例来源:origin: org.apache.synapse/synapse-core
private void populatePropertyName(BeanMediator mediator, OMElement elem) {
String attributeValue;
attributeValue = elem.getAttributeValue(new QName(BeanConstants.PROPERTY));
if (attributeValue != null) {
mediator.setPropertyName(attributeValue);
} else {
handleException("'property' attribute of Bean mediator is required when " +
"SET/GET_PROPERTY action is set.");
}
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
@Override
public final String getAttributeValue(QName name) {
try {
return getAxiomElement().getAttributeValue(name);
}
catch (OMException ex) {
throw new AxiomSoapElementException(ex);
}
}
代码示例来源:origin: org.wso2.am/org.wso2.am.integration.common.test.utils
public static void addEndpoint(String backEndUrl, String sessionCookie, OMElement endpointConfig)
throws Exception {
EndPointAdminClient endPointAdminClient =
new EndPointAdminClient(backEndUrl, sessionCookie);
endPointAdminClient.addEndPoint(endpointConfig);
String ep = endpointConfig.getAttributeValue(new QName(NAME));
assertTrue(isEndpointDeployed(backEndUrl, sessionCookie, ep),
ep + "Endpoint deployment not found or time out");
}
代码示例来源:origin: org.wso2.am/org.wso2.am.integration.common.test.utils
public static void addScheduleTask(String backEndUrl, String sessionCookie, OMElement taskDescription)
throws TaskManagementException, RemoteException {
TaskAdminClient taskAdminClient = new TaskAdminClient(backEndUrl, sessionCookie);
taskAdminClient.addTask(taskDescription);
assertTrue(isScheduleTaskDeployed(backEndUrl, sessionCookie,
taskDescription.getAttributeValue(new QName("name"))),
"ScheduleTask deployment failed"
);
}
代码示例来源:origin: org.apache.axis2/axis2-kernel
public Phase makePhase(OMElement phaseElement) throws PhaseException {
String phaseName = phaseElement.getAttributeValue(new QName("name"));
Phase phase = new Phase(phaseName);
Iterator children = phaseElement.getChildElements();
while (children.hasNext()) {
OMElement handlerElement = (OMElement) children.next();
HandlerDescription handlerDesc = makeHandler(handlerElement);
phase.addHandler(handlerDesc);
}
return phase;
}
代码示例来源:origin: org.apache.synapse/synapse-core
private void populateGetPropertyCase(BeanMediator mediator, OMElement elem) {
mediator.setAction(BeanMediator.Action.GET_PROPERTY);
populatePropertyName(mediator, elem);
if (elem.getAttributeValue(new QName(BeanConstants.TARGET)) != null) {
mediator.setTarget(new Target(BeanConstants.TARGET, elem));
} else {
handleException("'target' attribute of Bean mediator is required when 'GET_PROPERTY' " +
"action is set.");
}
}
代码示例来源:origin: org.apache.synapse/synapse-core
private void populateSetPropertyCase(BeanMediator mediator, OMElement elem) {
mediator.setAction(BeanMediator.Action.SET_PROPERTY);
populatePropertyName(mediator, elem);
if (elem.getAttributeValue(ATT_VALUE) != null) {
mediator.setValue(new ValueFactory().createValue(BeanConstants.VALUE, elem));
} else {
handleException("'value' attribute of Bean mediator is required when 'SET_PROPERTY' " +
"action is set.");
}
}
内容来源于网络,如有侵权,请联系作者删除!