private ComplexTypeDefinition findComplexTypeDefinition(QName typeQName) { ComplexTypeDefinition complexTypeDefinition = schema.findComplexTypeDefinitionByType(typeQName); if (complexTypeDefinition == null) { complexTypeDefinition = getSchemaRegistry().findComplexTypeDefinitionByType(typeQName); } return complexTypeDefinition; }
@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); // Multiplicity is fixed to a single-value here 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; }
private SimpleTypeDefinition processSimpleTypeDefinition(XSSimpleType simpleType) throws SchemaException { SchemaDefinitionFactory definitionFactory = getDefinitionFactory(); SimpleTypeDefinitionImpl std = (SimpleTypeDefinitionImpl) definitionFactory.createSimpleTypeDefinition(simpleType, prismContext, simpleType.getAnnotation()); SimpleTypeDefinition existingSimpleTypeDefinition = schema.findSimpleTypeDefinitionByType(std.getTypeName()); if (existingSimpleTypeDefinition != null) { // We already have this in schema. So avoid redundant work return existingSimpleTypeDefinition; } markRuntime(std); QName superType = determineSupertype(simpleType); if (superType != null) { std.setSuperType(superType); } setInstantiationOrder(std, simpleType.getAnnotation()); extractDocumentation(std, simpleType.getAnnotation()); if (getSchemaRegistry() != null) { Class<?> compileTimeClass = getSchemaRegistry().determineCompileTimeClass(std.getTypeName()); std.setCompileTimeClass(compileTimeClass); } schema.add(std); return std; }
Class<?> compileTimeClass = getSchemaRegistry().determineCompileTimeClass(ctd.getTypeName()); ctd.setCompileTimeClass(compileTimeClass);