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

org.kefirsf.bb.conf.ElementListOwner Maven / Gradle / Ivy

Go to download

KefirBB is a Java-library for text processing. Initially it was developed for BB2HTML translation. But flexible configuration allows to use it in different cases. For example for parsing Markdown, Textile, and for HTML filtration.

The newest version!
package org.kefirsf.bb.conf;

import java.util.Collections;
import java.util.List;

/**
 * Base abstract class for pattern and template configuration classes.
 *
 * @author kefir
 */
abstract class ElementListOwner {
    /**
     * Collection of elements PatternElement or TemplateElement
     */
    private List elements;

    /**
     * The default constructor.
     */
    protected ElementListOwner() {
        elements = Collections.emptyList();
    }

    /**
     * @param elements pattern or template elements.
     */
    protected ElementListOwner(List elements) {
        this.elements = Collections.unmodifiableList(elements);
    }

    /**
     * Get pattern elements
     *
     * @return elements list
     */
    public List getElements() {
        return elements;
    }

    /**
     * Set pattern elements
     *
     * @param elements elements list
     */
    public void setElements(List elements) {
        this.elements = Collections.unmodifiableList(elements);
    }

    public boolean isEmpty() {
        return elements == null || elements.isEmpty();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy