Ejemplo n.º 1
0
    @Override
    public void walkJAXBElements(Object parent) {
      // Breadth first

      List<Object> newChildren = new ArrayList<Object>();

      Object parentUnwrapped = XmlUtils.unwrap(parent);
      List<Object> children = getChildren(parentUnwrapped);
      if (children == null) {
        log.debug("no children: " + parentUnwrapped.getClass().getName());
        return;
      } else {
        for (Object o : children) {
          newChildren.addAll(this.apply(o));
        }
      }
      // Replace list, so we'll traverse all the new sdts we've just
      // created
      TraversalUtil.replaceChildren(parentUnwrapped, newChildren);

      children = getChildren(parentUnwrapped);
      if (children == null) {
        log.debug("no children: " + parentUnwrapped.getClass().getName());
      } else {
        for (Object o : children) {

          // *** this.apply(o);

          if (this.shouldTraverse(o)) {
            walkJAXBElements(o);
          }
        }
      }
    }
 protected static String findXPathStorageItemIdInContentControls(
     WordprocessingMLPackage wmlPackage) {
   FindContentControlsVisitor visitor = null;
   if ((wmlPackage.getCustomXmlDataStorageParts() != null)
       && (!wmlPackage.getCustomXmlDataStorageParts().isEmpty())) {
     try {
       visitor =
           new FindContentControlsVisitor(wmlPackage.getCustomXmlDataStorageParts().keySet());
       TraversalUtil.visit(wmlPackage, false, visitor);
     } catch (FindContentControlsVisitor.BreakException be) { // noop
     }
   }
   return (visitor != null ? visitor.getdefinedStoreItemId() : null);
 }
Ejemplo n.º 3
0
 public List<Object> getChildren(Object o) {
   return TraversalUtil.getChildrenImpl(o);
 }
Ejemplo n.º 4
0
 @Override
 public List<Object> getChildren(Object o) {
   // log.debug("getChildren for " + o.getClass().getName());
   return TraversalUtil.getChildrenImpl(o);
 }