blob: e145f8ee0903a5c684ac37606e0f14b83b7604df (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.buildergen;
import com.google.common.io.Files;
import com.yahoo.config.codegen.DefParser;
import com.yahoo.config.codegen.InnerCNode;
import com.yahoo.config.codegen.JavaClassBuilder;
import com.yahoo.text.StringUtilities;
import java.io.File;
import java.io.StringReader;
/**
* Represents a higher level functionality on a config definition to (in the future) hide the InnerCNode class.
* @author Ulf Lilleengen
*/
public class ConfigDefinition {
private final String name;
private final String[] defSchema;
private final InnerCNode cnode;
// TODO: Should have namespace
public ConfigDefinition(String name, String[] defSchema) {
this.name = name;
this.defSchema = defSchema;
this.cnode = new DefParser(name, new StringReader(StringUtilities.implode(defSchema, "\n"))).getTree();
}
public InnerCNode getCNode() {
return cnode;
}
}
|