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

org.kefirsf.bb.proc.ProcNamedElement 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.proc;

/**
 * Named element are variable and text ProcPatternElement or ProcTemplateElement
 */
public abstract class ProcNamedElement {
    /**
     * Variable name
     */
    private final String name;

    /**
     * Create named element
     *
     * @param name name of element
     */
    protected ProcNamedElement(String name) {
        this.name = name;
    }

    /**
     * Get element name
     *
     * @return element name
     */
    public String getName() {
        return name;
    }

    /**
     * Add attribute with name of this element name and value value to context.
     *
     * @param context context
     * @param value   variable value
     */
    protected void setAttribute(Context context, CharSequence value) {
        context.setAttribute(name, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy