Examples of SchemaReader


Examples of com.arconsis.android.datarobot.builder.schema.reader.SchemaReader

    return typeElement.getQualifiedName().toString();
  }

  private void generateDbSchema(final String packageName, final Set<? extends Element> entityAnnotated, final Persistence persistence,
                  String updateHookName, final String createHookName) {
    SchemaReader schemaReader = new SchemaReader(persistence, updateHookName, createHookName, entityAnnotated, messager);
    SchemaWriter schemaWriter = new SchemaWriter(packageName, SchemaConstants.DB, schemaReader.read());

    JavaFileWriter javaFileWriter = new JavaFileWriter(packageName, SchemaConstants.DB, processingEnv);
    javaFileWriter.write(schemaWriter.write());
  }
View Full Code Here

Examples of com.arconsis.android.datarobot.builder.schema.reader.SchemaReader

    return typeElement.getQualifiedName().toString();
  }

  private void generateDbSchema(final String packageName, final Set<? extends Element> entityAnnotated, final Persistence persistence,
      final String updateHookName) {
    SchemaReader schemaReader = new SchemaReader(persistence, updateHookName, entityAnnotated, messager);
    SchemaWriter schemaWriter = new SchemaWriter(packageName, SchemaConstants.DB, schemaReader.read());

    JavaFileWriter javaFileWriter = new JavaFileWriter(packageName, SchemaConstants.DB, processingEnv);
    javaFileWriter.write(schemaWriter.write());
  }
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

        InputSource in = ValidationDriver.uriOrFileInputSource(schema.getAbsolutePath());
        PropertyMapBuilder properties = new PropertyMapBuilder();
      ByteArrayOutputStream error = new ByteArrayOutputStream();
        ErrorHandlerImpl eh = new ErrorHandlerImpl(new BufferedWriter(new OutputStreamWriter(error)));
        ValidateProperty.ERROR_HANDLER.put(properties, eh);
        SchemaReader schemaReader = new AutoSchemaReader();
        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
        if (driver.loadSchema(in)) {
            if (driver.validate(ValidationDriver.uriOrFileInputSource(xml.getAbsolutePath()))) {
                log.debug("" + error);
                return null;
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

        InputSource in = ValidationDriver.uriOrFileInputSource(schema.getAbsolutePath());
        PropertyMapBuilder properties = new PropertyMapBuilder();
  ByteArrayOutputStream error = new ByteArrayOutputStream();
        ErrorHandlerImpl eh = new ErrorHandlerImpl(new BufferedWriter(new OutputStreamWriter(error)));
        ValidateProperty.ERROR_HANDLER.put(properties, eh);
        SchemaReader schemaReader = new AutoSchemaReader();
        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
        if (driver.loadSchema(in)) {
            if (driver.validate(ValidationDriver.uriOrFileInputSource(xml.getAbsolutePath()))) {
                System.out.println("" + error);
                return null;
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

            PropertyMapBuilder properties = new PropertyMapBuilder();
            error = new ByteArrayOutputStream();
            ErrorHandlerImpl eh = new ErrorHandlerImpl(
                    new BufferedWriter(new OutputStreamWriter(error)));
            ValidateProperty.ERROR_HANDLER.put(properties, eh);
            SchemaReader schemaReader = new AutoSchemaReader();
            ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
            if (driver.loadSchema(schemaInputSource)) {
                if (driver.validate(xmlInputSource)) {
                    log.debug("" + error);
                    return null;
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

            final PropertyMapBuilder properties = new PropertyMapBuilder();
            ValidateProperty.ERROR_HANDLER.put(properties, report);

            // Copied from Jing code ; the Compact syntax seem to have a different
            // Schema reader. To be investigated. http://www.thaiopensource.com/relaxng/api/jing/index.html
            final SchemaReader schemaReader = grammarUrl.endsWith(".rnc") ? CompactSchemaReader.getInstance() : null;

            // Setup driver
            final ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);

            // Load schema
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

        XdmNode schema = schemaSource.read();
        XdmNode root = S9apiUtils.getDocumentElement(schema);

        docBaseURI = doc.getBaseURI();

        SchemaReader sr = null;

        boolean compact = XProcConstants.c_data.equals(root.getNodeName());

        String contentType = root.getAttributeValue(XProcConstants.c_content_type);
        if (contentType != null) {
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

            // Validate using resource specified in second parameter
            grammar = Shared.getInputSource(args[1].itemAt(0), context);

            // Special setup for compact notation
            final String grammarUrl = grammar.getSystemId();
            final SchemaReader schemaReader
                    = ( (grammarUrl != null) && (grammarUrl.endsWith(".rnc")) )
                    ? CompactSchemaReader.getInstance() : null;

            // Setup validation properties. see Jing interface
            final PropertyMapBuilder properties = new PropertyMapBuilder();
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

        InputSource in = ValidationDriver.uriOrFileInputSource(schema.getAbsolutePath());
        PropertyMapBuilder properties = new PropertyMapBuilder();
      ByteArrayOutputStream error = new ByteArrayOutputStream();
        ErrorHandlerImpl eh = new ErrorHandlerImpl(new BufferedWriter(new OutputStreamWriter(error)));
        ValidateProperty.ERROR_HANDLER.put(properties, eh);
        SchemaReader schemaReader = new AutoSchemaReader();
        ValidationDriver driver = new ValidationDriver(properties.toPropertyMap(), schemaReader);
        if (driver.loadSchema(in)) {
            if (driver.validate(ValidationDriver.uriOrFileInputSource(xml.getAbsolutePath()))) {
                log.debug("" + error);
                return null;
View Full Code Here

Examples of com.thaiopensource.validate.SchemaReader

    throws SAXException, IOException {
        if (! Validator.GRAMMAR_RELAX_NG.equals(grammar)) {
            throw new IllegalArgumentException("Unsupported grammar " + grammar);
        }

        SchemaReader schemaReader = SAXSchemaReader.getInstance();
        JingResolver context = new JingResolver(sourceResolver, entityResolver);
        InputSource input = context.resolveSource(source);

        try {
            /* Create a simple property map builder */
            PropertyMapBuilder builder = new PropertyMapBuilder();
            ValidateProperty.ENTITY_RESOLVER.put(builder, context);
            ValidateProperty.XML_READER_CREATOR.put(builder, context);
            ValidateProperty.ERROR_HANDLER.put(builder,
                                               DraconianErrorHandler.INSTANCE);
            PropertyMap validatorProperties = builder.toPropertyMap();

            /* Parse, rewrap, and return the schema */
            final com.thaiopensource.validate.Schema schema;
            schema = schemaReader.createSchema(input, validatorProperties);
            return new JingSchema(schema, context.close());

        } catch (IncorrectSchemaException exception) {
            String message = "Incorrect schema \"" + source.getURI() + "\"";
            throw new SAXException(message, exception);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.