org.dspace.app.xmlui.wing.element
Interface WingMergeableElement

All Superinterfaces:
WingElement
All Known Implementing Classes:
Body, Division, List, Meta, Options, PageMeta, RepositoryMeta, UserMeta, WingDocument

public interface WingMergeableElement
extends WingElement

This is an interface to represent all WingElements that can be merged.

Author:
Scott Phillips

Method Summary
 Attributes merge(Attributes attributes)
          Inform this element that it is being merged with an existing element.
 WingMergeableElement mergeChild(String namespace, String localName, String qName, Attributes attributes)
          Merge the given SAX startElement event into this element's child.
 boolean mergeEqual(String namespace, String localName, String qName, Attributes attributes)
          Determine if the given SAX startElement event is equivalent to this WingElement.
 
Methods inherited from interface org.dspace.app.xmlui.wing.element.WingElement
dispose, toSAX
 

Method Detail

mergeEqual

boolean mergeEqual(String namespace,
                   String localName,
                   String qName,
                   Attributes attributes)
                   throws SAXException,
                          WingException
Determine if the given SAX startElement event is equivalent to this WingElement.

Parameters:
namespace - The element's name space
localName - The local, unqualified, name for this element
qName - The qualified name for this element
attributes - The element's attributes
Returns:
True if this WingElement is equivalent to the given SAX Event.
Throws:
SAXException
WingException

mergeChild

WingMergeableElement mergeChild(String namespace,
                                String localName,
                                String qName,
                                Attributes attributes)
                                throws SAXException,
                                       WingException
Merge the given SAX startElement event into this element's child. If this SAX event matches a child element of this element then it should be removed from the internal book keep of this element and returned. typically this is accomplished by looping through all children elements and returned the first one that returns true for the mergeEqual method.

Parameters:
namespace - The element's name space
localName - The local, unqualified, name for this element *
qName - The qualified name for this element
attributes - The element's attributes
Returns:
The child element
Throws:
SAXException
WingException

merge

Attributes merge(Attributes attributes)
                 throws SAXException,
                        WingException
Inform this element that it is being merged with an existing element. Practically this means that when this method is being transformed to SAX it should assume that the element's SAX events have already been sent. In this case the element would only need to transform to SAX the children of this element. Furthermore, if the element needs to add any attributes to the SAX startElement event it may modify the attributes object passed to make changes.

Returns:
The attributes for this merged element
Throws:
SAXException
WingException


Copyright © 2012 DuraSpace. All Rights Reserved.