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

net.thevpc.jeep.core.nodes.JNodeConverter Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package net.thevpc.jeep.core.nodes;

import net.thevpc.jeep.JConverter;
import net.thevpc.jeep.util.JTypeUtils;

public class JNodeConverter extends JDefaultNode {

    private final JConverter currentConverter;
    private final JDefaultNode node;

    public JNodeConverter(JDefaultNode node, JConverter currentConverter) {
        super();
        this.currentConverter = currentConverter;
        this.node = node;
    }
    @Override
    public int id() {
        return JNodeDefaultIds.NODE_CONVERTER;
    }

//    @Override
//    public JType getType(JContext context) {
//        return currentConverter.targetType();
//    }


//    @Override
//    public Object evaluate(JContext context) {
//        return currentConverter.convert(node.evaluate(context), context);
//    }

    public JConverter getCurrentConverter() {
        return currentConverter;
    }

    public JDefaultNode getNode() {
        return node;
    }

    public String toString() {
        return "(" + JTypeUtils.str(currentConverter.targetType()) + ")" + node.toString()
                ;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy