eventcenter.builder.spring.schema.NodeAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ec-builder Show documentation
Show all versions of ec-builder Show documentation
使用ec-builder能够简化事件中心构建实例的配置复杂度
The newest version!
package eventcenter.builder.spring.schema;
import org.w3c.dom.Node;
/**
* Created by liumingjian on 2017/9/30.
*/
public class NodeAttribute {
private final Node node;
public NodeAttribute(Node node){
this.node = node;
}
public Node getNode() {
return node;
}
public String getAttribute(String key){
if(null == node || node.getAttributes() == null){
return null;
}
Node item = node.getAttributes().getNamedItem(key);
return null==item?null:item.getNodeValue();
}
public Long getAttributeLong(String key){
String value = getAttribute(key);
return null == value ? null : Long.parseLong(value);
}
public Integer getAttributeInteger(String key){
String value = getAttribute(key);
return null == value ? null : Integer.parseInt(value);
}
public Boolean getAttribuetBoolean(String key){
String value = getAttribute(key);
return null == value ? null : Boolean.parseBoolean(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy