log.trace("Wildcard " + wildcardProperty.getName() + " is a collection of type " + type.getName());
}
XmlAnyElement xmlAnyElement = wildcardProperty.getUnderlyingAnnotation(XmlAnyElement.class);
boolean isLax = xmlAnyElement == null ? true : xmlAnyElement.lax();
WildcardBinding wildcard = new WildcardBinding(schemaBinding);
if (isLax)
wildcard.setProcessContents((short) 3); // Lax
else
wildcard.setProcessContents((short) 1); // Strict
// Dom element?
if (Element.class.getName().equals(type.getName()))
{
wildcard.setUnresolvedElementHandler(DOMHandler.INSTANCE);
wildcard.setUnresolvedCharactersHandler(DOMHandler.INSTANCE);
}
// Bind the particle to the model
ParticleBinding particleBinding = new ParticleBinding(wildcard);
particleBinding.setMinOccurs(0);
particleBinding.setMaxOccurs(1);
localModel.addParticle(particleBinding);
typeBinding.getWildcard().setWildcardHandler((ParticleHandler) wildcardHandler);
beanAdapterFactory.setWildcardHandler(wildcardHandler);
}
JBossXmlChildWildcard childWildcard = typeInfo.getUnderlyingAnnotation(JBossXmlChildWildcard.class);
if (childWildcard != null)
{
if (beanAdapterFactory.getWildcardHandler() != null)
throw new RuntimeException("Cannot have both @JBossXmlChildWildcard and @XmlAnyElement");
ParticleHandler childWildcardHandler = null;
if (typeInfo.isCollection())
{
if (childWildcard.wrapper() != Object.class)
{
BeanInfo wrapperInfo = JBossXBBuilder.configuration.getBeanInfo(childWildcard.wrapper());
childWildcardHandler = new ChildCollectionWildcardHandler(wrapperInfo, childWildcard.property());
}
else
childWildcardHandler = ChildCollectionWildcardHandler.SINGLETON;
}
else
throw new UnsupportedOperationException("TODO");
WildcardBinding wildcard = new WildcardBinding(schemaBinding);
if (childWildcard.lax())
wildcard.setProcessContents((short) 3); // Lax
else
wildcard.setProcessContents((short) 1); // Strict
ParticleBinding particleBinding = new ParticleBinding(wildcard);
particleBinding.setMinOccurs(0);
particleBinding.setMaxOccurs(1);
model.addParticle(particleBinding);