Package nexj.core.meta.integration.format.xml

Examples of nexj.core.meta.integration.format.xml.XMLMessagePartMapping


   protected static void setElementProperties(Element element, CompositeMessagePart part)
   {
      element.setMaxCount((part.getMaxCount() == Integer.MAX_VALUE) ? 0 : part.getMaxCount());
      element.setMinCount(part.getMinCount());

      XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();

      element.setNillable(mapping.isNillable());
      element.setQualified(mapping.getNamespace() != null);
   }
View Full Code Here


   {
      element.setMaxCount((part.getMaxCount() == Integer.MAX_VALUE) ? 0 : part.getMaxCount());
      element.setMinCount(part.getMinCount());
      element.setDescription(part.getDescription());

      XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();

      element.setNillable(mapping.isNillable());

      if (element.getItemType() != SchemaItem.ELEMENT_REF)
      {
         Interface iface = mapping.getInterface();

         if (iface == null)
         {
            element.setType(getAtomicType(part));
         }
         else
         {
            CompositeType type = new CompositeType(null);

            type.setAggregation(CompositeType.AGGREGATION_CHOICE);

            for (Iterator itr = iface.getRequestTable().getMessageIterator(); itr.hasNext(); )
            {
               Message msg = (Message)itr.next();
               CompositeMessagePart rootPart = msg.getRoot();
               XMLMessagePartMapping rootPartMapping = (XMLMessagePartMapping)rootPart.getMapping();

               if (rootPartMapping.getNamespace() != null)
               {
                  CompositeType childType = createCompositeType(rootPart, msg);
                  Element child = new Element(rootPartMapping.getNodeName());

                  setElementProperties(child, rootPart);
                  child.setType(childType);
                  childType.getSchema().addItem(child);
View Full Code Here

      if (attribute.getItemType() != SchemaItem.ATTRIBUTE_REF)
      {
         attribute.setType(getAtomicType(part));
      }

      XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();
      XMLNamespace namespace = mapping.getNamespace();

      if (namespace != null)
      {
         assert namespace.getURI().equals(m_sNamespaceURI);
View Full Code Here

    * @param part The part to get the type.
    * @return An atomic type definition for the part.
    */
   protected static AtomicType getAtomicType(PrimitiveMessagePart part)
   {
      XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();
      int nCount = part.getEnumerationCount();
      AtomicType type = getPrimitiveType(part);

      if (mapping.getFormat() != null)
      {
         FormatType fmt = new FormatType(null, type);

         fmt.setFormat(mapping.getFormat());
         type = fmt;
      }

      if (nCount > 0)
      {
View Full Code Here

    * @return The type.
    */
   protected static PrimitiveType getPrimitiveType(PrimitiveMessagePart part)
   {
      Primitive type = part.getType();
      XMLMessagePartMapping mapping;

      switch (type.getOrdinal())
      {
         case Primitive.TIMESTAMP_ORDINAL:
            mapping = (XMLMessagePartMapping)part.getMapping();

            switch (mapping.getSubtype())
            {
               case XMLMessagePartMapping.SUBTYPE_DATE:
                  return PrimitiveType.DATE;

               case XMLMessagePartMapping.SUBTYPE_TIME:
                  return PrimitiveType.TIME;

               case XMLMessagePartMapping.SUBTYPE_DATETIME:
                  return PrimitiveType.DATETIME;

               default:
                  throw new IllegalStateException("Unknown subtype");
            }

         case Primitive.BINARY_ORDINAL:
            mapping = (XMLMessagePartMapping)part.getMapping();

            switch (mapping.getSubtype())
            {
               case XMLMessagePartMapping.SUBTYPE_BASE64:
                  return PrimitiveType.BASE64;

               case XMLMessagePartMapping.SUBTYPE_HEX:
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.format.xml.XMLMessagePartMapping

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.