CharactersHandler charactersHandler = new ValueHandler(entryInfo.getProperty("value"), valueType);
entryType.setSimpleType(charactersHandler);
}
}
SequenceBinding keyValueSequence = null;
if(keyElement != null)
{
keyValueSequence = new SequenceBinding(schemaBinding);
if(entryType == null)
{
keyValueSequence.setSkip(Boolean.FALSE);
keyValueSequence.setQName(propertyQName);
schemaBinding.addGroup(keyValueSequence.getQName(), keyValueSequence);
ParticleBinding keyValueParticle = new ParticleBinding(keyValueSequence, 0, -1, true);
targetGroup.addParticle(keyValueParticle);
keyValueSequence.setHandler(entryHandler);
}
else
{
ParticleBinding keyValueParticle = new ParticleBinding(keyValueSequence, 1, 1, false);
entryType.setParticle(keyValueParticle);
}
// key element
TypeBinding keyTypeBinding = resolveTypeBinding(keyType);
String keyNs = keyElement.namespace();
if(JBossXmlConstants.DEFAULT.equals(keyNs))
keyNs = defaultNamespace;
ElementBinding keyElementBinding = createElementBinding(keyType, keyTypeBinding, new QName(keyNs, keyElement.name()), false);
ParticleBinding particle = new ParticleBinding(keyElementBinding, 1, 1, false);
keyValueSequence.addParticle(particle);
PropertyHandler keyHandler = new PropertyHandler(entryInfo.getProperty("key"), keyType);
entryAdapterFactory.addProperty(keyElementBinding.getQName(), keyHandler);
}
if(valueElement != null)
{
TypeBinding valueTypeBinding = resolveTypeBinding(valueType);
String valueNs = valueElement.namespace();
if(JBossXmlConstants.DEFAULT.equals(valueNs))
valueNs = defaultNamespace;
ElementBinding valueElementBinding = createElementBinding(valueType, valueTypeBinding, new QName(valueNs, valueElement.name()), false);
ParticleBinding particle = new ParticleBinding(valueElementBinding, 1, 1, false);
keyValueSequence.addParticle(particle);
PropertyHandler valueHandler = new PropertyHandler(entryInfo.getProperty("value"), valueType);
entryAdapterFactory.addProperty(valueElementBinding.getQName(), valueHandler);
}
// TODO: need to verify correct binding before proceeding