* @param currPathSet The current path.
* @return The list of attributes or an attribute symbol.
*/
private Object getAttributes(MessagePart part, Set currPathSet, Message message)
{
CompositeMessagePart refPart = null;
ObjectMessagePartMapping partMapping = (ObjectMessagePartMapping)part.getMapping();
if (part instanceof PrimitiveMessagePart)
{
if (message != null && part.getDeclarator() == message && partMapping.getMessage() != message)
{
return null;
}
return (m_attribute == null) ? null : m_attribute.getSymbol();
}
else if (part instanceof CompositeMessagePartRef)
{
refPart = ((CompositeMessagePartRef)part).getRefPart();
message = refPart.getDeclarator();
if (!currPathSet.add(refPart))
{
return (m_attribute == null) ? null : new Pair(m_attribute.getSymbol());
}
}
CompositeMessagePart composite = (CompositeMessagePart)part;
Pair attributes = null;
for (int i = composite.getPartCount() - 1; i >= 0; --i)
{
MessagePart childPart = composite.getPart(i);
ObjectMessagePartMapping childMapping = (ObjectMessagePartMapping)childPart.getMapping();
Object childAttributes = childMapping.getAttributes(childPart, currPathSet, message);
if (childAttributes != null)
{
attributes = new Pair(childAttributes, attributes);
}
}
// Add attributes from derived messages
if (refPart != null)
{
ObjectMessagePartMapping refMapping = (ObjectMessagePartMapping)refPart.getMapping();
Message refMessage = refMapping.getMessage();
for (int i = 0, nCount = refMessage.getDerivedMessageCount(); i < nCount; i++)
{
Message derivedMessage = refMessage.getDerivedMessage(i);
CompositeMessagePart derivedRoot = derivedMessage.getRoot();
ObjectMessagePartMapping derivedMapping = (ObjectMessagePartMapping)derivedRoot.getMapping();
Object derivedAttributes = derivedMapping.getAttributes(derivedRoot, currPathSet, refMessage);
if (derivedAttributes != null)
{
if (derivedAttributes instanceof Symbol)