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

org.qbicc.graph.literal.StaticFieldLiteral Maven / Gradle / Ivy

There is a newer version: 0.77.0
Show newest version
package org.qbicc.graph.literal;

import org.qbicc.type.definition.element.StaticFieldElement;
import org.qbicc.type.definition.element.VariableElement;

/**
 * A literal for a static field.
 */
public class StaticFieldLiteral extends VariableLiteral {
    StaticFieldLiteral(StaticFieldElement variable) {
        super(variable);
    }

    StaticFieldLiteral(VariableElement variable) {
        this((StaticFieldElement) variable);
    }

    @Override
    public StaticFieldElement getVariableElement() {
        return (StaticFieldElement) super.getVariableElement();
    }

    @Override
    public StringBuilder toReferenceString(StringBuilder b) {
        StaticFieldElement sfe = getVariableElement();
        return b.append('@').append(sfe.getEnclosingType().getInternalName().replace('/', '.')).append('.').append(sfe.getName());
    }

    @Override
    public  R accept(LiteralVisitor visitor, T param) {
        return visitor.visit(param, this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy