Package org.jboss.internal.soa.esb.util.stax

Examples of org.jboss.internal.soa.esb.util.stax.TextElement


  {
      for (Entry<String, SerializedValueImpl> entry: _table.entrySet())
      {
          final String origPropertyURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_PROPERTY) ;
         
          final TextElement keyElement = new TextElement(Encoding.encodeBytes(entry.getKey().getBytes())) ;
          StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_PROPERTY_KEY, keyElement) ;
         
          final String value = entry.getValue().getSerialisedForm() ;
          final TextElement valueElement = new TextElement(value) ;
          StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_PROPERTY_VALUE, valueElement) ;
         
          StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_PROPERTY.getPrefix(), origPropertyURI) ;
      }
  }
View Full Code Here


            throws XMLStreamException
        {
            if (XMLUtil.ESB_QNAME_PROPERTY.equals(elementName))
            {
                StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_PROPERTY_KEY) ;
                final TextElement keyElement = new TextElement(in) ;
                final String key = new String(Encoding.decodeToBytes(keyElement.getText())) ;
               
                StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_PROPERTY_VALUE) ;
                final TextElement valueElement = new TextElement(in) ;
                final SerializedValueImpl value = new SerializedValueImpl(valueElement.getText()) ;
               
                StreamHelper.checkParentFinished(in) ;
               
                _table.put(key, value) ;
            }
View Full Code Here

             * for it within the XML (e.g., roll-your-own CBR).
             */
            final byte[] content = getByteArray() ;
            if (content != null)
            {
                final TextElement bytesContent = new TextElement(Encoding.encodeBytes(content)) ;
                StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_BYTES_CONTENT, bytesContent) ;
            }
           
            // These should be handled by a proper element content
            for(Entry<String, MarshalValueImpl> entry: _objects.entrySet())
            {
                final String origContentURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT) ;
               
                final TextElement key = new TextElement(Encoding.encodeBytes(entry.getKey().getBytes())) ;
                StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_KEY, key) ;
               
                final String origValueURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_BODY_CONTENT_VALUE) ;
                if (!MarshalUnmarshalManager.getInstance().marshal(out, entry.getValue()))
                {
View Full Code Here

            throws XMLStreamException
        {
            if (XMLUtil.ESB_QNAME_BODY_CONTENT.equals(elementName))
            {
                StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_BODY_CONTENT_KEY) ;
                final TextElement keyElement = new TextElement(in) ;
                final String key = new String(Encoding.decodeToBytes(keyElement.getText())) ;

                StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_BODY_CONTENT_VALUE) ;
                final MarshalValueImpl value = MarshalUnmarshalManager.getInstance().unmarshal(in) ;
                StreamHelper.checkParentFinished(in) ;
                StreamHelper.checkParentFinished(in) ;
               
                if (value == null)
                    throw new XMLStreamException("Cannot unpack object: " + key) ;
                else
                    _objects.put(key, value) ;
            }
            else if (XMLUtil.ESB_QNAME_BODY_BYTES_CONTENT.equals(elementName))
            {
                final TextElement textElement = new TextElement(in) ;
                final String value = textElement.getText();
                if (value != null)
                {
                    setByteArray(Encoding.decodeToBytes(value)) ;
                }
                else
View Full Code Here

    {
        for (Entry<String, SerializedValueImpl> entry: context.entrySet())
        {
            final String origPropertyURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY) ;
           
            final TextElement keyElement = new TextElement(Encoding.encodeBytes(entry.getKey().getBytes())) ;
            StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_KEY, keyElement) ;
           
            final String value = entry.getValue().getSerialisedForm() ;
            final TextElement valueElement = new TextElement(value) ;
            StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_VALUE, valueElement) ;
           
            StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_CONTEXT_ENTRY.getPrefix(), origPropertyURI) ;
        }
    }
View Full Code Here

        throws XMLStreamException
    {
        if (XMLUtil.ESB_QNAME_CONTEXT_ENTRY.equals(elementName))
        {
            StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_KEY) ;
            final TextElement keyElement = new TextElement(in) ;
            final String key = new String(Encoding.decodeToBytes(keyElement.getText())) ;
           
            StreamHelper.checkNextStartTag(in, XMLUtil.ESB_QNAME_CONTEXT_ENTRY_VALUE) ;
            final TextElement valueElement = new TextElement(in) ;
            final SerializedValueImpl value = new SerializedValueImpl(valueElement.getText()) ;
           
            StreamHelper.checkParentFinished(in) ;
           
            context.put(key, value) ;
        }
View Full Code Here

  {
            synchronized(_list)
            {
                for (SerializedValueImpl value : _list)
                {
                    final TextElement unnamed = new TextElement(value.getSerialisedForm()) ;
                    StreamHelper.writeElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_UNNAMED, unnamed) ;
                }
            }
           
            synchronized(_table)
            {
                for (Entry<String, SerializedValueImpl> entry : _table.entrySet())
                {
                    final TextElement named = new TextElement(entry.getValue().getSerialisedForm()) ;
                    final String origNamedURI = StreamHelper.writeStartElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED) ;
                    StreamHelper.writeAttribute(out, XMLUtil.ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME, entry.getKey()) ;
                    named.writeContent(out) ;
                    StreamHelper.writeEndElement(out, XMLUtil.ESB_QNAME_ATTACHMENT_NAMED.getPrefix(), origNamedURI) ;
                }
            }
  }
View Full Code Here

            final EPR origEPR = call.getTo() ;
            final PortReference to = origEPR.getAddr() ;
            for(NamedElement element: extensions)
            {
                final QName name = element.getName() ;
                final TextElement content = (TextElement)element.getElementContent() ;
                to.addExtension(name.getLocalPart(), name.getPrefix(), name.getNamespaceURI(), content.getText()) ;
            }
           
            call.setTo(EPRHelper.getSpecificEPR(origEPR)) ;
        }
    }
View Full Code Here

                final URIElement messageIdentifier = new URIElement(in) ;
                call.setMessageID(messageIdentifier.getValue()) ;
            }
            else
            {
                final TextElement content = new TextElement(in) ;
                extensions.add(new NamedElement(elementName, content)) ;
            }
        }
        else
        {
            final TextElement content = new TextElement(in) ;
            extensions.add(new NamedElement(elementName, content)) ;
        }
    }
View Full Code Here

            final QName elementName)
            throws XMLStreamException
        {
            if (XMLUtil.ESB_QNAME_ATTACHMENT_UNNAMED.equals(elementName))
            {
                final TextElement unnamed = new TextElement(in) ;
                final SerializedValueImpl value = new SerializedValueImpl(unnamed.getText());
                _list.add(value);
            }
            else if (XMLUtil.ESB_QNAME_ATTACHMENT_NAMED.equals(elementName))
            {
                final String name = StreamHelper.getAttributeValue(in, XMLUtil.ESB_QNAME_ATTRIBUTE_ATTACHMENT_NAMED_NAME) ;
                final TextElement valueElement = new TextElement(in) ;
                final SerializedValueImpl value = new SerializedValueImpl(valueElement.getText()) ;
                _table.put(name, value) ;
            }
            else
            {
                throw new XMLStreamException("Unexpected element name: " + elementName) ;
View Full Code Here

TOP

Related Classes of org.jboss.internal.soa.esb.util.stax.TextElement

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.