Search in sources :

Example 1 with XSDAnnotationFactory

use of org.forgerock.openicf.connectors.xml.xsdparser.XSDAnnotationFactory in project openicf by Evolveum.

the class SchemaParserUtil method parseXSDSchema.

public static XSSchemaSet parseXSDSchema(File file) {
    XSOMParser parser = new XSOMParser();
    try {
        parser.setAnnotationParser(new XSDAnnotationFactory());
        parser.parse(file);
        return parser.getResult();
    } catch (SAXException e) {
        String eMessage = "Failed to parse XSD-schema from file: " + file.getAbsolutePath();
        log.error(e, eMessage);
        throw new ConnectorIOException(eMessage, e);
    } catch (IOException e) {
        String eMessage = "Failed to read from file: " + file.getAbsolutePath();
        log.error(e, eMessage);
        throw new ConnectorIOException(eMessage, e);
    }
}
Also used : ConnectorIOException(org.identityconnectors.framework.common.exceptions.ConnectorIOException) XSDAnnotationFactory(org.forgerock.openicf.connectors.xml.xsdparser.XSDAnnotationFactory) XSOMParser(com.sun.xml.xsom.parser.XSOMParser) IOException(java.io.IOException) ConnectorIOException(org.identityconnectors.framework.common.exceptions.ConnectorIOException) SAXException(org.xml.sax.SAXException)

Aggregations

XSOMParser (com.sun.xml.xsom.parser.XSOMParser)1 IOException (java.io.IOException)1 XSDAnnotationFactory (org.forgerock.openicf.connectors.xml.xsdparser.XSDAnnotationFactory)1 ConnectorIOException (org.identityconnectors.framework.common.exceptions.ConnectorIOException)1 SAXException (org.xml.sax.SAXException)1