Interface IValueDescriptorFactory
- 
- All Known Implementing Classes:
- ValueDescriptorFactory
 
 public interface IValueDescriptorFactoryFactory for creatingIValueDescriptors. This includes methods that createIValueDescriptorBuilders that let you configure the descriptor, as well as some convenience methods that return preconfigured descriptors. A value descriptor indicates the type a value must have and may impose additional restrictions on the allowed values.You may create descriptors once during startup and store them statically. Also, please note that these builder methods perform checks and will throw an error if an invalid configuration is detected. - Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
 
- 
- 
Method Summary
 
- 
- 
- 
Method Detail- 
accessAtPathList<?> accessAtPath(Object base, String path) Access a nested property in an object at a given JSON path.- Parameters:
- base- Base object with data to access.
- path- JSON path to the data to access.
- Returns:
- The data at the given path in the base object.
 
 - 
anydefault IAnyValueDescriptor any(Object defaultValue) - Parameters:
- defaultValue- The default value for the any property, used when no other value is supplied.
- Returns:
- A descriptor for an any value that defaults to the given value. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
anyBuilderIAnyValueDescriptorBuilder anyBuilder() - Returns:
- A descriptor builder for an any value.
 
 - 
booldefault IBooleanValueDescriptor bool() - Returns:
- A descriptor for a boolean value that defaults to false. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
booldefault IBooleanValueDescriptor bool(boolean defaultValue) - Parameters:
- defaultValue- The default value for the boolean property, used when no other value is supplied.
- Returns:
- A descriptor for a boolean value that defaults to the given value. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
booldefault IBooleanValueDescriptor bool(boolean defaultValue, String descriptionI18n) - Parameters:
- defaultValue- The default value for the boolean property, used when no other value is supplied.
- descriptionI18n- The i18n key to use for the description of the boolean property.
- Returns:
- A descriptor for a boolean value that defaults to the given value and uses the given description.
 
 - 
boolBuilderIBooleanValueDescriptorBuilder boolBuilder() - Returns:
- A descriptor builder for a boolean value.
 
 - 
constantdefault IConstValueDescriptor<Boolean> constant(boolean value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor for a value that only admits the given constant boolean value.
 
 - 
constantdefault IConstValueDescriptor<Double> constant(double value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor for a value that only admits the given constant floating point value.
 
 - 
constantdefault IConstValueDescriptor<Long> constant(long value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor for a value that only admits the given constant integer value.
 
 - 
constantdefault IConstValueDescriptor<String> constant(String value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor for a value that only admits the given constant string value.
 
 - 
constantBuilderIConstValueDescriptorBuilder<Boolean> constantBuilder(boolean value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor builder for a boolean value that only admits a constant instance.
 
 - 
constantBuilderIConstValueDescriptorBuilder<Double> constantBuilder(double value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor builder for a floating point value that only admits a constant instance.
 
 - 
constantBuilderIConstValueDescriptorBuilder<Long> constantBuilder(long value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor builder for an integer value that only admits a constant instance.
 
 - 
constantBuilderIConstValueDescriptorBuilder<String> constantBuilder(String value) - Parameters:
- value- The constant value that the descriptor should allow.
- Returns:
- A descriptor builder for a string value that only admits a constant instance.
 
 - 
floatingdefault IFloatValueDescriptor floating() - Returns:
- A descriptor for a floating point value that defaults to 0. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
floatingdefault IFloatValueDescriptor floating(double defaultValue) - Parameters:
- defaultValue- The default value for the floating point property, used when no other value is supplied.
- Returns:
- A descriptor for a floating point value that defaults to the given value. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
floatingdefault IFloatValueDescriptor floating(double defaultValue, String descriptionI18n) - Parameters:
- defaultValue- The default value for the floating point property, used when no other value is supplied.
- descriptionI18n- The i18n key to use for the description of the floating point property.
- Returns:
- A descriptor for a floating point value that defaults to the given value and uses the given description.
 
 - 
floatingBuilderIFloatValueDescriptorBuilder floatingBuilder() - Returns:
- A descriptor builder for a floating point value.
 
 - 
integerdefault IIntegerValueDescriptor integer() - Returns:
- A descriptor for an integer value that defaults to 0. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
integerdefault IIntegerValueDescriptor integer(long defaultValue) - Parameters:
- defaultValue- The default value for the integer property, used when no other value is supplied.
- Returns:
- A descriptor for an integer value that defaults to the given value. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
integerdefault IIntegerValueDescriptor integer(long defaultValue, String descriptionI18n) - Parameters:
- defaultValue- The default value for the integer property, used when no other value is supplied.
- descriptionI18n- The i18n key to use for the description of the integer property.
- Returns:
- A descriptor for an integer value that defaults to the given value and uses the given description.
 
 - 
integerBuilderIIntegerValueDescriptorBuilder integerBuilder() - Returns:
- A descriptor builder for an integer value.
 
 - 
largeStringdefault ILargeStringValueDescriptor largeString() - Returns:
- A descriptor for a large string value that defaults to the empty string. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
largeStringdefault ILargeStringValueDescriptor largeString(LargeString defaultValue) - Parameters:
- defaultValue- The default value for the string property, used when no other value is supplied.
- Returns:
- A descriptor for a large string value that defaults to the given value. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
largeStringdefault ILargeStringValueDescriptor largeString(LargeString defaultValue, String descriptionI18n) - Parameters:
- defaultValue- The default value for the string property, used when no other value is supplied.
- descriptionI18n- The i18n key to use for the description of the string property.
- Returns:
- A descriptor for a large string value that defaults to the given value and uses the given description.
 
 - 
largeStringBuilderILargeStringValueDescriptorBuilder largeStringBuilder() - Returns:
- A descriptor builder for a large string value.
 
 - 
listdefault <V> IListValueDescriptor<V> list(IValueDescriptor<V,? extends IValueBuilder<V>> descriptor) - Type Parameters:
- V- Type of the elements contained in the list.
- Parameters:
- descriptor- Descriptor for the elements contained in the list.
- Returns:
- A descriptor for a list value (List<V>) that defaults to an empty list and may contain any number of elements.
 
 - 
listdefault <V> IListValueDescriptor<V> list(IValueDescriptorCreator<V> elementType) - Type Parameters:
- V- Type of the elements contained in the list.
- Parameters:
- elementType- Creates the descriptor for the type of the list elements.
- Returns:
- A descriptor for a list value (List<V>) that defaults to an empty list and may contain any number of elements.
 
 - 
listBuilder<V> IListValueDescriptorBuilder<V> listBuilder(IValueDescriptor<V,? extends IValueBuilder<V>> descriptor) - Type Parameters:
- V- Type of the elements contained in the list.
- Parameters:
- descriptor- Descriptor for the elements contained in the list.
- Returns:
- A descriptor builder for a list value (List<V>).
 
 - 
listBuilder<V> IListValueDescriptorBuilder<V> listBuilder(IValueDescriptorCreator<V> elementType) - Type Parameters:
- V- Type of the elements contained in the list.
- Parameters:
- elementType- Creates the descriptor for the type of the list elements.
- Returns:
- A descriptor builder for a list value (List<V>).
 
 - 
listOfLargeStringsdefault IListValueDescriptor<LargeString> listOfLargeStrings() - Returns:
- A descriptor builder for a value of type List<LargeString>. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
listOfLargeStringsdefault <V> IListValueDescriptor<LargeString> listOfLargeStrings(String descriptionI18n) - Parameters:
- descriptionI18n- The i18n key to use for the description of the list-valued property.
- Returns:
- A descriptor builder for a value of type List<LargeString>.
 
 - 
listOfStringsdefault IListValueDescriptor<String> listOfStrings() - Returns:
- A descriptor builder for a value of type List<String>. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
listOfStringsdefault <V> IListValueDescriptor<String> listOfStrings(String descriptionI18n) - Parameters:
- descriptionI18n- The i18n key to use for the description of the list-valued property.
- Returns:
- A descriptor builder for a value of type List<String>.
 
 - 
mapdefault <V> IMapValueDescriptor<V> map(IValueDescriptor<V,? extends IValueBuilder<V>> descriptor) - Type Parameters:
- V- Type of the mapped values.
- Parameters:
- descriptor- Descriptor for the type of the mapped values.
- Returns:
- A descriptor for a map value (Map<String, V>) that defaults to an empty map.
 
 - 
mapdefault <V> IMapValueDescriptor<V> map(IValueDescriptorCreator<V> elementType) - Type Parameters:
- V- Type of the mapped values.
- Parameters:
- elementType- Creates the descriptor for the type of the mapped values.
- Returns:
- A descriptor for a map value (Map<String, V>) that defaults to an empty map.
 
 - 
mapBuilder<V> IMapValueDescriptorBuilder<V> mapBuilder(IValueDescriptor<V,? extends IValueBuilder<V>> descriptor) - Type Parameters:
- V- Type of the mapped values.
- Parameters:
- descriptor- Descriptor for the type of the mapped values.
- Returns:
- A descriptor builder for a map value (Map<String, V>).
 
 - 
mapBuilder<V> IMapValueDescriptorBuilder<V> mapBuilder(IValueDescriptorCreator<V> elementType) - Type Parameters:
- V- Type of the mapped values.
- Parameters:
- elementType- Creates the descriptor for the type of the mapped values.
- Returns:
- A descriptor builder for a map value (Map<String, V>).
 
 - 
mapToLargeStringsdefault <V> IMapValueDescriptor<LargeString> mapToLargeStrings() - Returns:
- A descriptor builder for a value of type Map<String, LargeString>. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
mapToLargeStringsdefault <V> IMapValueDescriptor<LargeString> mapToLargeStrings(String descriptionI18n) - Parameters:
- descriptionI18n- The i18n key to use for the description of the map-valued property.
- Returns:
- A descriptor builder for a value of type Map<String, LargeString>.
 
 - 
mapToStringsdefault <V> IMapValueDescriptor<String> mapToStrings() - Returns:
- A descriptor builder for a value of type Map<String, String>. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
mapToStringsdefault <V> IMapValueDescriptor<String> mapToStrings(String descriptionI18n) - Parameters:
- descriptionI18n- The i18n key to use for the description of the map-valued property.
- Returns:
- A descriptor builder for a value of type Map<String, String>.
 
 - 
nullishdefault INullValueDescriptor nullish() - Returns:
- A descriptor for a value that can only be null.
 
 - 
nullishdefault INullValueDescriptor nullish(String descriptionI18n) - Parameters:
- descriptionI18n- The i18n key to use for the description of the map-valued property.
- Returns:
- A descriptor for a value that can only be null.
 
 - 
nullishBuilderINullValueDescriptorBuilder nullishBuilder() - Returns:
- A descriptor builder for a value that can only be null.
 
 - 
recordBuilderIRecordValueDescriptorBuilder recordBuilder() - Returns:
- A descriptor builder for a record value.
 
 - 
stringdefault IStringValueDescriptor string() - Returns:
- A descriptor for a string value that defaults to the empty string. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
stringdefault IStringValueDescriptor string(String defaultValue) - Parameters:
- defaultValue- The default value for the string property, used when no other value is supplied.
- Returns:
- A descriptor for a string value that defaults to the given value. The description uses the default i18n key determined from the root class and the path to this property.
 
 - 
stringdefault IStringValueDescriptor string(String defaultValue, String descriptionI18n) - Parameters:
- defaultValue- The default value for the string property, used when no other value is supplied.
- descriptionI18n- The i18n key to use for the description of the string property.
- Returns:
- A descriptor for a string value that defaults to the given value and uses the given description.
 
 - 
stringBuilderIStringValueDescriptorBuilder stringBuilder() - Returns:
- A descriptor builder for a string value.
 
 - 
tupledefault <V> ITupleValueDescriptor tuple(IValueDescriptor<V,? extends IValueBuilder<V>>... types) - Type Parameters:
- V- Common type of the tuple elements.
- Parameters:
- types- Descriptor for each element in the tuple.
- Returns:
- A descriptor for a tuple value that has a fixed length and where each element may have a different type. Each tuple element defaults to the default value of the given descriptor.
 
 - 
tupledefault ITupleValueDescriptor tuple(IValueDescriptorCreator<?>... types) - Parameters:
- types- Creates the descriptor for each element in the tuple.
- Returns:
- A descriptor for a tuple value that has a fixed length and where each element may have a different type. Each tuple element defaults to the default value of the given descriptor.
 
 - 
tupleBuilderITupleValueDescriptorBuilder tupleBuilder() - Returns:
- A descriptor builder for a tuple value with a fixed length and where each element has the same type. Each tuple element defaults to the default value of the given descriptor.
 
 - 
tupleOfSamedefault <V> ITupleValueDescriptor tupleOfSame(int count, IValueDescriptor<V,? extends IValueBuilder<V>> type) - Type Parameters:
- V- Common type of the tuple elements.
- Parameters:
- count- Number of elements in the tuple.
- type- Descriptor for each element in the tuple.
- Returns:
- A descriptor for a tuple value of the given length and where each element has the same type. Each tuple element defaults to the default value of the given descriptor.
 
 - 
tupleOfSamedefault ITupleValueDescriptor tupleOfSame(int count, IValueDescriptorCreator<?> creator) - Parameters:
- count- Number of elements in the tuple.
- creator- Creates the descriptor for each element in the tuple.
- Returns:
- A descriptor for a tuple value of the given length and where each element has the same type. Each tuple element defaults to the default value of the given descriptor.
 
 - 
unionBuilder<D> IUnionValueDescriptorBuilder<D> unionBuilder(Class<D> discriminatorClass) - Type Parameters:
- D- Type of the objects used to discriminate between the union members.
- Parameters:
- discriminatorClass- Class of the objects used to discriminate between the union members.
- Returns:
- A descriptor builder for a union value that uses instances of the given type as discriminators.
 
 - 
unionEmptydefault <D> IUnionValueDescriptor<D> unionEmpty() - Returns:
- An empty union type, the same as nullish().
 
 - 
unionEnumBuilderdefault <E extends Enum<E>> IUnionValueDescriptorBuilder<E> unionEnumBuilder(Class<E> discriminatorClass) - Type Parameters:
- E- Type of the enum constant used to discriminate between the union members.
- Parameters:
- discriminatorClass- Class of the enum constant used to discriminate between the union members.
- Returns:
- A descriptor builder for a union value that uses enum constants of the given type as discriminators.
 
 - 
unionOfEnumConstdefault <E extends Enum<E>> IUnionValueDescriptor<E> unionOfEnumConst(Class<E> enumClass) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- Returns:
- A descriptor for a union value that consists of all enum constants. Uses the enum constants as the discriminator.
 
 - 
unionOfEnumConstdefault <E extends Enum<E>> IUnionValueDescriptor<E> unionOfEnumConst(Class<E> enumClass, E defaultValue) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- defaultValue- Default value of the union.
- Returns:
- A descriptor for a union value that consists of all enum constants. Uses the enum constants as the discriminator.
 
 - 
unionOfEnumConstBuilderdefault <E extends Enum<E>> IUnionValueDescriptorBuilder<E> unionOfEnumConstBuilder(Class<E> enumClass) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- Returns:
- A descriptor builder for a union value that consists of all enum constants. Uses the enum constants as the discriminator.
 
 - 
unionOfEnumConstBuilderdefault <E extends Enum<E>> IUnionValueDescriptorBuilder<E> unionOfEnumConstBuilder(Class<E> enumClass, E defaultValue) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- defaultValue- Default value of the union.
- Returns:
- A descriptor builder for a union value that consists of all enum constants. Uses the enum constants as the discriminator.
 
 - 
unionOfStringConstdefault <E extends Enum<E>> IUnionValueDescriptor<String> unionOfStringConst(Class<E> enumClass) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- Returns:
- A descriptor for a union value that consists of all enum constants names. Uses the enum constants names as the discriminator.
 
 - 
unionOfStringConstdefault <E extends Enum<E>> IUnionValueDescriptor<String> unionOfStringConst(Class<E> enumClass, E defaultValue) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- defaultValue- Default value of the union.
- Returns:
- A descriptor for a union value that consists of all enum constants names. Uses the enum constants names as the discriminator.
 
 - 
unionOfStringConstdefault IUnionValueDescriptor<String> unionOfStringConst(String first, String... moreStrings) - Parameters:
- first- First string in the union. This is also the default value.
- moreStrings- More strings in the union.
- Returns:
- A value descriptor that represents the algebraic sum type "string1" | "string2" | "string3" | ....
 
 - 
unionOfStringConstBuilderdefault <E extends Enum<E>> IUnionValueDescriptorBuilder<String> unionOfStringConstBuilder(Class<E> enumClass) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- Returns:
- A descriptor builder for a union value that consists of all enum constants names. Uses the enum constants names as the discriminator.
 
 - 
unionOfStringConstBuilderdefault <E extends Enum<E>> IUnionValueDescriptorBuilder<String> unionOfStringConstBuilder(Class<E> enumClass, E defaultValue) - Type Parameters:
- E- Type of the enum constants that are put in a union.
- Parameters:
- enumClass- Class of the enum constants that are put in a union.
- defaultValue- Default value of the union.
- Returns:
- A descriptor builder for a union value that consists of all enum constants names. Uses the enum constants names as the discriminator.
 
 - 
unionOfStringConstBuilderdefault IUnionValueDescriptorBuilder<String> unionOfStringConstBuilder(String first, String... moreStrings) - Parameters:
- first- First string in the union. This is also the default value.
- moreStrings- More strings in the union.
- Returns:
- A value descriptor builder that represents the algebraic sum type
 "string1" | "string2" | "string3" | ....
 
 - 
unionStringBuilderdefault IUnionValueDescriptorBuilder<String> unionStringBuilder() - Returns:
- A descriptor builder for a union value that uses string constants as discriminators.
 
 - 
voidishIVoidValueDescriptor voidish() - Returns:
- A value descriptor for a void result. This is valid only as a root value for the return value of a method.
 
 
- 
 
-