//
// DataMapDefault.java - Map to a fixed value
//

package nyangau.jmsadapter;

//...simports:0:
import java.util.Set;
import java.util.Map;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
//...e

public class DataMapDefault extends DataMap
  {
  protected String dest;
//...sDataMapDefault:2:
public DataMapDefault(Node eDataMap)
  throws FlowProcessorException
  {
  super(eDataMap);
  NamedNodeMap nnmDataMap = eDataMap.getAttributes();
  Node aDest = nnmDataMap.getNamedItem("dest");
  if ( aDest == null )
    throw new FlowProcessorException("unexpected missing dest in data map "+name+", bad jmsadapter.xsd?");
  dest = aDest.getNodeValue();
  }
//...e
//...smap:2:
public void map(Set<String> unmapped, Map<String,String> mapped)
  throws FlowProcessorException
  {
  for ( String s : unmapped )
    {
    unmapped.remove(s);
    mapped.put(s, dest);
    }
  }
//...e
  }
