/// <summary> /// Constructor for binderbase. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> /// <param name="state">State of the metadata binding.</param> protected BinderBase(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { ExceptionUtils.CheckArgumentNotNull(bindMethod, "bindMethod"); ExceptionUtils.CheckArgumentNotNull(state, "state"); this.bindMethod = bindMethod; this.state = state; }
/// <summary> /// Constructor for binderbase. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> /// <param name="state">State of the metadata binding.</param> protected BinderBase(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { ExceptionUtils.CheckArgumentNotNull(bindMethod, "bindMethod"); ExceptionUtils.CheckArgumentNotNull(state, "state"); this.bindMethod = bindMethod; this.state = state; }
public ApplyBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { this.bindMethod = bindMethod; this.state = state; this.filterBinder = new FilterBinder(bindMethod, state); this.computeBinder = new ComputeBinder(bindMethod); }
/// <summary> /// Constructs a BindInfo with the given <paramref name="bindMethod"/>. /// </summary> /// <param name="bindingStateQueryOptions">The query options to be passed for the binding state. Null by default.</param> /// <param name="bindMethodDelegate">The bind method algorithm. By default, uses MetadataBinder method /// if this parameter isn't populated.</param> public BindInfo(List <CustomQueryOptionToken> bindingStateQueryOptions = null, MetadataBinder.QueryTokenVisitor bindMethod = null) { ResourceRangeVariable implicitRangeVariable = new ResourceRangeVariable( ExpressionConstants.It, HardCodedTestModel.GetPersonTypeReference(), HardCodedTestModel.GetPeopleSet()); this.bindingState = new BindingState(configuration) { ImplicitRangeVariable = implicitRangeVariable }; this.bindingState.RangeVariables.Push( new BindingState(configuration) { ImplicitRangeVariable = implicitRangeVariable }.ImplicitRangeVariable); if (bindingStateQueryOptions != null) { this.bindingState.QueryOptions = bindingStateQueryOptions; } this.binder = new MetadataBinder(bindingState); this.bindMethod = bindMethod ?? binder.Bind; }
/// <summary> /// Create a new ODataUriSemanticBinder to bind an entire uri to Metadata. /// </summary> /// <param name="bindingState">the current state of the binding algorithm</param> /// <param name="bindMethod">pointer to the metadata bind method.</param> public ODataUriSemanticBinder(BindingState bindingState, MetadataBinder.QueryTokenVisitor bindMethod) { ExceptionUtils.CheckArgumentNotNull(bindingState, "bindingState"); ExceptionUtils.CheckArgumentNotNull(bindMethod, "bindMethod"); this.bindingState = bindingState; this.bindMethod = bindMethod; }
public ApplyBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo) { this.bindMethod = bindMethod; this.state = state; this.filterBinder = new FilterBinder(bindMethod, state); this.configuration = configuration; this.odataPathInfo = odataPathInfo; }
/// <summary> /// Constructs a LambdaBinder. /// </summary> /// <param name="bindMethod">Method used to bind a parent token.</param> internal LambdaBinder(MetadataBinder.QueryTokenVisitor bindMethod) { ExceptionUtils.CheckArgumentNotNull(bindMethod, "bindMethod"); this.bindMethod = bindMethod; }
/// <summary> /// Process the remaining query options (represent the set of custom query options after /// service operation parameters and system query options have been removed). /// </summary> /// <param name="bindingState">the current state of the binding algorithm.</param> /// <param name="bindMethod">pointer to a binder method.</param> /// <returns>The list of <see cref="QueryNode"/> instances after binding.</returns> /// <exception cref="ODataException">Throws if bindingState is null.</exception> /// <exception cref="ODataException">Throws if bindMethod is null.</exception> public static List <QueryNode> ProcessQueryOptions(BindingState bindingState, MetadataBinder.QueryTokenVisitor bindMethod) { if (bindingState == null || bindingState.QueryOptions == null) { throw new ODataException(ODataErrorStrings.MetadataBinder_QueryOptionsBindStateCannotBeNull); } if (bindMethod == null) { throw new ODataException(ODataErrorStrings.MetadataBinder_QueryOptionsBindMethodCannotBeNull); } List <QueryNode> customQueryOptionNodes = new List <QueryNode>(); foreach (CustomQueryOptionToken queryToken in bindingState.QueryOptions) { QueryNode customQueryOptionNode = bindMethod(queryToken); if (customQueryOptionNode != null) { customQueryOptionNodes.Add(customQueryOptionNode); } } bindingState.QueryOptions = null; return(customQueryOptionNodes); }
/// <summary> /// Constructs a DottedIdentifierBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> internal DottedIdentifierBinder(MetadataBinder.QueryTokenVisitor bindMethod) { DebugUtils.CheckNoExternalCallers(); ExceptionUtils.CheckArgumentNotNull(bindMethod, "bindMethod"); this.bindMethod = bindMethod; }
/// <summary> /// Constructs a CountSegmentBinder object. /// </summary> /// <param name="bindMethod">Method to use to visit the token tree and bind the tokens recursively.</param> /// <param name="state">State of the metadata binding.</param> internal CountSegmentBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { this.bindMethod = bindMethod; this.state = state; }
/// <summary> /// Constructs a FunctionCallBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> internal FunctionCallBinder(MetadataBinder.QueryTokenVisitor bindMethod) { this.bindMethod = bindMethod; }
/// <summary> /// Creates an OrderByBinder /// </summary> /// <param name="bindMethod">Method to use to visit the token tree and bind the tokens recursively.</param> internal ParameterAliasBinder(MetadataBinder.QueryTokenVisitor bindMethod) { ExceptionUtils.CheckArgumentNotNull(bindMethod, "bindMethod"); this.bindMethod = bindMethod; }
/// <summary> /// Constructs a EndPathBinder object using the given function to bind parent token. /// </summary> /// <param name="bindMethod">Method to bind the EndPathToken's parent, if there is one.</param> /// <param name="state">State of the metadata binding.</param>am> /// <remarks> /// Make bindMethod of return type SingleValueQueryNode. /// </remarks> internal EndPathBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) : base(bindMethod, state) { this.functionCallBinder = new FunctionCallBinder(bindMethod, state); }
/// <summary> /// Constructs a EndPathBinder object using the given function to bind parent token. /// </summary> /// <param name="bindMethod">Method to bind the EndPathToken's parent, if there is one.</param> internal EndPathBinder(MetadataBinder.QueryTokenVisitor bindMethod) { this.bind = bindMethod; this.functionCallBinder = new FunctionCallBinder(bindMethod); }
/// <summary> /// Creates a FilterBinder. /// </summary> /// <param name="bindMethod">Method to use to visit the token tree and bind the tokens recursively.</param> /// <param name="state">State to use for binding.</param> internal FilterBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { this.bindMethod = bindMethod; this.state = state; }
/// <summary> /// Constructs a KeyBinder object using the given function to bind key values. /// </summary> /// <param name="keyValueBindMethod">Method to call to bind a value in a key.</param> internal KeyBinder(MetadataBinder.QueryTokenVisitor keyValueBindMethod) { this.keyValueBindMethod = keyValueBindMethod; }
/// <summary> /// Constructs a KeyBinder object using the given function to bind key values. /// </summary> /// <param name="keyValueBindMethod">Method to call to bind a value in a key.</param> internal KeyBinder(MetadataBinder.QueryTokenVisitor keyValueBindMethod) { this.keyValueBindMethod = keyValueBindMethod; }
public ComputeBinder(MetadataBinder.QueryTokenVisitor bindMethod) { this.bindMethod = bindMethod; }
/// <summary> /// Constructs a KeyBinder object using the given function to bind key values. /// </summary> /// <param name="keyValueBindMethod">Method to call to bind a value in a key.</param> internal KeyBinder(MetadataBinder.QueryTokenVisitor keyValueBindMethod) { DebugUtils.CheckNoExternalCallers(); this.keyValueBindMethod = keyValueBindMethod; }
/// <summary> /// Constructs a InnerPathTokenBinder. /// </summary> /// <param name="bindMethod">Bind method to use for binding a parent node, if needed.</param> internal InnerPathTokenBinder(MetadataBinder.QueryTokenVisitor bindMethod) { DebugUtils.CheckNoExternalCallers(); this.bindMethod = bindMethod; }
/// <summary> /// Process the remaining query options (represent the set of custom query options after /// service operation parameters and system query options have been removed). /// </summary> /// <param name="bindingState">the current state of the binding algorithm.</param> /// <param name="bindMethod">pointer to a binder method.</param> /// <returns>The list of <see cref="QueryNode"/> instances after binding.</returns> public static List <QueryNode> ProcessQueryOptions(BindingState bindingState, MetadataBinder.QueryTokenVisitor bindMethod) { List <QueryNode> customQueryOptionNodes = new List <QueryNode>(); foreach (CustomQueryOptionToken queryToken in bindingState.QueryOptions) { QueryNode customQueryOptionNode = bindMethod(queryToken); if (customQueryOptionNode != null) { customQueryOptionNodes.Add(customQueryOptionNode); } } bindingState.QueryOptions = null; return(customQueryOptionNodes); }
/// <summary> /// Creates a FilterBinder. /// </summary> /// <param name="bindMethod">Method to use to visit the token tree and bind the tokens recursively.</param> /// <param name="state">State to use for binding.</param> internal FilterBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { this.bindMethod = bindMethod; this.state = state; }
/// <summary> /// Constructs a EndPathBinder object using the given function to bind parent token. /// </summary> /// <param name="bindMethod">Method to bind the EndPathToken's parent, if there is one.</param> internal EndPathBinder(MetadataBinder.QueryTokenVisitor bindMethod) { DebugUtils.CheckNoExternalCallers(); this.bind = bindMethod; this.functionCallBinder = new FunctionCallBinder(bindMethod); }
/// <summary> /// Constructs a InnerPathTokenBinder. /// </summary> /// <param name="bindMethod">Bind method to use for binding a parent node, if needed.</param> /// <param name="state">State of the metadata binding.</param> internal InnerPathTokenBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) : base(bindMethod, state) { }
/// <summary> /// Constructs a FunctionCallBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> internal FunctionCallBinder(MetadataBinder.QueryTokenVisitor bindMethod) { DebugUtils.CheckNoExternalCallers(); this.bindMethod = bindMethod; }
/// <summary> /// Constructs a EnumBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> internal EnumBinder(MetadataBinder.QueryTokenVisitor bindMethod) { this.bindMethod = bindMethod; }
/// <summary> /// Constructs a EnumBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> internal EnumBinder(MetadataBinder.QueryTokenVisitor bindMethod) { this.bindMethod = bindMethod; }
public ApplyBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) : this(bindMethod, state, null, null) { }
/// <summary> /// Constructs a InnerPathTokenBinder. /// </summary> /// <param name="bindMethod">Bind method to use for binding a parent node, if needed.</param> internal InnerPathTokenBinder(MetadataBinder.QueryTokenVisitor bindMethod) { this.bindMethod = bindMethod; }
/// <summary> /// Constructs a DottedIdentifierBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> /// <param name="state">State of the metadata binding.</param> internal DottedIdentifierBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) : base(bindMethod, state) { }
public ApplyBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { this.bindMethod = bindMethod; this.state = state; this.filterBinder = new FilterBinder(bindMethod, state); }
/// <summary> /// Constructs a FunctionCallBinder with the given method to be used binding the parent token if needed. /// </summary> /// <param name="bindMethod">Method to use for binding the parent token, if needed.</param> /// <param name="state">State of the metadata binding.</param> internal FunctionCallBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) : base(bindMethod, state) { }
/// <summary> /// Creates a FilterBinder. /// </summary> /// <param name="bindMethod">Method to use to visit the token tree and bind the tokens recursively.</param> /// <param name="state">State to use for binding.</param> internal FilterBinder(MetadataBinder.QueryTokenVisitor bindMethod, BindingState state) { DebugUtils.CheckNoExternalCallers(); this.bindMethod = bindMethod; this.state = state; }