本文整理了Java中org.apache.axiom.om.OMElement.getText()
方法的一些代码示例,展示了OMElement.getText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OMElement.getText()
方法的具体详情如下:
包路径:org.apache.axiom.om.OMElement
类名称:OMElement
方法名:getText
[英]Returns the non-empty text children as a string.
This method iterates over all the text children of the element and concatenates them to a single string. Only direct children will be considered, i.e. the text is not extracted recursively. For example the return value for <element>A<child>B</child>C</element> will be AC.
All whitespace will be preserved.
[中]以字符串形式返回非空文本子项。
此方法迭代元素的所有文本子元素,并将它们连接到单个字符串。只考虑直接子项,即文本不是递归提取的。例如,<element>A<child>B</child>C</element>的返回值将是AC。
所有空白将被保留。
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
public int compare(OMElement o1, OMElement o2) {
long o1Value = Long.parseLong(o1.getText());
long o2Value = Long.parseLong(o2.getText());
if (o1Value < o2Value) {
return 1;
} else if (o1Value > o2Value) {
return -1;
} else {
return 0;
}
}
});
代码示例来源:origin: org.apache.axis2/axis2-kernel
public String getURL() {
String urlValue = null;
OMElement url = data.getFirstChildWithName(new QName(
DRConstants.SERVICE_DATA.URL));
if (url != null) {
urlValue = url.getText();
}
return urlValue;
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
public void setSmartLifecycleLinks(OMElement locationConfiguration) throws RegistryException {
Iterator confElements = locationConfiguration.getChildElements();
while (confElements.hasNext()) {
OMElement confElement = (OMElement)confElements.next();
if (confElement.getQName().equals(new QName("key"))) {
smartLifecycleLinks.add(confElement.getText());
}
}
}
代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth
private void parseClientIdValidationRegex(OMElement oauthConfigElem) {
OMElement clientIdValidationRegexConfigElem = oauthConfigElem
.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.CLIENT_ID_VALIDATE_REGEX));
if (clientIdValidationRegexConfigElem != null && !"".equals(clientIdValidationRegexConfigElem.getText().trim())) {
clientIdValidationRegex = clientIdValidationRegexConfigElem.getText().trim();
}
if (log.isDebugEnabled()) {
log.debug("Client id validation regex is set to: " + clientIdValidationRegex);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth
private void parseTokenPersistenceProcessorConfig(OMElement oauthConfigElem) {
OMElement persistenceprocessorConfigElem =
oauthConfigElem.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.TOKEN_PERSISTENCE_PROCESSOR));
if (persistenceprocessorConfigElem != null &&
StringUtils.isNotBlank(persistenceprocessorConfigElem.getText())) {
tokenPersistenceProcessorClassName = persistenceprocessorConfigElem.getText().trim();
}
if (log.isDebugEnabled()) {
log.debug("Token Persistence Processor was set to : " + tokenPersistenceProcessorClassName);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth
private static String loadClaimConfig(OMElement configElement) {
StringBuilder claimConfig = new StringBuilder();
Iterator it = configElement.getChildElements();
while (it.hasNext()) {
OMElement element = (OMElement) it.next();
if ("Claim".equals(element.getLocalName())) {
claimConfig.append(element.getText());
}
}
return claimConfig.toString();
}
}
代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth
private void parseUseSPTenantDomainConfig(OMElement oauthElem) {
OMElement useSPTenantDomainValueElement = oauthElem
.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.OAUTH_USE_SP_TENANT_DOMAIN));
if (useSPTenantDomainValueElement != null) {
useSPTenantDomainValue = Boolean.parseBoolean(useSPTenantDomainValueElement.getText().trim());
}
if (log.isDebugEnabled()) {
log.debug("Use SP tenant domain value is set to: " + useSPTenantDomainValue);
}
}
代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth
private void parseMapFederatedUsersToLocalConfiguration(OMElement oauthConfigElem) {
OMElement mapFederatedUsersToLocalConfigElem = oauthConfigElem.getFirstChildWithName(getQNameWithIdentityNS(
ConfigElements.MAP_FED_USERS_TO_LOCAL));
if (mapFederatedUsersToLocalConfigElem != null) {
mapFederatedUsersToLocal = Boolean.parseBoolean(mapFederatedUsersToLocalConfigElem.getText());
}
if (log.isDebugEnabled()) {
log.debug("MapFederatedUsersToLocal was set to : " + mapFederatedUsersToLocal);
}
}
代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth
private void parseImplicitErrorFragment(OMElement oauthConfigElem) {
OMElement implicitErrorFragmentElem =
oauthConfigElem.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.IMPLICIT_ERROR_FRAGMENT));
if (implicitErrorFragmentElem != null) {
isImplicitErrorFragment =
Boolean.parseBoolean(implicitErrorFragmentElem.getText());
}
if (log.isDebugEnabled()) {
log.debug("ImplicitErrorFragment was set to : " + isImplicitErrorFragment);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth
private void parseCachingConfiguration(OMElement oauthConfigElem) {
OMElement enableCacheElem =
oauthConfigElem.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.ENABLE_CACHE));
if (enableCacheElem != null) {
cacheEnabled = Boolean.parseBoolean(enableCacheElem.getText());
}
if (log.isDebugEnabled()) {
log.debug("Enable OAuth Cache was set to : " + cacheEnabled);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth
private void parseImplicitErrorFragment(OMElement oauthConfigElem) {
OMElement implicitErrorFragmentElem =
oauthConfigElem.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.IMPLICIT_ERROR_FRAGMENT));
if (implicitErrorFragmentElem != null) {
isImplicitErrorFragment =
Boolean.parseBoolean(implicitErrorFragmentElem.getText());
}
if (log.isDebugEnabled()) {
log.debug("ImplicitErrorFragment was set to : " + isImplicitErrorFragment);
}
}
代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth
private void parseHashAlgorithm(OMElement oauthConfigElem) {
OMElement hashingAlgorithmElement = oauthConfigElem
.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.HASH_ALGORITHM));
if (hashingAlgorithmElement != null) {
hashAlgorithm = hashingAlgorithmElement.getText();
}
if (log.isDebugEnabled()) {
log.debug("Hash algorithm was set to : " + hashAlgorithm);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth
private void parseAccessTokenPartitioningDomainsConfig(OMElement oauthConfigElem) {
OMElement enableAccessTokenPartitioningElem =
oauthConfigElem.getFirstChildWithName(getQNameWithIdentityNS(ConfigElements.ACCESS_TOKEN_PARTITIONING_DOMAINS));
if (enableAccessTokenPartitioningElem != null) {
accessTokenPartitioningDomains = enableAccessTokenPartitioningElem.getText();
}
if (log.isDebugEnabled()) {
log.debug("Enable OAuth Access Token Partitioning Domains was set to : " +
accessTokenPartitioningDomains);
}
}
代码示例来源: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.apache.sandesha2/sandesha2-core
public Object fromOMElement(OMElement msgNumberPart) throws OMException {
if (msgNumberPart==null)
throw new OMException (SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.noMessageNumberPartInElement));
String msgNoStr = msgNumberPart.getText();
messageNumber = Long.parseLong(msgNoStr);
return this;
}
代码示例来源:origin: org.apache.rampart/rampart-policy
private void processElement(OMElement element, SignedEncryptedElements parent) {
QName name = element.getQName();
if (SP11Constants.XPATH.equals(name)) {
parent.addXPathExpression(element.getText());
Iterator namespaces = element.getNamespacesInScope();
while (namespaces.hasNext()) {
OMNamespace nm = (OMNamespace) namespaces.next();
parent.addDeclaredNamespaces(nm.getNamespaceURI(), nm.getPrefix());
}
}
}
代码示例来源:origin: org.apache.synapse/synapse-core
protected String getValue(OMElement elt, QName qName) {
OMElement e = elt.getFirstChildWithName(qName);
if (e != null) {
return e.getText();
} else {
handleException("Unable to read configuration value for : " + qName);
}
return null;
}
private void readAuthenticationEndpointRetryURL(OMElement documentElement) {
OMElement authEndpointRetryURLElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATION_ENDPOINT_RETRY_URL));
if (authEndpointRetryURLElem != null) {
authenticationEndpointRetryURL = IdentityUtil.fillURLPlaceholders(authEndpointRetryURLElem.getText());
}
}
private void readAuthenticationEndpointPromptURL(OMElement documentElement) {
OMElement authEndpointPromptURLElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATION_ENDPOINT_PROMPT_URL));
if (authEndpointPromptURLElem != null) {
authenticationEndpointPromptURL = IdentityUtil.fillURLPlaceholders(authEndpointPromptURLElem.getText());
}
}
private void readAuthenticationEndpointMissingClaimsURL(OMElement documentElement) {
OMElement authEndpointMissingClaimsURLElem = documentElement.getFirstChildWithName
(IdentityApplicationManagementUtil.getQNameWithIdentityApplicationNS(FrameworkConstants.Config
.QNAME_AUTHENTICATION_ENDPOINT_MISSING_CLAIMS_URL));
if (authEndpointMissingClaimsURLElem != null) {
authenticationEndpointMissingClaimsURL = IdentityUtil.fillURLPlaceholders
(authEndpointMissingClaimsURLElem.getText());
}
}
内容来源于网络,如有侵权,请联系作者删除!