Package de.odysseus.calyxo.base.util

Examples of de.odysseus.calyxo.base.util.MapFacade


  /**
   * Get Map to serve attributes from module scope
   */
  public Map getAttribute() {
    if (attribute == null) {
      attribute = new MapFacade() {
        public Object get(Object key) {
          if (key == null) {
            return null;
          }
          return context.getAttribute(key.toString());
View Full Code Here


      this.locale = locale;
    }
   
    public Map getValue() {
      if (valueMap == null) {
        valueMap = new MapFacade() {
          public Object get(Object key) {
            return model.getValue((String)key);
          }
        };
      }
View Full Code Here

      return valueMap;
    }
   
    public Map getLabel() {
      if (labelMap == null) {
        labelMap = new MapFacade() {
          public Object get(Object value) {
            return model.getLabel(value, locale);
          }
        };
      }
View Full Code Here

      return labelMap;
    }
   
    public Map getKey() {
      if (keyMap == null) {
        keyMap = new MapFacade() {
          public Object get(Object value) {
            return model.getKey(value);
          }
        };
      }
View Full Code Here

   * if the accessor states that it is cachable.
   *
   * @see Accessor#isCacheable()
   */
  public Object get(final HttpServletRequest request) {
    return new MapFacade() {
      private Map cache;
      public Object get(Object key) {
        Accessor accessor = AccessorMap.this.get(key);
        if (accessor == null) {
          throw new AccessException("No such accessor: " + key);
View Full Code Here

   * <code>get(HttpServletRequest, Object)</code> and calls
   * to <code>toString()</code> to outer class method
   * <code>@link #toString(HttpServletRequest)</code>
   */
  public final Object get(final HttpServletRequest request) {
    return new MapFacade() {
      public Object get(Object key) {
        return DynamicMapAccessor.this.get(request, key);
      }
      public String toString() {
        return DynamicMapAccessor.this.toString(request);
View Full Code Here

     * Answer a map to serve resource strings by key
     * Use like <code>resource[key]</code>
     */
    public Map getResource() {
      if (resource == null) {
        resource = new MapFacade() {
          public Object get(Object key) {
            return support.getResource(locale, bundle, key.toString());
          }
        };
      }
View Full Code Here

     * Answer a map to serve message strings by key and args.
     * Use like <code>message[key][arg1][...]</code>.
     */
    public Map getMessage() {
      if (message == null) {
        message = new MapFacade() {
          public Object get(final Object key) {
            return new MapFacade() {
              private ArrayList args = EMPTY_ARRAY_LIST;
              public Object get(Object value) {
                if (args == EMPTY_ARRAY_LIST) {
                  args = new ArrayList(4);
                }
View Full Code Here

    /**
     * Answer a map to serve bundle beans by name
     */
    public Map getBundle() {
      if (bundle == null) {
        bundle = new MapFacade() {
          public Object get(Object key) {
            return new BundleBean(locale, key.toString());
          }
        };
      }
View Full Code Here

    /**
     * Answer a map to format instances of {@link Message}.
     */
    public Map getFormat() {
      if (format == null) {
        format = new MapFacade() {
          public Object get(Object key) {
            return ((Message)key).format(locale, support);
          }
        };
      }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.util.MapFacade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.