Environment.java :  » ERP-CRM-Financial » OpenXava-3.0 » org » openxava » controller » Java Open Source

Java Open Source » ERP CRM Financial » OpenXava 3.0 
OpenXava 3.0 » org » openxava » controller » Environment.java
package org.openxava.controller;

import java.util.*;



import org.openxava.component.MetaComponent;
import org.openxava.controller.meta.*;
import org.openxava.util.*;

/**
 * It read first the variables sent on create (it extracted from module),
 * and then all variable defined in controllers. <p>
 * 
 * @author Javier Paniza
 */

public class Environment implements java.io.Serializable {
  
  private Map localVariables;
  
  
  public Environment(Map localVariables) {
    this.localVariables = localVariables;
  }

  /**
   * @return Null if does not exists.
   */
  public String getValue(String name) throws XavaException {
    String value = null;
    if (localVariables != null) {
      value = (String) localVariables.get(name);
    }
    if (value != null) return value;
    return MetaControllers.getEnvironmentVariable(name);
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.