public void resolveInheritance(MessagePart baseMessagePart)
{
if (baseMessagePart instanceof CompositeMessagePartInstance)
{
CompositeMessagePartInstance baseMessagePartComp = (CompositeMessagePartInstance)baseMessagePart;
LookupDeque orderedPartSet = new LinkedHashTab(m_partList.size());
for (int i = 0; i < m_partList.size(); i++)
{
MessagePart part = (MessagePart)m_partList.get(i);
orderedPartSet.put(part.getName(), part);
}
int nSize = baseMessagePartComp.m_partList.size();
Lookup oldPartMap = m_partMap;
m_partList = new ArrayList(nSize + m_partList.size());
m_partMap = new HashTab(nSize);
// Add parts defined in the base message.
for (int i = 0; i < nSize; i++)
{
MessagePart baseMessageChildPart = (MessagePart)baseMessagePartComp.m_partList.get(i);
MessagePart childPart = (MessagePart)oldPartMap.get(baseMessageChildPart.getName());
if (childPart == null)
{
addPart(baseMessageChildPart.copy(this));
}
else
{
orderedPartSet.remove(childPart.getName());
addPart(childPart);
childPart.resolveInheritance(baseMessageChildPart);
}
}
// Add parts defined in the derived message.
for (Iterator itr = orderedPartSet.valueIterator(); itr.hasNext(); )
{
addPart((MessagePart)itr.next());
}
// Inherit the mapping