All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codeblessing.sourceamazing.xmlschema.schemacreator.XmlSchemaInitializer.kt Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
package org.codeblessing.sourceamazing.xmlschema.schemacreator

import org.codeblessing.sourceamazing.api.filesystem.FileSystemAccess
import org.codeblessing.sourceamazing.api.process.schema.SchemaAccess
import java.nio.file.Path

object XmlSchemaInitializer {

    fun createSchemaDirectory(definitionDirectory: Path, fileSystemAccess: FileSystemAccess): Path {
        val schemaDirectory = definitionDirectory.resolve("schema")
        fileSystemAccess.createDirectory(schemaDirectory)
        return schemaDirectory
    }

    fun initializeXmlSchemaFile(
        schemaDirectory: Path,
        schema: SchemaAccess,
        fileSystemAccess: FileSystemAccess
    ) {
        val xmlSchemaFileContent = XmlDomSchemaCreator.createXsdSchemaContent(schema)
        val xmlSchemaFileName = "sourceamazing-xml-schema.xsd"
        fileSystemAccess.writeFile(schemaDirectory.resolve(xmlSchemaFileName), xmlSchemaFileContent)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy