public class ValidationMessageBase<I extends ModelBuilder.ValidationMessage,S extends ValidationMessageBase<I,S>> extends Schema<I,S>
Schema.Meta
Modifier and Type | Field and Description |
---|---|
java.lang.String |
field_name |
java.lang.String |
message |
java.lang.String |
message_type |
__meta, _impl_class, _version_pattern, EXCLUDE_FIELDS, INCLUDE_FIELDS
Constructor and Description |
---|
ValidationMessageBase() |
Modifier and Type | Method and Description |
---|---|
I |
createImpl()
Create an implementation object and any child objects but DO NOT fill them.
|
S |
fillFromImpl(ModelBuilder.ValidationMessage vm)
Version and Schema-specific filling from the implementation object.
|
static void |
mapValidationMessageFieldNames(ValidationMessageBase[] validation_messages,
java.lang.String[] from,
java.lang.String[] to)
Map impl field names in the validation messages to schema field names,
called after behavior of stripping leading _ characters.
|
acceptsFrame, createAndFillImpl, extractVersion, fillFromParms, fillImpl, getExperimentalVersion, getHighestSupportedVersion, getImplClass, getImplClass, getLatestVersion, getSchemaVersion, markdown, markdown, markdown, markdown, newInstance, register, registerAllSchemasIfNecessary, schema, schema, schema, schema, schema, schemaClass, schemaClass, schemaClass, schemaClass, schemas
clone, frozenType, read_impl, read, readExternal, readJSON_impl, readJSON, toJsonString, write_impl, write, writeExternal, writeHTML_impl, writeHTML, writeJSON_impl, writeJSON
@API(help="Type of validation message (ERROR, WARN, INFO, HIDE)", direction=OUTPUT) public java.lang.String message_type
@API(help="Field to which the message applies", direction=OUTPUT) public java.lang.String field_name
public static void mapValidationMessageFieldNames(ValidationMessageBase[] validation_messages, java.lang.String[] from, java.lang.String[] to)
public I createImpl()
Schema
For objects without children this method does all the required work. For objects with children the subclass will need to override, e.g. by calling super.createImpl() and then calling createImpl() on its children.
Note that impl objects for schemas which override this method don't need to have a default constructor (e.g., a Keyed object constructor can still create and set the Key), but they must not fill any fields which can be filled later from the schema.
TODO: We *could* handle the common case of children with the same field names here by finding all of our fields that are themselves Schemas.
createImpl
in class Schema<I extends ModelBuilder.ValidationMessage,S extends ValidationMessageBase<I,S>>
public S fillFromImpl(ModelBuilder.ValidationMessage vm)
Schema
fillFromImpl
in class Schema<I extends ModelBuilder.ValidationMessage,S extends ValidationMessageBase<I,S>>