Exemplo n.º 1
0
        public RouteResolverTrie(ITrieNodeFactory nodeFactory, IRouteCache cache)
        {
            _nodeFactory = nodeFactory;
            _routeTries  = new Dictionary <string, TrieNode>(StringComparer.OrdinalIgnoreCase);

            BuildTrie(cache);
        }
Exemplo n.º 2
0
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            Parent = parent;
            RouteDefinitionSegment = segment;
            _nodeFactory           = nodeFactory;

            NodeData = new List <NodeData>();
            Children = new Dictionary <string, TrieNode>(StringComparer.OrdinalIgnoreCase);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrieNode"/> class
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="segment">Segment of the route definition</param>
        /// <param name="nodeFactory">Factory for creating new nodes</param>
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            this.nodeFactory            = nodeFactory;
            this.Parent                 = parent;
            this.RouteDefinitionSegment = segment;

            this.Children             = new Dictionary <string, TrieNode>(StringComparer.OrdinalIgnoreCase);
            this.AdditionalParameters = new Dictionary <string, object>();
            this.NodeData             = new List <NodeData>();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrieNode"/> class
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="segment">Segment of the route definition</param>
        /// <param name="nodeFactory">Factory for creating new nodes</param>
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            this.nodeFactory = nodeFactory;
            this.Parent = parent;
            this.RouteDefinitionSegment = segment;

            this.Children = new Dictionary<string, TrieNode>();
            this.AdditionalParameters = new Dictionary<string, object>();
            this.NodeData = new List<NodeData>();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TrieNode"/> class
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="segment">Segment of the route definition</param>
        /// <param name="nodeFactory">Factory for creating new nodes</param>
        protected TrieNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
        {
            this.nodeFactory = nodeFactory;
            this.Parent = parent;
            this.RouteDefinitionSegment = segment;

            this.Children = new Dictionary<string, TrieNode>(StaticConfiguration.CaseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase);
            this.AdditionalParameters = new Dictionary<string, object>();
            this.NodeData = new List<NodeData>();
        }
 public CaptureNodeWithConstraint(TrieNode parent, string segment, ITrieNodeFactory nodeFactory, IEnumerable<IRouteSegmentConstraint> routeSegmentConstraints)
     : base(parent, segment, nodeFactory)
 {
     this.routeSegmentConstraints = routeSegmentConstraints;
     this.ExtractParameterName();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaptureNodeWithConstraint"/> class, with
 /// the provided <paramref name="parent"/>, <paramref name="segment"/> and <paramref name="nodeFactory"/>.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="segment">The segment.</param>
 /// <param name="nodeFactory">The node factory.</param>
 /// <param name="routeSegmentConstraints">The route segment constraints.</param>
 public CaptureNodeWithConstraint(TrieNode parent, string segment, ITrieNodeFactory nodeFactory, IEnumerable <IRouteSegmentConstraint> routeSegmentConstraints)
     : base(parent, segment, nodeFactory)
 {
     this.routeSegmentConstraints = routeSegmentConstraints;
     this.ExtractParameterName();
 }
Exemplo n.º 8
0
 public RootNode(ITrieNodeFactory nodeFactory)
     : base(null, null, nodeFactory)
 {
 }
 public GreedyRegExCaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
Exemplo n.º 10
0
 public RouteResolverTrie(ITrieNodeFactory nodeFactory)
 {
     this.nodeFactory = nodeFactory;
 }
Exemplo n.º 11
0
 public GreedyRegExCaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
 public RegExNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
Exemplo n.º 13
0
 public RootNode(ITrieNodeFactory nodeFactory)
     : base(null, null, nodeFactory)
 {
 }
 /// <summary>
 /// Captures parameters within segments that contain literals.
 ///     i.e:
 ///         /{file}.{name}
 ///         /{file}.html
 ///         /{major}.{minor}.{revision}B{build}
 /// </summary>
 /// <param name="parent">The parent node</param>
 /// <param name="segment">The segment to match upon</param>
 /// <param name="nodeFactory">The factory</param>
 public CaptureNodeWithMultipleParameters(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNames();
 }
 public CaptureNodeWithDefaultValue(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNameAndDefaultValue();
 }
 /// <summary>
 /// Captures parameters within segments that contain literals.
 ///     i.e:
 ///         /{file}.{name}
 ///         /{file}.html
 ///         /{major}.{minor}.{revision}B{build}
 /// </summary>
 /// <param name="parent">The parent node</param>
 /// <param name="segment">The segment to match upon</param>
 /// <param name="nodeFactory">The factory</param>
 public CaptureNodeWithMultipleParameters(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNames();
 }
Exemplo n.º 17
0
 public RouteResolverTrie(ITrieNodeFactory nodeFactory)
 {
     this.nodeFactory = nodeFactory;
 }
 public CaptureNodeWithDefaultValue(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterNameAndDefaultValue();
 }
Exemplo n.º 19
0
 public RegExNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.BuildRegEx();
 }
Exemplo n.º 20
0
 public CaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterName();
 }
 public LiteralNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
 }
Exemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LiteralNode"/> class with
 /// the provided <paramref name="parent"/>, <paramref name="segment"/> and <paramref name="nodeFactory"/>.
 /// </summary>
 /// <param name="parent">Parent node</param>
 /// <param name="segment">Segment of the route definition</param>
 /// <param name="nodeFactory">Factory for creating new nodes</param>
 public LiteralNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
 }
Exemplo n.º 23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaptureNode"/> class, with
 /// the provided <paramref name="parent"/>, <paramref name="segment"/> and <paramref name="nodeFactory"/>.
 /// </summary>
 /// <param name="parent">Parent node</param>
 /// <param name="segment">Segment of the route definition</param>
 /// <param name="nodeFactory">Factory for creating new nodes</param>
 public CaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory)
     : base(parent, segment, nodeFactory)
 {
     this.ExtractParameterName();
 }
Exemplo n.º 24
0
 public CaptureNode(TrieNode parent, string segment, ITrieNodeFactory nodeFactory) : base(parent, segment,
                                                                                          nodeFactory)
 {
     _parameterName = RouteDefinitionSegment.Trim('{', '}');
 }