Пример #1
0
 public void transform(Element element, Element parentSource, Element parentResult) {
   NodeList childNodes = element.getChildNodes();
   logger.log(
       Level.FINE,
       stringManager.getString(
           "upgrade.transform.baseelemnt.transformingMSG", element.getTagName()));
   for (int index = 0; index < childNodes.getLength(); index++) {
     Node aNode = childNodes.item(index);
     try {
       if (aNode.getNodeType() == Node.ELEMENT_NODE) {
         BaseElement baseElement =
             ElementToObjectMapper.getMapper().getElementObject(aNode.getNodeName());
         baseElement.transform((Element) aNode, element, parentResult);
       }
     } catch (Exception ex) {
       // ****** LOG MESSAGE *************
       ex.printStackTrace();
       logger.log(
           Level.WARNING,
           stringManager.getString(
               "upgrade.transform.baseelement.transformexception",
               new String[] {element.getTagName(), ex.getMessage()}));
       // -logger.log(Level.WARNING,
       // stringManager.getString("upgrade.transform.baseelement.transformexception"), ex);
     }
   }
 }
Пример #2
0
 protected java.util.List getInsertElementStructure(Element element, Element parentEle) {
   // Sub classes can override this method to return a different list if needed.
   // parentEle is not used in this method.  But sub classes can use it to make certain decision on
   // structure
   return ElementToObjectMapper.getMapper().getInsertElementStructure(element.getTagName());
 }
Пример #3
0
 /*
  * Returns the key mapped in mapper for the element
  * This key is used for comparing source and target elements
  * Returns NULL if no key is mapped.  This is quite common for elements that have only child elements but no attributes to transfer
  */
 protected String getKeyToCompare(String elementTagName) {
   return ElementToObjectMapper.getMapper().getKeyForElement(elementTagName);
 }