congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MapWrapper
Code IndexAdd Tabnine to your IDE (free)

How to use
MapWrapper
in
org.jboss.seam.remoting.wrapper

Best Java code snippets using org.jboss.seam.remoting.wrapper.MapWrapper (Showing top 10 results out of 315)

origin: stackoverflow.com

 Gson gson = new Gson();
MapWrapper wrapper = new MapWrapper();
wrapper.setMyMap(HtKpi);
String serializedMap = gson.toJson(wrapper);
// add 'serializedMap' to preferences
origin: stackoverflow.com

 @Controller
public class MapController {
  @GetMapping("map.html")
  public String get(Map<String, Object> model) throws Exception {
    MapWrapper wrapper = new MapWrapper();
    wrapper.getMap().put("1", "One");
    wrapper.getMap().put("2", "Two");
    wrapper.getMap().put("3", "Three");

    model.put("wrapper", wrapper);
    return "map";
  }

  @PostMapping("map.html")
  public String post(Map<String, Object> model, @ModelAttribute("wrapper") MapWrapper wrapper) throws Exception {
    return "map";
  }
}
origin: stackoverflow.com

 /**
 * <p>
 * ref: http://stackoverflow.com/questions/21382202/use-jaxb-xmlanyelement-type-of-style-to-return-dynamic-element-names
 * </p>
 * @author MEC
 *
 */
public static class MapAdapter extends XmlAdapter<MapWrapper, Map<String, String>>{

  @Override
  public Map<String, String> unmarshal(MapWrapper v) throws Exception {
    Map<String, String> map = v.toMap();

    return map;
  }

  @Override
  public MapWrapper marshal(Map<String, String> m) throws Exception {
    MapWrapper wrapper = new MapWrapper();

    for(Map.Entry<String, String> entry : m.entrySet()){
       wrapper.addEntry(new JAXBElement<String>(new QName(entry.getKey()), String.class, entry.getValue()));
    }

    return wrapper;
  }

}
origin: stackoverflow.com

 private void setClientAdditionalInfo(Map map, Client client, User user) {

  Map additionalInfo = (Map) map.get("additionalInfo");
  MapWrapper wrapper = new MapWrapper(additionalInfo);

  client.setGender(wrapper.get("gender"));
  ...
}
origin: stackoverflow.com

 MapWrapper wrapper = new MapWrapper();
wrapper.wrapped.put("key1", 1);
wrapper.wrapped.put("key2", 2);

String json = gson.toJson(wrapper, MapWrapper.class);
System.out.println(json);

MapWrapper newWrapper = gson.fromJson(json, MapWrapper.class);
for(Entry<String, Integer> e : newWrapper.wrapped.entrySet()) {
  System.out.println(e.getKey() + ", " + e.getValue());
}
origin: stackoverflow.com

 public class MyTypeAdapter implements JsonSerializer<MapWrapper>, JsonDeserializer<MapWrapper> {
  @Override
  public JsonElement serialize(MapWrapper src, Type typeOfSrc, JsonSerializationContext context) {
    JsonObject obj = new JsonObject();
    src.wrapped.entrySet().forEach(e -> obj.add(e.getKey(), new JsonPrimitive(e.getValue())));
    return obj;
  }

  @Override
  public MapWrapper deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    MapWrapper wrapper = new MapWrapper();
    json.getAsJsonObject().entrySet().forEach(e -> wrapper.wrapped.put(e.getKey(), e.getValue().getAsInt()));
    return wrapper;
  }
}
origin: stackoverflow.com

@Override
public MapWrapper marshal(Map<String,String> m) throws Exception {
MapWrapper wrapper = new MapWrapper();
List<JAXBElement<String>> elements = new ArrayList<JAXBElement<String>>();
  for (Map.Entry<String, String> property: m.entrySet()) {
origin: org.jboss.seam.remoting/seam-remoting

  w = new MapWrapper(beanManager);
else if (obj.getClass().isArray()
    || Collection.class.isAssignableFrom(obj.getClass()))
origin: org.jboss.seam/jboss-seam-remoting

 w = new MapWrapper();
else if (obj.getClass().isArray() || Collection.class.isAssignableFrom(obj.getClass()))
 w = new BagWrapper();
origin: org.jboss.seam.remoting/seam-remoting-core

  w = new MapWrapper(beanManager);
else if (obj.getClass().isArray()
   || Collection.class.isAssignableFrom(obj.getClass()))
org.jboss.seam.remoting.wrapperMapWrapper

Most used methods

  • <init>
  • addEntry
  • get
  • setMyMap
  • toMap

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now