protected DirectiveDefinition createDirectiveDefinition(GraphqlParser.DirectiveDefinitionContext ctx) { DirectiveDefinition.Builder def = DirectiveDefinition.newDirectiveDefinition(); def.name(ctx.name().getText()); addCommonData(def, ctx); def.description(newDescription(ctx.description())); GraphqlParser.DirectiveLocationsContext directiveLocationsContext = ctx.directiveLocations(); List<DirectiveLocation> directiveLocations = new ArrayList<>(); while (directiveLocationsContext != null) { directiveLocations.add(0, createDirectiveLocation(directiveLocationsContext.directiveLocation())); directiveLocationsContext = directiveLocationsContext.directiveLocations(); } def.directiveLocations(directiveLocations); if (ctx.argumentsDefinition() != null) { def.inputValueDefinitions(createInputValueDefinitions(ctx.argumentsDefinition().inputValueDefinition())); } return def.build(); }
protected DirectiveDefinition createDirectiveDefinition(GraphqlParser.DirectiveDefinitionContext ctx) { DirectiveDefinition.Builder def = DirectiveDefinition.newDirectiveDefinition(); def.name(ctx.name().getText()); addCommonData(def, ctx); def.description(newDescription(ctx.description())); GraphqlParser.DirectiveLocationsContext directiveLocationsContext = ctx.directiveLocations(); List<DirectiveLocation> directiveLocations = new ArrayList<>(); while (directiveLocationsContext != null) { directiveLocations.add(0, createDirectiveLocation(directiveLocationsContext.directiveLocation())); directiveLocationsContext = directiveLocationsContext.directiveLocations(); } def.directiveLocations(directiveLocations); if (ctx.argumentsDefinition() != null) { def.inputValueDefinitions(createInputValueDefinitions(ctx.argumentsDefinition().inputValueDefinition())); } return def.build(); }