Class Directive
- java.lang.Object
-
- com.graphql_java_generator.client.directive.Directive
-
public class Directive extends java.lang.ObjectThis object can represent both:- A directive definition, as defined in the GraphQL schema, or as a standard GraphQL directive (skip, include, deprecated). In this case the argument's value is null.
- An applied directive within a query/mutation/subscription. In this case, the argument's value is the value read in the query/mutation/subscription. Thus it can be a hard coded value, or a bind parameter)/
- Author:
- etienne-sf
-
-
Constructor Summary
Constructors Constructor Description Directive()Default constructor, used by the generated DirectiveRegistryInitializeDirective(QueryTokenizer qt, java.lang.String schema)Create a Directive from aQueryTokenizer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendToGraphQLRequests(java.lang.StringBuilder sb, java.util.Map<java.lang.String,java.lang.Object> parameters)Appends this current directive into the givenStringBuilder, to build the GraphQL requestjava.util.List<InputParameter>getArguments()DirectivegetDirectiveDefinition()Returns the definition for this GraphQL directivejava.util.List<DirectiveLocation>getDirectiveLocations()java.lang.StringgetName()java.lang.StringgetPackageName()Returns the package name where the code for this directive has been generated.voidsetArguments(java.util.List<InputParameter> arguments)voidsetDirectiveLocations(java.util.List<DirectiveLocation> directiveLocations)voidsetName(java.lang.String name)voidsetPackageName(java.lang.String packageName)
-
-
-
Constructor Detail
-
Directive
public Directive(QueryTokenizer qt, java.lang.String schema) throws GraphQLRequestPreparationException
Create a Directive from aQueryTokenizer. ThisQueryTokenizershould have read the starting @, and the next token should be the directive's name.- Parameters:
qt-schema- value of the springBeanSuffix plugin parameter for the searched schema. When there is only one schema, this plugin parameter is usually not set. In this case, its default value ("") is used.- Throws:
GraphQLRequestPreparationException
-
Directive
public Directive()
Default constructor, used by the generated DirectiveRegistryInitialize- Parameters:
qt-
-
-
Method Detail
-
appendToGraphQLRequests
public void appendToGraphQLRequests(java.lang.StringBuilder sb, java.util.Map<java.lang.String,java.lang.Object> parameters) throws GraphQLRequestExecutionExceptionAppends this current directive into the givenStringBuilder, to build the GraphQL request- Parameters:
sb-parameters- The list of bind values for the possible bind parameters- Throws:
GraphQLRequestExecutionException
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getArguments
public java.util.List<InputParameter> getArguments()
-
setArguments
public void setArguments(java.util.List<InputParameter> arguments)
-
getDirectiveLocations
public java.util.List<DirectiveLocation> getDirectiveLocations()
-
setDirectiveLocations
public void setDirectiveLocations(java.util.List<DirectiveLocation> directiveLocations)
-
getDirectiveDefinition
public Directive getDirectiveDefinition() throws GraphQLRequestPreparationException
Returns the definition for this GraphQL directive- Returns:
- Throws:
GraphQLRequestPreparationException
-
getPackageName
public java.lang.String getPackageName()
Returns the package name where the code for this directive has been generated. It's used to properly parse the directive arguments- Returns:
-
setPackageName
public void setPackageName(java.lang.String packageName)
-
-