if (ctd != null && !ctd.isRuntimeSchema() && compileTimeClass != null) {
/** * This method can both return null and throws exception. It returns null in case there is no definition * but it is OK (e.g. runtime schema). It throws exception if there is no definition and it is not OK. */ @SuppressWarnings("unchecked") private <ID extends ItemDefinition> ID determineItemDefinition(QName itemName, @Nullable ComplexTypeDefinition ctd) throws SchemaException { ID itemDefinition = ctd != null ? ctd.findLocalItemDefinition(itemName) : null; if (itemDefinition != null) { return itemDefinition; } if (ctd == null || ctd.isXsdAnyMarker() || ctd.isRuntimeSchema()) { // If we have prism context, try to locate global definition. But even if that is not // found it is still OK. This is runtime container. We tolerate quite a lot here. PrismContext prismContext = getPrismContext(); if (prismContext != null) { return (ID) prismContext.getSchemaRegistry().resolveGlobalItemDefinition(itemName, ctd); } else { return null; } } else { throw new SchemaException("No definition for item " + itemName + " in " + getParent()); } }
if (complexTypeDefinition == null || complexTypeDefinition.isXsdAnyMarker() || complexTypeDefinition.isRuntimeSchema()) { PrismSchema itemSchema = getSchemaRegistry().findSchemaByNamespace(itemName.getNamespaceURI()); if (itemSchema != null) {
if (!definitionToUse.isRuntimeSchema() && definitionToUse.getCompileTimeClass() != null) {
PrismAsserts.assertItemDefinitionDisplayName(complexTypeDefinition, ObjectType.F_DESCRIPTION, "ObjectType.description"); PrismAsserts.assertItemDefinitionDisplayOrder(complexTypeDefinition, ObjectType.F_DESCRIPTION, 10); assertFalse(""+defDesc+" definition is marked as runtime", complexTypeDefinition.isRuntimeSchema());