use of org.w3c.dom.NamedNodeMap in project camel by apache.
the class XAdESSignatureProperties method replacePrefix.
protected void replacePrefix(Element el, Input input) {
replacePrefixForNode(el, input);
NamedNodeMap nnm = el.getAttributes();
List<Attr> xmlnsToBeRemoved = new ArrayList<Attr>(2);
int length = nnm.getLength();
for (int i = 0; i < length; i++) {
Node attr = nnm.item(i);
replacePrefixForNode(attr, input);
if (attr.getNodeType() == Node.ATTRIBUTE_NODE) {
if ("xmlns".equals(attr.getLocalName()) || "xmlns".equals(attr.getPrefix())) {
if (XMLSignature.XMLNS.equals(attr.getTextContent()) || findNamespace(input.getMessage()).equals(attr.getTextContent())) {
xmlnsToBeRemoved.add((Attr) attr);
}
}
}
}
// remove xml namespace declaration for XML signature and XAdES namespace
for (Attr toBeRemoved : xmlnsToBeRemoved) {
el.removeAttributeNode(toBeRemoved);
}
}
use of org.w3c.dom.NamedNodeMap in project hazelcast by hazelcast.
the class QueryCacheConfigBuilderHelper method handleEntryListeners.
private void handleEntryListeners(QueryCacheConfig queryCacheConfig, Node childNode) {
for (Node listenerNode : childElements(childNode)) {
if ("entry-listener".equals(cleanNodeName(listenerNode))) {
NamedNodeMap listenerNodeAttributes = listenerNode.getAttributes();
boolean incValue = getBooleanValue(getTextContent(listenerNodeAttributes.getNamedItem("include-value")));
boolean local = getBooleanValue(getTextContent(listenerNodeAttributes.getNamedItem("local")));
String listenerClass = getTextContent(listenerNode);
queryCacheConfig.addEntryListenerConfig(new EntryListenerConfig(listenerClass, local, incValue));
}
}
}
use of org.w3c.dom.NamedNodeMap in project hazelcast by hazelcast.
the class QueryCacheConfigBuilderHelper method queryCachePredicateHandler.
private void queryCachePredicateHandler(Node childNode, QueryCacheConfig queryCacheConfig) {
NamedNodeMap predicateAttributes = childNode.getAttributes();
String predicateType = getTextContent(predicateAttributes.getNamedItem("type"));
String textContent = getTextContent(childNode);
PredicateConfig predicateConfig = new PredicateConfig();
if ("class-name".equals(predicateType)) {
predicateConfig.setClassName(textContent);
} else if ("sql".equals(predicateType)) {
predicateConfig.setSql(textContent);
}
queryCacheConfig.setPredicateConfig(predicateConfig);
}
use of org.w3c.dom.NamedNodeMap in project hazelcast by hazelcast.
the class XmlClientConfigBuilder method handleDiscoveryNodeFilter.
private void handleDiscoveryNodeFilter(Node node, DiscoveryConfig discoveryConfig) {
NamedNodeMap atts = node.getAttributes();
Node att = atts.getNamedItem("class");
if (att != null) {
discoveryConfig.setNodeFilterClass(getTextContent(att).trim());
}
}
use of org.w3c.dom.NamedNodeMap in project hazelcast by hazelcast.
the class XmlClientConfigBuilder method handleAwsAttributes.
private ClientAwsConfig handleAwsAttributes(Node node) {
NamedNodeMap atts = node.getAttributes();
ClientAwsConfig clientAwsConfig = new ClientAwsConfig();
for (int i = 0; i < atts.getLength(); i++) {
Node att = atts.item(i);
String value = getTextContent(att).trim();
if ("enabled".equalsIgnoreCase(att.getNodeName())) {
clientAwsConfig.setEnabled(getBooleanValue(value));
} else if (att.getNodeName().equals("connection-timeout-seconds")) {
int timeout = getIntegerValue("connection-timeout-seconds", value);
clientAwsConfig.setConnectionTimeoutSeconds(timeout);
}
}
return clientAwsConfig;
}
Aggregations