Changes between Version 5 and Version 6 of ebXMLObjectModel


Ignore:
Timestamp:
Jul 21, 2008, 8:21:34 AM (16 years ago)
Author:
heikki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ebXMLObjectModel

    v5 v6  
    3535Note: the Access Control section of the Information Model specification is not (yet) part of the implementation.
    3636
    37 The implementation is complemented with a set of unit tests, for each of the objects that may be used as a top-level element in an ebXML document. The unit tests are written in the well-known [http://www.junit.org/ Junit framework]. The testcases are for each of these objects, a test for marshalling, and a test for unmarshalling. As we're dealing with XML the tests use the complimentary test library [http://xmlunit.sourceforge.net/ XML Unit]. This allows o.a. to ignore differences in whitespace and the order of elements in the XML where that should be ignored.
    38 
    39 
     37The implementation is complemented with a suite of unit tests, for each of the objects that may be used as a top-level element in an ebXML document. The unit tests are written in the well-known [http://www.junit.org/ Junit framework]. The testcases are for each of these objects, a test for marshalling, and a test for unmarshalling. As we're dealing with XML the tests use the complimentary test library [http://xmlunit.sourceforge.net/ XML Unit]. This allows o.a. to ignore differences in whitespace and the order of elements in the XML where that should be ignored. The test suite will be incorporated into the Continuous Integration build process.
    4038
    4139
     
    4442=== XML binding ===
    4543
     44In order to efficiently create an XML binding, that is to say the ability to marshal and unmarshal XML documents, the Java Beans implementation is decorated with a [http://jibx.sourceforge.net/ JiXB binding]. JiXB was chosen over other binding frameworks such as [http://xmlbeans.apache.org/ XMLBeans], [http://www.castor.org/ Castor] and [https://jaxb.dev.java.net/ JAXB] because of its [high performance high performance], ease of use, and non-intrusive programming model.
     45
     46An sample of code that marshals a !RegistryObject document is the following. This and similar code you can find in the Object Model's unit test suite.
     47
     48 {{{
     49
     50    IBindingFactory bfact = BindingDirectory.getFactory(RegistryObject.class);
     51    IMarshallingContext marshallingContext = bfact.createMarshallingContext();
     52    Writer out = new BufferedWriter(new OutputStreamWriter(new ByteArrayOutputStream()));
     53    marshallingContext.setOutput(out);
     54    // pretty-print the XML output
     55    marshallingContext.setIndent(3);
     56    marshallingContext.marshalDocument(o, "UTF-8", null);
     57
     58
     59 }}}
     60
     61
     62
     63
    4664----