Package org.apache.ws.jaxme

Examples of org.apache.ws.jaxme.JMXmlSerializer$Data


     *
     * @return Contentinfo with contentType Data.
     */
    private ContentInfo makeData(SafeContents safe) throws IOException,
      ASN1Exception {
  Data data = null;
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DEREncoder encoder = new DEREncoder(baos);
  safe.encode(encoder);
  data = new Data(baos.toByteArray());
  baos.close();
  ContentInfo cInfo = new ContentInfo(data);
  return cInfo;
    }
View Full Code Here


  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

     */
    public long getOverlayWindow (Window win) {
  Request request = new Request (display, major_opcode, 7, 2);
  request.write4 (win.id);

  Data reply = display.read_reply (request);
  if (reply == null) {
      return -1;
  }

  return reply.read4(8);
    }
View Full Code Here

    // check version before any other operations
    Request request = new Request (display, major_opcode, 0, 3);
    request.write4 (CLIENT_MAJOR_VERSION);
    request.write4 (CLIENT_MINOR_VERSION);
 
    Data reply = display.read_reply (request);
    server_major_version = reply.read2 (8);
    server_minor_version = reply.read2 (10);
  }
View Full Code Here

  }

  public void marshal(Object pObject, ContentHandler pHandler) throws JAXBException {
    JMElement element = (JMElement) pObject;
    try {
      JMXmlSerializer serializer = getJAXBContextImpl().getJMXmlSerializer(element.getQName());
      serializer.marshal(serializer.getData(this, pHandler), element.getQName(), element);
    } catch (SAXException e) {
      throw new MarshalException(e);
    }
  }
View Full Code Here

    assertStringEquals(getAllTypesElementString(), sw.toString());
  }

  public void testPrefixes() throws Exception {
    AllTypesElementImpl el = new AllTypesElementImpl();
    JMXmlSerializer ser = new AllTypesElementTypeSerializer();
    assertStringEquals("ex", ser.getPreferredPrefix(el.getQName().getNamespaceURI()));
    assertNull(ser.getPreferredPrefix("dummyURI"));
  }
View Full Code Here

    if (c == null) {
      throw new MarshalException("No marshaller class configured for " +
                                  pElementInterface.getName());
    }
    try {
      JMXmlSerializer xs = (JMXmlSerializer) c.newInstance();
      xs.init(this);
      return xs;
    } catch (Exception e) {
      throw new MarshalException("Could not instantiate marshaller class " +
                                  c.getName(), e);
    }
View Full Code Here

    Class c = manager.getMarshallerClass();
    if (c == null) {
      throw new MarshalException("No marshaller class configured for " + pQName);
    }
    try {
      JMXmlSerializer xs = (JMXmlSerializer) c.newInstance();
      xs.init(this);
      return xs;
    } catch (Exception e) {
      throw new MarshalException("Could not instantiate marshaller class " + c.getName(), e);
    }
  }
View Full Code Here

    assertEquals(getAllTypesElementString(), sw.toString());
  }

  public void testPrefixes() throws Exception {
    AllTypesElementImpl el = new AllTypesElementImpl();
    JMXmlSerializer ser = new AllTypesElementTypeSerializer();
    assertEquals("ex", ser.getPreferredPrefix(el.getQName().getNamespaceURI()));
    assertNull(ser.getPreferredPrefix("dummyURI"));
  }
View Full Code Here

  }

  public void marshal(Object pObject, ContentHandler pHandler) throws JAXBException {
    JMElement element = (JMElement) pObject;
    try {
      JMXmlSerializer serializer = getJAXBContextImpl().getJMXmlSerializer(element.getQName());
      serializer.marshal(serializer.getData(this, pHandler), element.getQName(), element);
    } catch (SAXException e) {
      throw new MarshalException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.JMXmlSerializer$Data

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.