Package io.cui.tools.formatting.template
Class Validator<F extends FormatterSupport>
- java.lang.Object
-
- io.cui.tools.formatting.template.Validator<F>
-
- Type Parameters:
F- at leastFormatterSupport
- All Implemented Interfaces:
Serializable
public class Validator<F extends FormatterSupport> extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValidator.ValidatorBuilder<E extends FormatterSupport>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E extends FormatterSupport>
Validator.ValidatorBuilder<E>builder()voidvalidate(String template)static <E extends FormatterSupport>
voidvalidateTemplate(String template, E source)This method provide only validation of simple expression language with squared brackets.static <E extends FormatterSupport>
voidvalidateTemplate(String template, Lexer<E> lexer)This method provide validation for template of specific expression language.static <E extends FormatterSupport>
voidvalidateTemplate(String template, Class<E> source)This method provide only validation of simple expression language with squared brackets.
-
-
-
Method Detail
-
validate
public void validate(String template)
- Parameters:
template- must not be null if template doesn't fit to el-expression or use tokens which are not supported.
-
builder
public static <E extends FormatterSupport> Validator.ValidatorBuilder<E> builder()
- Returns:
- an
Validator.ValidatorBuilder
-
validateTemplate
public static <E extends FormatterSupport> void validateTemplate(String template, E source)
This method provide only validation of simple expression language with squared brackets. If some other expression language is used on the template validation will fail. If there is a need for usage of other expression language usevalidateTemplate(String, Lexer)- Parameters:
template- input which should be validatedsource- source must not be null
-
validateTemplate
public static <E extends FormatterSupport> void validateTemplate(String template, Class<E> source)
This method provide only validation of simple expression language with squared brackets. If some other expression language is used on the template validation will fail. If there is a need for usage of other expression language usevalidateTemplate(String, Lexer)- Parameters:
template- input which should be validatedsource- target type must not be null
-
validateTemplate
public static <E extends FormatterSupport> void validateTemplate(String template, Lexer<E> lexer)
This method provide validation for template of specific expression language. Therefore, you need to provide a fitting Lexer.- Parameters:
template- input which should be validatedlexer-Lexerfor usage of specific expression language on template
-
-