org.codeblessing.sourceamazing.xmlschema.schemacreator.XmlSchemaInitializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sourceamazing-xml-schema Show documentation
Show all versions of sourceamazing-xml-schema Show documentation
Creates out of the SourceAmazing schema a XML Schema to maintain the input data.
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