Skip to content

Commit

Permalink
support multiple schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
kropp committed Aug 4, 2015
1 parent 0a226de commit 2abf8cc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions generator/src/main/kotlin/generator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class GeneratorSink : TripleSink {
}

override fun endStream() {
}

public fun postProcess() {
for (type in types.values()) {
if (type.isField && type.isInterface) {
type.isField = false
Expand Down Expand Up @@ -458,9 +461,13 @@ class GeneratorSink : TripleSink {

fun main(args: Array<String>) {
val generator = GeneratorSink()
val sp = StreamProcessor(RdfaParser.connect(generator))
val stream = FileInputStream("generator/resources/schema.rdfa")
sp.process(stream, "http://schema.org/")
val processor = StreamProcessor(RdfaParser.connect(generator))

File("generator/resources").listFiles { it.extension == "rdfa" }?.forEach {
println("Processing ${it.name}")
processor.process(FileInputStream(it), "http://schema.org/")
}
generator.postProcess()

generator.writeJava(File("src/main/java"), "org.schema")
}

0 comments on commit 2abf8cc

Please sign in to comment.