Re: PROPOSAL: Extensions to XMIReader and XMIWriter interfaces
Daniel Prusa <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Martin,
> 1) In XMI writter there is a need for being able to split XMI output
> into several files. To make this possible, we would like to add the
> following interface to MDR API:
>
> public interface XMIReferenceProvider {
> /** Method called by XMIWriter whenever it needs to serialize
> * given object or a reference to it. If the returned reference
> * is not href, it will be used as xmi.id of that element
> * and wherever the element is referenced, simple xmi.idref
> * with this xmi.id will be generated. If the returned reference
> * represents href, object will not be serialized and wherever
> * it is referenced, href will be generated.
> * @param object Object to be serialized (or referenced).
> * @return Structure representing reference to the object.
> */
> public XMIReference getXMIReference(RefObject object);
it can be useful to slightly extend capabilities of
getXMIReference(RefObject) method by allowing return null value and
interpreting it as 'do not serialize this object and all links it
participate in'. It will allow to implement different types of filtering on
data in repository. If we consider write(Collection) method we can say it is
just an example of such filtering - write(Collection) can be easily
implemented using XMIRefereceProvider. Moreover, another customizations are
possible then.
Dan