Examples of ElementHandler


Examples of nexj.core.util.XMLUtil.ElementHandler

      final ActivityLoader loader)
   {
      final Pair codeHolder = new Pair(null);
      Step outerStep;

      XMLUtil.withFirstChildElement(element, "Finally", false, new ElementHandler()
      {
         public void handleElement(Element finallyElement)
         {
            codeHolder.setHead(
                  helper.parse(helper.getElementValue(finallyElement),
                  true, outerActivity.getFlow().getPosMap(),
                  null, metadata.getGlobalEnvironment()
               )
            );
         }
      });

      if (codeHolder.getHead() != null)
      {
         Block block = new Block(tryCatch.getName() + ".finalizer");

         block.setActivity(outerActivity);
         block.setCleanupCode((Pair)codeHolder.getHead());
         tryCatch.setActivity(block.getContainedActivity());
         block.getContainedActivity().addStep(tryCatch);
         outerStep = block;
      }
      else
      {
         tryCatch.setActivity(outerActivity);
         outerStep = tryCatch;
      }

      String sVariable = XMLUtil.getStringAttr(element, "variable");

      if (sVariable != null)
      {
         tryCatch.setExceptionVariable(outerActivity.getFlow().getVariable(sVariable));
      }

      XMLUtil.withFirstChildElement(element, "Try", false, new ElementHandler()
      {
         public void handleElement(Element tryElement)
         {
            loader.loadActivity(tryElement, tryCatch.getTry());
         }
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

               {
                  throw new MetadataException("err.meta.workflow.joinType",
                     new Object[]{sType, activity.getFlow().getFullName()});
               }

               XMLUtil.forEachChildElement(element, "Activity", new ElementHandler()
               {
                  public void handleElement(Element activityElement)
                  {
                     Concurrent concurrent = new Concurrent();
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

   protected void loadFormats(Element fmtElement)
   {
      XMLMetadataHelper.verifyRootElement(fmtElement, "Formats");

      XMLUtil.forEachChildElement(fmtElement, "Format",
         m_helper.new ElementHandler("format")
      {
         public void handleElement(Element element, String sName)
         {
            loadFormat(element, sName);
         }
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      if (sExporter != null)
      {
         format.setExporter(m_helper.getClassObject(sExporter));
      }

      XMLUtil.withFirstChildElement(formatElement, "Parser", true, new ElementHandler()
      {
         public void handleElement(Element componentElement)
         {
            Component parser = new Component("<MessageParser:" + sName + ">");

            loadComponent(componentElement, parser);
            format.setParser(parser);
         }
      });

      XMLUtil.withFirstChildElement(formatElement, "Formatter", true, new ElementHandler()
      {
         public void handleElement(Element componentElement)
         {
            Component formatter = new Component("<MessageFormatter:" + sName + ">");
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

    */
   protected void loadCompositeMessagePart(Element partElement, final CompositeMessagePart composite, final Message message)
   {
      initCompositeMessagePart(partElement, composite, message);

      XMLUtil.withFirstChildElement(partElement, "Parts", false, new ElementHandler()
      {
         public void handleElement(Element partsElement)
         {
            XMLUtil.forEachChildElement(partsElement, null,
               m_helper.new ElementHandler("messagePart")
            {
               protected void handleElement(Element element, String sName)
               {
                  if (element.getNodeName().equals("Message"))
                  {
                     if (!loadMessageRef(composite, message, element, sName))
                     {
                        CompositeMessagePart part = new CompositeMessagePartInstance(sName);

                        composite.addPart(part);
                        loadCompositeMessagePart(element, part, message);
                     }
                  }
                  else if (element.getNodeName().equals("Value"))
                  {
                     final PrimitiveMessagePart part = new PrimitiveMessagePart(sName);

                     composite.addPart(part);
                     part.setType(Primitive.parse(XMLUtil.getReqStringAttr(element, "type")));
                     loadMessagePart(element, part, message);

                     XMLUtil.withFirstChildElement(element, "Enumerations", false, new ElementHandler()
                     {
                        public void handleElement(Element enumerationsElement)
                        {
                           XMLUtil.forEachChildElement(enumerationsElement, "Enumeration", new ElementHandler()
                           {
                              public void handleElement(Element enumerationElement)
                              {
                                 part.addEnumeration(XMLUtil.getReqStringAttr(enumerationElement, "value"));
                              }
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

            new Object[] {sDerivation, transformation.getName()});
      }

      transformation.setPrimary(XMLUtil.getBooleanAttr(transformationElement, "primary", true));

      XMLUtil.withFirstChildElement(transformationElement, "Initializer", false, new ElementHandler()
      {
         public void handleElement(Element initializerElement)
         {
            transformation.setInitializer((Pair)m_helper.parse(m_helper.getElementValue(initializerElement),
               true, sURLPrefix + ".initializer", transformation.getPosMap(), null, m_metadata.getGlobalEnvironment()));
         }
      });

      XMLUtil.withFirstChildElement(transformationElement, "Mappings", false, new ElementHandler()
      {
         public void handleElement(Element mappingsElement)
         {
            XMLUtil.forEachChildElement(mappingsElement, "Mapping",
               m_helper.new ElementHandler("mapping")
            {
               private int m_nOrdinal;

               public void handleElement(Element mappingElement, String sMappingName)
               {
                  TransformationMapping mapping = new TransformationMapping(sMappingName);

                  if (sMappingName == null)
                  {
                     sMappingName = String.valueOf(m_nOrdinal);
                  }

                  loadTransformationMapping(mappingElement, sURLPrefix + ".mapping." + sMappingName, mapping, transformation);
                  transformation.addMapping(mapping);

                  m_nOrdinal += 1;
               }

               protected String getName(Element element)
               {
                  return XMLUtil.getStringAttr(element, "name");
               }
            });
         }
      });

      XMLUtil.withFirstChildElement(transformationElement, "Finalizer", false,new ElementHandler()
      {
         public void handleElement(Element finalizerElement)
         {
            transformation.setFinalizer((Pair)m_helper.parse(m_helper.getElementValue(finalizerElement),
               true, sURLPrefix + ".finalizer", transformation.getPosMap(), null, m_metadata.getGlobalEnvironment()));
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

            mapping.addDestination(sPartName, bFixed);
         }
      }

      XMLUtil.withFirstChildElement(mappingElement, "Sources", false, new ElementHandler()
      {
         public void handleElement(Element sourcesElement)
         {
            XMLUtil.forEachChildElement(sourcesElement, "Source",
               m_helper.new ElementHandler("source")
            {
               public void handleElement(Element sourceElement, final String sSourceName)
               {
                  String sSource = XMLUtil.getStringAttr(sourceElement, "source");
                  final String sMapping = XMLUtil.getStringAttr(sourceElement, "mapping");
View Full Code Here

Examples of nexj.core.util.XMLUtil.ElementHandler

      if (sFormatName != null)
      {
         iface.setFormat(m_metadata.getFormat(sFormatName));
      }

      XMLUtil.withFirstChildElement(interfaceElement, "Requests", false, new ElementHandler()
      {
         public void handleElement(Element requestsElement)
         {
            XMLUtil.forEachChildElement(requestsElement, "Request", m_helper.new ElementHandler("request")
            {
               public void handleElement(Element requestElement, String sMessageName)
               {
                  iface.addRequest(m_metadata.getMessage(sMessageName));
               }

               protected String getName(Element element)
               {
                  return XMLUtil.getReqStringAttr(element, "message");
               }
            });
         }
      });

      XMLUtil.withFirstChildElement(interfaceElement, "Responses", false, new ElementHandler()
      {
         public void handleElement(Element requestsElement)
         {
            XMLUtil.forEachChildElement(requestsElement, "Response", m_helper.new ElementHandler("response")
            {
               public void handleElement(Element requestElement, String sMessageName)
               {
                  iface.addResponse(m_metadata.getMessage(sMessageName));
               }
View Full Code Here

Examples of org.dom4j.ElementHandler

    }
  }

  public void endElement(String uri, String localName, String qName)
      throws SAXException {
    ElementHandler currentHandler = getElementStack().getDispatchHandler()
        .getHandler(getElementStack().getPath());

    super.endElement(uri, localName, qName);

    if (!activeHandlers()) {
View Full Code Here

Examples of org.dom4j.ElementHandler

    }

    if ((handlers != null) && (handlers.containsKey(path))) {
      // The current node has a handler associated with it.
      // Find the handler and save it on the handler stack.
      ElementHandler handler = (ElementHandler) handlers.get(path);
      handlerStack.add(handler);

      // Call the handlers onStart method.
      handler.onStart(elementPath);
    } else {
      // No handler is associated with this node, so use the
      // defaultHandler it it exists.
      if (handlerStack.isEmpty() && (defaultHandler != null)) {
        defaultHandler.onStart(elementPath);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.