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

cdc.mf.html.adaptors.SnapshotDataAdaptor Maven / Gradle / Ivy

The newest version!
package cdc.mf.html.adaptors;

import org.stringtemplate.v4.Interpreter;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.misc.ObjectModelAdaptor;
import org.stringtemplate.v4.misc.STNoSuchPropertyException;

import cdc.issues.io.SnapshotData;
import cdc.mf.html.MfHtmlGenerationArgs;

public class SnapshotDataAdaptor extends ObjectModelAdaptor {
    @SuppressWarnings("unused")
    private final MfHtmlGenerationArgs args;

    public SnapshotDataAdaptor(MfHtmlGenerationArgs args) {
        this.args = args;
    }

    @Override
    public synchronized Object getProperty(Interpreter interp,
                                           ST self,
                                           SnapshotData snapshot,
                                           Object property,
                                           String propertyName) throws STNoSuchPropertyException {
        switch (propertyName) {
        case "kind":
            return "snapshot";
        case "displayName":
            return snapshot.getSnapshotName();
        default:
            break;
        }

        return super.getProperty(interp, self, snapshot, property, propertyName);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy