Class FilterParser
- Namespace
- JsonApiDotNetCore.Queries.Parsing
- Assembly
- JsonApiDotNetCore.dll
Parses the JSON:API 'filter' query string parameter value.
[PublicAPI]
public class FilterParser : QueryExpressionParser, IFilterParser
- Inheritance
-
FilterParser
- Implements
- Inherited Members
Constructors
FilterParser(IResourceFactory)
public FilterParser(IResourceFactory resourceFactory)
Parameters
resourceFactory
IResourceFactory
Properties
ResourceTypeInScope
Gets the resource type currently in scope. Call InScopeOfResourceType(ResourceType) to temporarily change the current resource type.
protected ResourceType ResourceTypeInScope { get; }
Property Value
Methods
GetConstantValueConverterForType(Type)
protected virtual ConstantValueConverter GetConstantValueConverterForType(Type destinationType)
Parameters
destinationType
Type
Returns
InScopeOfResourceType(ResourceType)
Changes the resource type currently in scope and restores the original resource type when the return value is disposed.
protected IDisposable InScopeOfResourceType(ResourceType resourceType)
Parameters
resourceType
ResourceType
Returns
IsFunction(string)
protected virtual bool IsFunction(string name)
Parameters
name
string
Returns
Parse(string, ResourceType)
Parses the specified source into a FilterExpression. Throws a QueryParseException if the input is invalid.
public FilterExpression Parse(string source, ResourceType resourceType)
Parameters
source
stringThe source text to read from.
resourceType
ResourceTypeThe resource type used to lookup JSON:API fields that are referenced in
source
.
Returns
ParseAny()
protected virtual AnyExpression ParseAny()
Returns
ParseComparison(string)
protected virtual ComparisonExpression ParseComparison(string operatorName)
Parameters
operatorName
string
Returns
ParseFilter()
protected virtual FilterExpression ParseFilter()
Returns
ParseFunction()
protected virtual FunctionExpression ParseFunction()
Returns
ParseHas()
protected virtual HasExpression ParseHas()
Returns
ParseIsType()
protected virtual IsTypeExpression ParseIsType()
Returns
ParseLogical(string)
protected virtual LogicalExpression ParseLogical(string operatorName)
Parameters
operatorName
string
Returns
ParseNot()
protected virtual NotExpression ParseNot()
Returns
ParseTextMatch(string)
protected virtual MatchTextExpression ParseTextMatch(string operatorName)
Parameters
operatorName
string
Returns
ValidateField(ResourceFieldAttribute, int)
Enables derived types to throw a QueryParseException when usage of a JSON:API field inside a field chain is not permitted.
protected override void ValidateField(ResourceFieldAttribute field, int position)
Parameters
field
ResourceFieldAttributeposition
int