return true;
}
if (m_stack.isEmpty())
{
throw new IntegrationException("err.integration.xml.unexpectedElement",
new Object[] {sURI, sLocalName});
}
MessagePart parentPart = m_stack.getTopMessagePart();
if (m_bNilElement)
{
throw new IntegrationException("err.integration.xml.nilElementNotEmpty",
new Object[] {parentPart.getFullPath()});
}
if (parentPart instanceof CompositeMessagePart)
{
CompositeMessagePart parentComposite = (CompositeMessagePart)parentPart;
for (int nIndex = (parentComposite.getAggregation() == CompositeMessagePart.SEQUENTIAL) ? m_stack.getTopIndex() : 0;
nIndex < parentComposite.getPartCount(); ++nIndex)
{
MessagePart part = parentComposite.getPart(nIndex);
XMLMessagePartMapping mapping = (XMLMessagePartMapping)part.getMapping();
if (mapping.getNodeType() == XMLMessagePartMapping.ELEMENT)
{
if (matches(part, sURI, sLocalName))
{
TransferObject tobj;
MessagePart basePart = part;
m_bNilElement = mapping.isNillable() &&
(Primitive.toBoolean(attributes.getValue(XMLNamespace.XSI, "nil")) == Boolean.TRUE);
if (part instanceof PrimitiveMessagePart)
{
tobj = null;
if (((PrimitiveMessagePart)part).getType() == Primitive.ANY)
{
if (mapping.getInterface() == null)
{
startParsingAnyType((mapping.getSubtype() == XMLMessagePartMapping.SUBTYPE_XSI) ?
attributes.getValue(XMLNamespace.XSI, "type") : null);
}
}
}
else
{
CompositeMessagePart composite2 = (CompositeMessagePart)part;
PrimitiveMessagePart valuePart = mapping.getValuePart();
tobj = new TransferObject(composite2.getPartCount());
parseAttributes(tobj, composite2, attributes);
// Process message inheritance
if (composite2 instanceof CompositeMessagePartRef)
{
CompositeMessagePartRef ref = (CompositeMessagePartRef)composite2;
CompositeMessagePart referencedPart = ref.getRefPart();
tobj.setClassName(referencedPart.getName());
RootXMLMessagePartMapping refRootMapping = (RootXMLMessagePartMapping)referencedPart.getMapping();
Message derivedMessage = getDerivedMessage(attributes, refRootMapping, part.getFullPath());
if (derivedMessage != null)
{
Message referencedMessage = refRootMapping.getRootMessage();
Message.validatePolymorphism(referencedMessage, derivedMessage, part);
tobj.setClassName(derivedMessage.getName());
part = derivedMessage.getRoot();
valuePart = ((XMLMessagePartMapping)part.getMapping()).getValuePart();
}
}
if (valuePart != null && valuePart.getType() == Primitive.ANY)
{
XMLMessagePartMapping valuePartMapping = (XMLMessagePartMapping)valuePart.getMapping();
if (valuePartMapping.getInterface() == null)
{
startParsingAnyType(null); // value part cannot parse to a primitive (attributes not allowed if primitive)
}
}
}
m_stack.setTopIndex(nIndex);
m_stack.push(part, basePart, tobj, 0, null);
return true;
}
}
else if (mapping.getNodeType() == XMLMessagePartMapping.VALUE)
{
if (acceptAnyTypeElement(sURI, sLocalName, attributes, (PrimitiveMessagePart)part, nIndex))
{
return true;
}
}
}
if (parentComposite.isLax())
{
s_logger.debug("Ignoring the element");
m_stack.push(LAX_PART, null, null, 0, null);
return true;
}
}
else if (parentPart instanceof PrimitiveMessagePart)
{
if (acceptAnyTypeElement(sURI, sLocalName, attributes, (PrimitiveMessagePart)parentPart, 0))
{
return true;
}
}
throw new IntegrationException("err.integration.xml.invalidElement",
new Object[]{sURI, sLocalName, parentPart.getFullPath()});
}