Package nexj.core.integration

Examples of nexj.core.integration.MessageParser


    * @param loader the loader of resources to seed.
    */
   protected void seed(String sTransformation, final Function enabled, final Function delete, ResourceLoader loader)
   {
      final Metadata metadata = m_context.getMetadata();
      final MessageParser parser = (MessageParser)metadata.getFormat("XML").getParser().getInstance(m_context);
      final MessageFormatter formatter = (MessageFormatter)metadata.getFormat("Object").getFormatter().getInstance(m_context);
      final Transformation transformation = metadata.getTransformation(sTransformation);
      final Transformer transformer = new Transformer(m_context);
      final UnitOfWork uow = m_context.getUnitOfWork();
      final boolean bRawSaved = uow.isRaw();

      try
      {
         uow.setRaw(true);

         final List tobjList = new ArrayList();

         loader.seedResources(((XMLMetadata)metadata).getHelper(), new CharacterStreamHandler()
         {
            public void handleCharacterStream(Reader reader, String sName) throws IOException
            {
               try
               {
                  TransferObject tobj = parser.parse(new ReaderInput(reader), (Message)transformation.getSource());

                  tobj.setValue("name", sName);

                  if (enabled != null && !Intrinsic.isTrue(m_context.getMachine().invoke(enabled, tobj, (Object[])null)))
                  {
View Full Code Here

TOP

Related Classes of nexj.core.integration.MessageParser

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.