org.jdesktop.el.impl.lang.VariableMapperFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swixml Show documentation
Show all versions of swixml Show documentation
GUI generating engine for Java applications
/*
* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Use is
* subject to license terms.
*/
package org.jdesktop.el.impl.lang;
import org.jdesktop.el.ValueExpression;
import org.jdesktop.el.VariableMapper;
public class VariableMapperFactory extends VariableMapper {
private final VariableMapper target;
private VariableMapper momento;
public VariableMapperFactory(VariableMapper target) {
if (target == null) {
throw new NullPointerException("Target VariableMapper cannot be null");
}
this.target = target;
}
public VariableMapper create() {
return this.momento;
}
public ValueExpression resolveVariable(String variable) {
ValueExpression expr = this.target.resolveVariable(variable);
if (expr != null) {
if (this.momento == null) {
this.momento = new VariableMapperImpl();
}
this.momento.setVariable(variable, expr);
}
return expr;
}
public ValueExpression setVariable(String variable, ValueExpression expression) {
throw new UnsupportedOperationException("Cannot Set Variables on Factory");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy