All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.legaldocml.xpath.impl.XPathQnameBuilder Maven / Gradle / Ivy

package io.legaldocml.xpath.impl;

/**
 * @author Jacques Militello
 */
final class XPathQnameBuilder {

    private final String[] values = new String[2];

    public void reset() {
        this.values[0] = null;
        this.values[1] = null;
    }

    public void append(String ncName) {
        if (this.values[0] == null) {
            this.values[0] = ncName;
        } else {
            this.values[1] = ncName;
        }
    }

    public XPathQname build() {
        if (this.values[1] == null) {
            return new XPathQname(null, this.values[0]);
        } else {
            return new XPathQname(this.values[0], this.values[1]);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy