Package yapion.hierarchy.validators
Class Validator
- java.lang.Object
-
- yapion.hierarchy.validators.Validator
-
public final class Validator extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValidator.ValidationOption
-
Constructor Summary
Constructors Constructor Description Validator()
-
Method Summary
Modifier and Type Method Description Validatoradd(Validator validator)Validatoradd(ValidatorVariable variable)Add a newValidatorVariablewhich will validate a small portion of anyYAPIONObject.ValidatorsetValidationHook(ValidationHook validationHook)JavaDoc found underValidationHookjava.lang.StringtoString()booleanvalidate(YAPIONObject yapionObject)Validate a specifiedYAPIONObjectwith the specifiedValidatorVariable's given by the user.static Validatorvalidator(YAPIONObject yapionObject)static Validatorvalidator(YAPIONObject yapionObject, Validator.ValidationOption... validationOptions)
-
-
-
Method Detail
-
setValidationHook
public Validator setValidationHook(ValidationHook validationHook)
JavaDoc found underValidationHook- Parameters:
validationHook- theValidationHookto use
-
add
public Validator add(ValidatorVariable variable)
Add a newValidatorVariablewhich will validate a small portion of anyYAPIONObject. This method throws anYAPIONExceptionif the path in theValidatorVariableisnullor the type isnull.- Parameters:
variable- theValidatorVariableto add
-
validate
public boolean validate(YAPIONObject yapionObject)
Validate a specifiedYAPIONObjectwith the specifiedValidatorVariable's given by the user.- Parameters:
yapionObject- theYAPIONObjectto validate- Returns:
trueif theYAPIONObjectwas valid,falseotherwise
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
validator
public static Validator validator(YAPIONObject yapionObject)
- Parameters:
yapionObject- the exampleYAPIONObject- Returns:
- the
Validatorfor the givenYAPIONObject
-
validator
public static Validator validator(YAPIONObject yapionObject, Validator.ValidationOption... validationOptions)
- Parameters:
yapionObject- the exampleYAPIONObjectvalidationOptions- what the validator should validate- Returns:
- the
Validatorfor the givenYAPIONObject
-
-