/** * Must be called before call to initialize() * @param node */ public void registerSchema(Node node, String sourceDescription) throws SchemaException { SchemaDescription desc = SchemaDescriptionImpl.parseNode(node, sourceDescription); registerSchemaDescription(desc); }
/** * Must be called before call to initialize() */ public void registerPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) throws SchemaException { registerPrismSchemaResource(resourcePath, usualPrefix, compileTimeClassesPackage, false, false); }
@Override public MutablePrismSchema createPrismSchema(String namespace) { return new PrismSchemaImpl(namespace, prismContext); } }
private static PrismSchema parse(Element element, EntityResolver resolver, PrismSchemaImpl schema, boolean isRuntime, String shortDescription, boolean allowDelayedItemDefinitions, PrismContext prismContext) throws SchemaException { if (element == null) { throw new IllegalArgumentException("Schema element must not be null in "+shortDescription); } setSchemaNamespace(schema, element); DomToSchemaProcessor processor = new DomToSchemaProcessor(resolver, prismContext); processor.parseSchema(schema, element, isRuntime, allowDelayedItemDefinitions, shortDescription); return schema; }
public static void parseSchemas(Element wrapperElement, XmlEntityResolver resolver, List<SchemaDescription> schemaDescriptions, boolean allowDelayedItemDefinitions, PrismContext prismContext) throws SchemaException { for (SchemaDescription schemaDescription : schemaDescriptions) { setSchemaNamespace((PrismSchemaImpl) schemaDescription.getSchema(), schemaDescription.getDomElement()); } DomToSchemaProcessor processor = new DomToSchemaProcessor(resolver, prismContext); processor.parseSchemas(schemaDescriptions, wrapperElement, allowDelayedItemDefinitions, "multiple schemas"); }
private boolean isResourceObject(XSAnnotation annotation) { // annotation: resourceObject if (SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_RESOURCE_OBJECT) != null) { return true; } // annotation: accountType DEPRECATED if (SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_ACCOUNT) != null) { // <accountType> implies <resourceObject> ... at least for now (compatibility) return true; } return false; }
public static SchemaDescription parseNode(Node node, String sourceDescription) throws SchemaException { SchemaDescriptionImpl desc = new SchemaDescriptionImpl(sourceDescription); desc.node = node; desc.fetchBasicInfoFromSchema(); return desc; }
@Override public <C extends Containerable> PrismContainerDefinition<C> createExtraDefinitionFromComplexType(XSComplexType complexType, ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext, XSAnnotation annotation) throws SchemaException { // if (complexTypeDefinition instanceof ObjectClassComplexTypeDefinition) { // return createResourceAttributeContainerDefinition(complexType, (ObjectClassComplexTypeDefinition)complexTypeDefinition, // prismContext, annotation); // } return super.createExtraDefinitionFromComplexType(complexType, complexTypeDefinition, prismContext, annotation); }
public InputStream openInputStream() { if (!canInputStream()) { throw new IllegalStateException("Schema "+sourceDescription+" cannot provide input stream"); } return streamable.openInputStream(); }
public SchemaDescription loadPrismSchemaDescription(InputStream input, String sourceDescription) throws SchemaException { SchemaDescription desc = SchemaDescriptionImpl.parseInputStream(input, sourceDescription); desc.setPrismSchema(true); registerSchemaDescription(desc); return desc; }
/** * Must be called before call to initialize() */ public void registerPrismSchemaResource(String resourcePath, String usualPrefix) throws SchemaException { SchemaDescription desc = SchemaDescriptionImpl.parseResource(resourcePath); desc.setUsualPrefix(usualPrefix); desc.setPrismSchema(true); registerSchemaDescription(desc); }
@Override public void fatalError(SAXParseException e) throws SAXException { print("[Fatal]", e); throw e; }
@Override public boolean areComparable(QName type1, QName type2) throws SchemaException { try { selectMoreSpecific(type1, type2); return true; } catch (SchemaException e) { return false; } }
private boolean isObjectReference(XSType xsType, XSAnnotation annotation) { if (isObjectReference(annotation)) { return true; } return isObjectReference(xsType); }
/** * Returns true if provides XSD type is an object definition. It looks for a * ObjectType supertype. */ private boolean isObjectDefinition(XSType xsType) { return SchemaProcessorUtil.hasAnnotation(xsType, A_OBJECT); }
/** * Must be called before call to initialize() */ public void registerPrismDefaultSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) throws SchemaException { registerPrismSchemaResource(resourcePath, usualPrefix, compileTimeClassesPackage, true, true); }
/** * Must be called before call to initialize() * @param node */ public void registerSchema(Node node, String sourceDescription, String usualPrefix) throws SchemaException { SchemaDescription desc = SchemaDescriptionImpl.parseNode(node, sourceDescription); desc.setUsualPrefix(usualPrefix); registerSchemaDescription(desc); }
private boolean isObjectReference(XSAnnotation annotation) { Element objRefAnnotationElement = SchemaProcessorUtil.getAnnotationElement(annotation, A_OBJECT_REFERENCE); return (objRefAnnotationElement != null); }
@Override public void error(SAXParseException e) throws SAXException { print("[Error]", e); throw e; }
/** * Must be called before call to initialize() */ public void registerPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage, boolean prefixDeclaredByDefault) throws SchemaException { registerPrismSchemaResource(resourcePath, usualPrefix, compileTimeClassesPackage, false, prefixDeclaredByDefault); }