Package freemarker.ext.beans

Examples of freemarker.ext.beans.MapModel


    if (obj instanceof Collection<?>) { return new SimpleSequence((Collection<?>) obj, this); }
    if (obj instanceof Map<?, ?>) {
      if (altMapWrapper) {
        return new FriendlyMapModel((Map<?, ?>) obj, this);
      } else {
        return new MapModel((Map<?, ?>) obj, this);
      }
    }
    return super.wrap(obj);
  }
View Full Code Here


                    map.put( Character.toLowerCase(p.charAt(0)) + p.substring(1), value.toString());   
                   
                }
          
                SimpleHash model = new SimpleHash();
                model.put( "properties", new MapModel(map, this) );
                model.put( "className", clazz.getSimpleName() );
               
                wrapInternal(map, model, (T) object);
                return model;
            }
View Full Code Here

    if (obj instanceof Collection<?>) { return new SimpleSequence((Collection<?>) obj, this); }
    if (obj instanceof Map<?, ?>) {
      if (altMapWrapper) {
        return new FriendlyMapModel((Map<?, ?>) obj, this);
      } else {
        return new MapModel((Map<?, ?>) obj, this);
      }
    }
    return super.wrap(obj);
  }
View Full Code Here

        objectWrapper = new DefaultObjectWrapper() {
            @Override
            public TemplateModel wrap(Object obj) throws TemplateModelException {
                if (obj instanceof Map) {
                    return new MapModel((Map) obj, beansWrapper);
                }
                return super.wrap(obj);
            }
        };
    }
View Full Code Here

                    map.put( Character.toLowerCase(p.charAt(0)) + p.substring(1), value.toString());   
                   
                }
          
                SimpleHash model = new SimpleHash();
                model.put( "properties", new MapModel(map, this) );
                model.put( "className", clazz.getSimpleName() );
               
                wrapInternal(map, model, (T) object);
                return model;
            }
View Full Code Here

        Configuration cfg = super.createConfiguration(data, clazz);
        cfg.setClassForTemplateLoading(getClass(), "templates");
        cfg.setObjectWrapper(new ObjectToMapWrapper<LayerAttributesList>(LayerAttributesList.class) {
                  @Override
                  protected void wrapInternal(Map properties, SimpleHash model, LayerAttributesList object) {
                      properties.put( "attributes", new MapModel( object.attributes, new ObjectToMapWrapper(LayerAttributesList.class) ) );
                  }
              });
       
        return cfg;
      }
View Full Code Here

        final Configuration cfg = super.createConfiguration(data, clazz);
        cfg.setClassForTemplateLoading(getClass(), "templates");
        cfg.setObjectWrapper(new ObjectToMapWrapper<LayerAttributesList>(LayerAttributesList.class) {
                  @Override
                  protected void wrapInternal(Map properties, SimpleHash model, LayerAttributesList object) {
                      properties.put( "attributes", new MapModel( object.attributes, new ObjectToMapWrapper(LayerAttributesList.class) ) );
                  }
              });
       
        return cfg;
      }
View Full Code Here

                    map.put( Character.toLowerCase(p.charAt(0)) + p.substring(1), value.toString());   
                   
                }
          
                SimpleHash model = new SimpleHash();
                model.put( "properties", new MapModel(map, this) );
                model.put( "className", clazz.getSimpleName() );
               
                wrapInternal(map, model, (T) object);
                return model;
            }
View Full Code Here

TOP

Related Classes of freemarker.ext.beans.MapModel

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.