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

org.serversass.ast.MixinReference Maven / Gradle / Ivy

There is a newer version: 5.0.1
Show newest version
/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package org.serversass.ast;

import java.util.ArrayList;
import java.util.List;

/**
 * Represents a reference to a mixin generated by an include instruction.
 */
public class MixinReference {

    private String name;
    private List parameters = new ArrayList();

    /**
     * Returns the name of the referenced mixin
     *
     * @return the name of the mixin
     */
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("@include ");
        FunctionCall.appendNameAndParameters(sb, name, parameters);
        return sb.toString();
    }

    /**
     * Sets the name of the referenced mixin
     *
     * @param name the name of the mixin being referenced
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Adds an expression as parameter
     *
     * @param expression the expression to add
     */
    public void addParameter(Expression expression) {
        parameters.add(expression);
    }

    /**
     * Returns all parameters
     *
     * @return a list of parameters used to call the mixin
     */
    public List getParameters() {
        return parameters;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy