@Service public class SchemaService extends Object
setSchema(List)
to set the schema.
The schema is of the form:
{
"meta": { meta information },
"data": [ the columns ]
}
Each entry in data is of the form:
{
"id": "a string id",
"type": "field",
"attributes": {
"name": "the field name",
"type": "one of BOOLEAN, INTEGER, LONG, FLOAT, DOUBLE, STRING, BOOLEAN_MAP, INTEGER_MAP, LONG_MAP,
FLOAT_MAP, DOUBLE_MAP, STRING_MAP, BOOLEAN_MAP_MAP, INTEGER_MAP_MAP, LONG_MAP_MAP,
FLOAT_MAP_MAP, DOUBLE_MAP_MAP, STRING_MAP_MAP, BOOLEAN_LIST, INTEGER_LIST, LONG_LIST,
FLOAT_LIST, DOUBLE_LIST, STRING_LIST, BOOLEAN_MAP_LIST, INTEGER_MAP_LIST, LONG_MAP_LIST,
FLOAT_MAP_LIST, DOUBLE_MAP_LIST, STRING_MAP_LIST"
"description": "an optional description of this column",
"subFields": [ include enumerated subfields (field must be of type MAP) of the form
{"name": "the name of the subfield", "description": "a description for it"}
]
"subSubFields": [ include enumerated subSubfields (field must be of type MAP_MAP) of the form
{"name": "the name of the subsubfield", "description": "a description for it"}
]
"subListFields": [ include enumerated subListfields (field must be of type MAP_LIST) of the form
{"name": "the name of the sublistfield", "description": "a description for it"}
]
}
}
Modifier and Type | Field and Description |
---|---|
static com.google.gson.Gson |
GSON |
static String |
VERSION_KEY |
Constructor and Description |
---|
SchemaService(String version,
String filePath)
Constructor that takes in a a string file path and a version string and loads the contents of the file.
|
public static final com.google.gson.Gson GSON
public static final String VERSION_KEY
@Autowired public SchemaService(@Value(value="${bullet.schema.version}") String version, @Value(value="${bullet.schema.file}") String filePath)
version
- The schema version.filePath
- The filePath to the file.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.