Package org.jvnet.jaxb2_commons.ppp

Examples of org.jvnet.jaxb2_commons.ppp.Child


      BigInteger key = OpenDoPEHandler.getSdtPr(entry).getId().getVal();
     
      Object replacement = templateConditionSdtsByID.get(key);
     
      // ok, replace
      Child child = (Child)entry;
      Object parent = child.getParent();
      log.info("parent: " + parent.getClass().getName() );
     
      if (parent instanceof ContentAccessor
          || parent instanceof java.util.ArrayList) {
       
View Full Code Here


        // shouldn't happen provided OpenDoPEHandler preserved SDT ID on first instance of repeat
        log.error( OpenDoPEHandler.getSdtPr(entry).getTag().getVal() + " - No replacement SDT with ID " + key.toString() );
      }
     
      // ok, replace
      Child child = (Child)entry;
      Object parent = child.getParent();
      log.info("parent: " + parent.getClass().getName() );
     
      if (parent instanceof ContentAccessor
          || parent instanceof java.util.ArrayList) {
       
        List<Object> list = (parent instanceof ContentAccessor) ?
                    ((ContentAccessor)parent).getContent() : (java.util.ArrayList)parent; 
       
        int index = 0;
        boolean found = false;
        for (Object o : list) {
          if (XmlUtils.unwrap(o).equals(child)) {
            found = true;
            break;
          }
          index++;
        }
        if (found) {
          list.set(index, replacement);
        } else {
          log.error("Couldn't find repeat sdt: " + key );
        }
               
      } else {
        log.error("TODO " + parent.getClass().getName() );
      }
    }
   
    // the sdts to remove
    for ( Object entry : instanceSdtPrFinder.repeatSdtToDelete ) {
     
      Child child = (Child)entry;
      Object parent = child.getParent();
      log.info("parent: " + parent.getClass().getName() );
     
      if (parent instanceof ContentAccessor
          || parent instanceof java.util.ArrayList) {
       
View Full Code Here

TOP

Related Classes of org.jvnet.jaxb2_commons.ppp.Child

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.