Package graphql.validation
Class AbstractRule
- java.lang.Object
-
- graphql.validation.AbstractRule
-
- Direct Known Subclasses:
ArgumentsOfCorrectType
,DeferDirectiveLabel
,DeferDirectiveOnRootLevel
,DeferDirectiveOnValidOperation
,ExecutableDefinitions
,FieldsOnCorrectType
,FragmentsOnCompositeType
,KnownArgumentNames
,KnownDirectives
,KnownFragmentNames
,KnownTypeNames
,LoneAnonymousOperation
,NoFragmentCycles
,NoUndefinedVariables
,NoUnusedFragments
,NoUnusedVariables
,OverlappingFieldsCanBeMerged
,PossibleFragmentSpreads
,ProvidedNonNullArguments
,ScalarLeaves
,SubscriptionUniqueRootField
,UniqueArgumentNames
,UniqueDirectiveNamesPerLocation
,UniqueFragmentNames
,UniqueObjectFieldName
,UniqueOperationNames
,UniqueVariableNames
,VariableDefaultValuesOfCorrectType
,VariablesAreInputTypes
,VariableTypesMatch
public class AbstractRule extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AbstractRule(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(ValidationError.Builder validationError)
void
addError(ValidationErrorType validationErrorType, SourceLocation location, java.lang.String description)
void
addError(ValidationErrorType validationErrorType, java.util.Collection<? extends Node<?>> locations, java.lang.String description)
void
checkArgument(Argument argument)
void
checkDirective(Directive directive, java.util.List<Node> ancestors)
void
checkDocument(Document document)
void
checkField(Field field)
void
checkFragmentDefinition(FragmentDefinition fragmentDefinition)
void
checkFragmentSpread(FragmentSpread fragmentSpread)
void
checkInlineFragment(InlineFragment inlineFragment)
void
checkObjectValue(ObjectValue objectValue)
void
checkOperationDefinition(OperationDefinition operationDefinition)
void
checkSelectionSet(SelectionSet selectionSet)
void
checkTypeName(TypeName typeName)
void
checkVariable(VariableReference variableReference)
void
checkVariableDefinition(VariableDefinition variableDefinition)
void
documentFinished(Document document)
java.util.List<ValidationError>
getErrors()
protected java.util.List<java.lang.String>
getQueryPath()
ValidationContext
getValidationContext()
ValidationErrorCollector
getValidationErrorCollector()
ValidationUtil
getValidationUtil()
java.lang.String
i18n(ValidationErrorType validationErrorType, I18nMsg i18nMsg)
Creates an I18n message using theI18nMsg
java.lang.String
i18n(ValidationErrorType validationErrorType, java.lang.String msgKey, java.lang.Object... msgArgs)
Creates an I18N message using the key and argumentsprotected java.lang.Boolean
isExperimentalApiKeyEnabled(java.lang.String key)
Verifies if the experimental API key is enabledboolean
isVisitFragmentSpreads()
void
leaveOperationDefinition(OperationDefinition operationDefinition)
void
leaveSelectionSet(SelectionSet selectionSet)
void
setVisitFragmentSpreads(boolean visitFragmentSpreads)
java.lang.String
toString()
-
-
-
Constructor Detail
-
AbstractRule
public AbstractRule(ValidationContext validationContext, ValidationErrorCollector validationErrorCollector)
-
-
Method Detail
-
isVisitFragmentSpreads
public boolean isVisitFragmentSpreads()
-
setVisitFragmentSpreads
public void setVisitFragmentSpreads(boolean visitFragmentSpreads)
-
getValidationUtil
public ValidationUtil getValidationUtil()
-
addError
public void addError(ValidationErrorType validationErrorType, java.util.Collection<? extends Node<?>> locations, java.lang.String description)
-
addError
public void addError(ValidationErrorType validationErrorType, SourceLocation location, java.lang.String description)
-
addError
public void addError(ValidationError.Builder validationError)
-
getErrors
public java.util.List<ValidationError> getErrors()
-
getValidationContext
public ValidationContext getValidationContext()
-
getValidationErrorCollector
public ValidationErrorCollector getValidationErrorCollector()
-
getQueryPath
protected java.util.List<java.lang.String> getQueryPath()
-
isExperimentalApiKeyEnabled
protected java.lang.Boolean isExperimentalApiKeyEnabled(java.lang.String key)
Verifies if the experimental API key is enabled- Parameters:
key
- to be checked- Returns:
- if the experimental API key is enabled
-
i18n
public java.lang.String i18n(ValidationErrorType validationErrorType, I18nMsg i18nMsg)
Creates an I18n message using theI18nMsg
- Parameters:
validationErrorType
- the type of validation failurei18nMsg
- the i18n message object- Returns:
- the formatted I18n message
-
i18n
public java.lang.String i18n(ValidationErrorType validationErrorType, java.lang.String msgKey, java.lang.Object... msgArgs)
Creates an I18N message using the key and arguments- Parameters:
validationErrorType
- the type of validation failuremsgKey
- the key in the underlying message bundlemsgArgs
- the message arguments- Returns:
- the formatted I18N message
-
checkDocument
public void checkDocument(Document document)
-
checkArgument
public void checkArgument(Argument argument)
-
checkTypeName
public void checkTypeName(TypeName typeName)
-
checkVariableDefinition
public void checkVariableDefinition(VariableDefinition variableDefinition)
-
checkField
public void checkField(Field field)
-
checkInlineFragment
public void checkInlineFragment(InlineFragment inlineFragment)
-
checkFragmentSpread
public void checkFragmentSpread(FragmentSpread fragmentSpread)
-
checkFragmentDefinition
public void checkFragmentDefinition(FragmentDefinition fragmentDefinition)
-
checkOperationDefinition
public void checkOperationDefinition(OperationDefinition operationDefinition)
-
leaveOperationDefinition
public void leaveOperationDefinition(OperationDefinition operationDefinition)
-
checkSelectionSet
public void checkSelectionSet(SelectionSet selectionSet)
-
leaveSelectionSet
public void leaveSelectionSet(SelectionSet selectionSet)
-
checkVariable
public void checkVariable(VariableReference variableReference)
-
documentFinished
public void documentFinished(Document document)
-
checkObjectValue
public void checkObjectValue(ObjectValue objectValue)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-