org.kefirsf.bb.conf.ElementListOwner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kefirbb Show documentation
Show all versions of kefirbb Show documentation
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 extends T> elements;
/**
* The default constructor.
*/
protected ElementListOwner() {
elements = Collections.emptyList();
}
/**
* @param elements pattern or template elements.
*/
protected ElementListOwner(List extends T> elements) {
this.elements = Collections.unmodifiableList(elements);
}
/**
* Get pattern elements
*
* @return elements list
*/
public List extends T> getElements() {
return elements;
}
/**
* Set pattern elements
*
* @param elements elements list
*/
public void setElements(List extends T> elements) {
this.elements = Collections.unmodifiableList(elements);
}
public boolean isEmpty() {
return elements == null || elements.isEmpty();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy