Package org.openadaptor.dataobjects

Examples of org.openadaptor.dataobjects.SimpleDataObject


  public static String mappings = null;
  public static HashMap attributeNames = null;

  public void processMessage(Message message) throws PipelineException {
    DataObject[] dobs = message.peekDataObjects();
    SimpleDataObject sdo = (SimpleDataObject)dobs[0];
 
    System.out.println(sdo.debugString(sdo));
    System.out.println(sdo.getValues());     
      System.out.println("mappings " + mappings);
      Hashtable hashMappings = new Hashtable();
      StringTokenizer st = new StringTokenizer(mappings, "\r\n");
      while (st.hasMoreElements()) {
        String next = (String)st.nextElement();
//        System.out.println("next " + next);
        String key = null;
        String value = null;
        int index = next.indexOf("=");
        if (index > 0) {
          key = next.substring(0, index);
          value = next.substring(index + 1)
        }
        hashMappings.put(key, value);
//          System.out.println("key " + key + " value " + value);
      }
      System.out.println("attributeNames " + attributeNames);
     
      // Values from SDO
      Hashtable sdoValues = sdo.getValues();
      // Remove the ones not in attributeNames
      Enumeration keys = sdoValues.keys();
      while (keys.hasMoreElements()) {
        String key = (String)keys.nextElement();
        if (!attributeNames.containsKey(key)) {
          sdoValues.remove(key);
        }
      }
    System.out.println("sdo.getValues() ****** " + sdo.getValues());
    System.out.println("hashMappings ****** " + hashMappings);
   
      Hashtable newValues = new Hashtable();
      keys = sdoValues.keys();
      while (keys.hasMoreElements()) {
View Full Code Here

TOP

Related Classes of org.openadaptor.dataobjects.SimpleDataObject

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.