put(key, t.get(key));
/** * Add a parameter mapping. * @param name The parameter name. * @param exp The expression. * @param iexp The index expression, when setting a entry of an array parameter. */ public void addParameterMapping(String name, UnparsedExpression exp, UnparsedExpression iexp) { if(parametermappings == null) // parametermappings = new LinkedHashMap<String, Tuple2<UnparsedExpression,UnparsedExpression>>(); parametermappings = new IndexMap<String, Tuple2<UnparsedExpression, UnparsedExpression>>(); parametermappings.put(name, new Tuple2<UnparsedExpression, UnparsedExpression>(exp, iexp)); }
/** * Create a new index map. */ public IndexMap(IndexMap<K, V> imap) { this(); for(K key: imap.keySet()) { put(key, imap.get(key)); } }
/** * Add a parameter. * @param param The parameter. */ public void addParameter(MParameter param) { if(parameters==null) parameters = new IndexMap<String, MParameter>(); parameters.put(param.getName(), param); }
/** * Add a property. * @param prop The property. */ public void addProperty(MProperty prop) { if(properties==null) properties = new IndexMap<String, MProperty>(); properties.put(prop.getName(), prop); }
public void actionPerformed(ActionEvent e) { stopEditing(paramtable); int row = paramtable.getRowCount(); String name = BasePropertyPanel.createFreeName("name", new MapContains(getMEventProperties().getAsMap())); MProperty prop = new MProperty(null, name, null); getMEvent().addProperty(prop); parametercache.put(name, prop); modelcontainer.setDirty(true); ((ParameterTableModel) paramtable.getModel()).fireTableRowsInserted(row, row); } };
/** * Get the parameters. * @return The parameters. */ public IndexMap<String, MParameter> getAllParameters(Map<String, Object> params, IModelInfo model, ClassLoader cl) { IndexMap<String, MParameter> ret = new IndexMap<String, MParameter>(parameters); if(clazz!=null) { Class<?> task = clazz.getType(cl); try { Method m = task.getMethod("getExtraParameters", new Class[]{Map.class}); ParameterMetaInfo[] ps = (ParameterMetaInfo[])m.invoke(null, new Object[]{params}); for(ParameterMetaInfo pmi: ps) { MParameter mp = new MParameter(pmi.getDirection(), pmi.getClazz(), pmi.getName(), null); // has no initial value ret.put(mp.getName(), mp); } } catch(Exception e) { // ignore } } return ret; }
!PROPERTY_CODECIDS.equals(prop.getName())) parametercache.put(prop.getName(), prop);
public void actionPerformed(ActionEvent e) { while (!parametercache.isEmpty()) { MProperty prop = parametercache.remove(0); getMEvent().removeProperty(prop); } Set<String> paramnames = MESSAGE_TYPE_MAPPING.get(getMessageTypeString()); for (String paramname : paramnames) { String name = BasePropertyPanel.createFreeName(paramname, new MapContains(getMEventProperties().getAsMap())); MProperty prop = new MProperty(null, name, null); getMEvent().addProperty(prop); parametercache.put(name, prop); } modelcontainer.setDirty(true); ((ParameterTableModel) paramtable.getModel()).fireTableStructureChanged(); } };
paramcche.put(param.name, param);