org.snapscript.studio.agent.ProcessModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap-all Show documentation
Show all versions of snap-all Show documentation
Dynamic scripting for the JVM
package org.snapscript.studio.agent;
import java.util.HashMap;
import java.util.Map;
import org.snapscript.core.scope.Model;
public class ProcessModel implements Model {
public static final String SHORT_ARGUMENTS = "args";
public static final String LONG_ARGUMENTS = "arguments";
private final Map values;
private final Model model;
public ProcessModel(Model model) {
this.values = new HashMap();
this.model = model;
}
public void addAttribute(String name, Object value) {
values.put(name, value);
}
@Override
public Object getAttribute(String name) {
Object value = model.getAttribute(name);
if(value == null) {
return values.get(name);
}
return value;
}
}