Class ExpressionConstraint
- java.lang.Object
-
- graphql.validation.constraints.AbstractDirectiveConstraint
-
- graphql.validation.constraints.standard.ExpressionConstraint
-
- All Implemented Interfaces:
DirectiveConstraint,ValidationRule
public class ExpressionConstraint extends AbstractDirectiveConstraint
-
-
Constructor Summary
Constructors Constructor Description ExpressionConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappliesTo(graphql.schema.GraphQLFieldDefinition fieldDefinition, graphql.schema.GraphQLFieldsContainer fieldsContainer)This is called to work out if this rule applies to a specified fieldprotected booleanappliesToListElements()booleanappliesToType(graphql.schema.GraphQLInputType inputType)A derived class will be called to indicate whether this input type applies to the constraintDocumentationgetDocumentation()protected java.util.List<graphql.GraphQLError>runConstraint(ValidationEnvironment validationEnvironment)This is called to perform the constraint validation-
Methods inherited from class graphql.validation.constraints.AbstractDirectiveConstraint
appliesTo, asBigDecimal, asBoolean, asMap, getBoolArg, getIntArg, getMessageTemplate, getMessageTemplate, getName, getStrArg, getStringOrIDOrObjectOrMapLength, isMap, isOneOfTheseTypes, isOneOfTheseTypes, isStringOrID, isStringOrIDOrList, isStringOrIDOrListOrMap, mkError, mkError, mkMessageParams, runValidation, toString
-
-
-
-
Method Detail
-
getDocumentation
public Documentation getDocumentation()
- Returns:
- documentation meta data about this constraint
-
appliesToType
public boolean appliesToType(graphql.schema.GraphQLInputType inputType)
Description copied from class:AbstractDirectiveConstraintA derived class will be called to indicate whether this input type applies to the constraint- Specified by:
appliesToTypein classAbstractDirectiveConstraint- Parameters:
inputType- the input type- Returns:
- true if the constraint can handle that type
-
appliesTo
public boolean appliesTo(graphql.schema.GraphQLFieldDefinition fieldDefinition, graphql.schema.GraphQLFieldsContainer fieldsContainer)Description copied from interface:ValidationRuleThis is called to work out if this rule applies to a specified field- Specified by:
appliesToin interfaceValidationRule- Overrides:
appliesToin classAbstractDirectiveConstraint- Parameters:
fieldDefinition- the field to checkfieldsContainer- the field container- Returns:
- true if this rule applies to the field
-
runConstraint
protected java.util.List<graphql.GraphQLError> runConstraint(ValidationEnvironment validationEnvironment)
Description copied from class:AbstractDirectiveConstraintThis is called to perform the constraint validation- Specified by:
runConstraintin classAbstractDirectiveConstraint- Parameters:
validationEnvironment- the validation environment- Returns:
- a list of errors or an empty one if there are no errors
-
appliesToListElements
protected boolean appliesToListElements()
- Specified by:
appliesToListElementsin classAbstractDirectiveConstraint
-
-