org.xs4j.XMLNodeFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xmlslurper Show documentation
Show all versions of xmlslurper Show documentation
An attempt to port parsing capabilities offered by Groovy XMLSlurper into the Java world. The following is not planned to be accurate projection, instead the most useful functions will be implemented.
The newest version!
package org.xs4j;
import javax.xml.XMLConstants;
import java.util.Map;
/**
* Created by mturski on 11/8/2016.
*/
public final class XMLNodeFactory {
public static final String QNAME_SEPARATOR = ":";
public static final String XMLNS_WITH_SEPARATOR = XMLConstants.XMLNS_ATTRIBUTE + QNAME_SEPARATOR;
public static XMLNodeFactory getInstance() {
return new XMLNodeFactory();
}
private XMLNodeFactory() {
}
public final XMLNode createNode(long id, String localName, Map attributeByName) {
return new XMLNodeImpl(id, null, null, localName, attributeByName);
}
public final XMLNode createNode(long id, String namespace, String prefix, String localName, Map attributeByName) {
return new XMLNodeImpl(id, namespace, prefix, localName, attributeByName);
}
}