コード例 #1
0
ファイル: Settings.java プロジェクト: kabassociates/pivot4j
  /**
   * @param context
   * @return
   */
  protected ExpressionContext createELContext(FacesContext context) {
    ExpressionContext elContext = new ExpressionContext();

    elContext.put("FS", File.separator);

    elContext.put("userHome", System.getProperty("user.dir"));
    elContext.put("appHome", applicationHome.getPath());

    ServletContext servletContext = (ServletContext) context.getExternalContext().getContext();
    String webRoot = servletContext.getRealPath("/WEB-INF");

    if (webRoot != null) {
      elContext.put("webRoot", webRoot);
    }

    return elContext;
  }
コード例 #2
0
 /** @see java.util.HashMap#containsKey(java.lang.Object) */
 @Override
 public boolean containsKey(Object key) {
   if (super.containsKey(key)) {
     return true;
   } else {
     return parent != null && parent.containsKey(key);
   }
 }
コード例 #3
0
  /** @see java.util.HashMap#get(java.lang.Object) */
  @Override
  public Object get(Object key) {
    Object value = null;

    if (super.containsKey(key)) {
      value = super.get(key);
    } else if (parent != null) {
      value = parent.get(key);
    }

    if (value instanceof ValueBinding) {
      value = ((ValueBinding<?>) value).getValue();
    }

    return value;
  }
コード例 #4
0
  /** @see java.util.HashMap#keySet() */
  @Override
  public Set<String> keySet() {
    Set<String> keySet = super.keySet();

    if (parent != null) {
      keySet = new HashSet<String>(keySet);

      Set<String> parentSet = parent.keySet();

      for (String key : parentSet) {
        if (!keySet.contains(key)) {
          keySet.add(key);
        }
      }
    }

    return keySet;
  }
コード例 #5
0
 /** @see java.util.HashMap#isEmpty() */
 @Override
 public boolean isEmpty() {
   return super.isEmpty() && (parent == null || parent.isEmpty());
 }