@SuppressWarnings({ "rawtypes", "unchecked" })
private MutablePrismContainerDefinition<?> createPropertyContainerDefinition(XSType xsType,
XSElementDecl elementDecl, ComplexTypeDefinition complexTypeDefinition,
XSAnnotation annotation, XSParticle elementParticle, boolean topLevel)
throws SchemaException {
QName elementName = new QName(elementDecl.getTargetNamespace(), elementDecl.getName());
MutablePrismContainerDefinition<?> pcd;
SchemaDefinitionFactory definitionFactory = getDefinitionFactory();
Class compileTimeClass = null;
if (getSchemaRegistry() != null && complexTypeDefinition != null) {
compileTimeClass = getSchemaRegistry().determineCompileTimeClass(complexTypeDefinition.getTypeName());
}
if (isObjectDefinition(xsType)) {
pcd = definitionFactory.createObjectDefinition(elementName, complexTypeDefinition, prismContext, compileTimeClass);
pcd.setMinOccurs(1);
pcd.setMaxOccurs(1);
} else {
pcd = definitionFactory.createContainerDefinition(elementName, complexTypeDefinition, prismContext, compileTimeClass);
setMultiplicity(pcd, elementParticle, elementDecl.getAnnotation(), topLevel);
}
markRuntime(pcd);
parseItemDefinitionAnnotations(pcd, annotation);
parseItemDefinitionAnnotations(pcd, elementDecl.getAnnotation());
if (elementParticle != null) {
parseItemDefinitionAnnotations(pcd, elementParticle.getAnnotation());
}
return pcd;
}