lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [09/11] lucenenet git commit: QueryParser.Xml refactor: Member accessibility
Date Wed, 07 Dec 2016 13:48:27 GMT
QueryParser.Xml refactor: Member accessibility


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/6ef84c31
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/6ef84c31
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/6ef84c31

Branch: refs/heads/master
Commit: 6ef84c31551deaa8a15d40b1f251a57cbdb1028d
Parents: 2ae0b1b
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Dec 7 19:46:01 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Dec 7 20:28:53 2016 +0700

----------------------------------------------------------------------
 .../Xml/Builders/CachedFilterBuilder.cs         |  1 -
 .../Xml/Builders/RangeFilterBuilder.cs          |  2 +-
 .../Xml/Builders/SpanQueryBuilderFactory.cs     |  2 +-
 src/Lucene.Net.QueryParser/Xml/CoreParser.cs    | 24 +++++++++++++++++---
 .../Xml/FilterBuilderFactory.cs                 |  4 ++--
 .../Xml/QueryBuilderFactory.cs                  |  4 ++--
 .../Xml/QueryTemplateManager.cs                 | 12 +++++-----
 7 files changed, 33 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/Builders/CachedFilterBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/Builders/CachedFilterBuilder.cs b/src/Lucene.Net.QueryParser/Xml/Builders/CachedFilterBuilder.cs
index 93fff2d..7f573ea 100644
--- a/src/Lucene.Net.QueryParser/Xml/Builders/CachedFilterBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Xml/Builders/CachedFilterBuilder.cs
@@ -54,7 +54,6 @@ namespace Lucene.Net.QueryParsers.Xml.Builders
             this.cacheSize = cacheSize;
         }
 
-
         public virtual Filter GetFilter(XmlElement e)
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/Builders/RangeFilterBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/Builders/RangeFilterBuilder.cs b/src/Lucene.Net.QueryParser/Xml/Builders/RangeFilterBuilder.cs
index e789cff..cb3c087 100644
--- a/src/Lucene.Net.QueryParser/Xml/Builders/RangeFilterBuilder.cs
+++ b/src/Lucene.Net.QueryParser/Xml/Builders/RangeFilterBuilder.cs
@@ -25,7 +25,7 @@ namespace Lucene.Net.QueryParsers.Xml.Builders
     /// </summary>
     public class RangeFilterBuilder : IFilterBuilder
     {
-        public Filter GetFilter(XmlElement e)
+        public virtual Filter GetFilter(XmlElement e)
         {
             string fieldName = DOMUtils.GetAttributeWithInheritance(e, "fieldName");
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/Builders/SpanQueryBuilderFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/Builders/SpanQueryBuilderFactory.cs b/src/Lucene.Net.QueryParser/Xml/Builders/SpanQueryBuilderFactory.cs
index f5de614..b3fd8fd 100644
--- a/src/Lucene.Net.QueryParser/Xml/Builders/SpanQueryBuilderFactory.cs
+++ b/src/Lucene.Net.QueryParser/Xml/Builders/SpanQueryBuilderFactory.cs
@@ -34,7 +34,7 @@ namespace Lucene.Net.QueryParsers.Xml.Builders
             return GetSpanQuery(e);
         }
 
-        public void AddBuilder(string nodeName, ISpanQueryBuilder builder)
+        public virtual void AddBuilder(string nodeName, ISpanQueryBuilder builder)
         {
             builders[nodeName] = builder;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/CoreParser.cs b/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
index 30f0ff8..5430fec 100644
--- a/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
+++ b/src/Lucene.Net.QueryParser/Xml/CoreParser.cs
@@ -118,17 +118,35 @@ namespace Lucene.Net.QueryParsers.Xml
             queryFactory.AddBuilder("SpanNot", snot);
         }
 
-        public Query Parse(Stream xmlStream)
+        public virtual Query Parse(Stream xmlStream)
         {
             return GetQuery(ParseXML(xmlStream).DocumentElement);
         }
 
-        public void AddQueryBuilder(string nodeName, IQueryBuilder builder)
+        // LUCENENET specific overload for TextReader
+        public virtual Query Parse(TextReader xmlTextReader)
+        {
+            return GetQuery(ParseXML(xmlTextReader).DocumentElement);
+        }
+
+        // LUCENENET specific overload for XmlReader
+        public virtual Query Parse(XmlReader xmlReader)
+        {
+            return GetQuery(ParseXML(xmlReader).DocumentElement);
+        }
+
+        // LUCENENET specific overload for XmlDocument
+        public virtual Query Parse(XmlDocument xmlDocument)
+        {
+            return GetQuery(xmlDocument.DocumentElement);
+        }
+
+        public virtual void AddQueryBuilder(string nodeName, IQueryBuilder builder)
         {
             queryFactory.AddBuilder(nodeName, builder);
         }
 
-        public void AddFilterBuilder(string nodeName, IFilterBuilder builder)
+        public virtual void AddFilterBuilder(string nodeName, IFilterBuilder builder)
         {
             filterFactory.AddBuilder(nodeName, builder);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/FilterBuilderFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/FilterBuilderFactory.cs b/src/Lucene.Net.QueryParser/Xml/FilterBuilderFactory.cs
index 701638e..853599c 100644
--- a/src/Lucene.Net.QueryParser/Xml/FilterBuilderFactory.cs
+++ b/src/Lucene.Net.QueryParser/Xml/FilterBuilderFactory.cs
@@ -38,12 +38,12 @@ namespace Lucene.Net.QueryParsers.Xml
             return builder.GetFilter(n);
         }
 
-        public void AddBuilder(string nodeName, IFilterBuilder builder)
+        public virtual void AddBuilder(string nodeName, IFilterBuilder builder)
         {
             builders[nodeName] = builder;
         }
 
-        public IFilterBuilder GetFilterBuilder(string nodeName)
+        public virtual IFilterBuilder GetFilterBuilder(string nodeName)
         {
             IFilterBuilder result;
             builders.TryGetValue(nodeName, out result);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/QueryBuilderFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/QueryBuilderFactory.cs b/src/Lucene.Net.QueryParser/Xml/QueryBuilderFactory.cs
index 3b85766..5972de1 100644
--- a/src/Lucene.Net.QueryParser/Xml/QueryBuilderFactory.cs
+++ b/src/Lucene.Net.QueryParser/Xml/QueryBuilderFactory.cs
@@ -38,12 +38,12 @@ namespace Lucene.Net.QueryParsers.Xml
             return builder.GetQuery(n);
         }
 
-        public void AddBuilder(string nodeName, IQueryBuilder builder)
+        public virtual void AddBuilder(string nodeName, IQueryBuilder builder)
         {
             builders[nodeName] = builder;
         }
 
-        public IQueryBuilder GetQueryBuilder(string nodeName)
+        public virtual IQueryBuilder GetQueryBuilder(string nodeName)
         {
             IQueryBuilder result;
             builders.TryGetValue(nodeName, out result);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6ef84c31/src/Lucene.Net.QueryParser/Xml/QueryTemplateManager.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/QueryTemplateManager.cs b/src/Lucene.Net.QueryParser/Xml/QueryTemplateManager.cs
index ee05624..fdca288 100644
--- a/src/Lucene.Net.QueryParser/Xml/QueryTemplateManager.cs
+++ b/src/Lucene.Net.QueryParser/Xml/QueryTemplateManager.cs
@@ -45,34 +45,34 @@ namespace Lucene.Net.QueryParsers.Xml
             AddDefaultQueryTemplate(xslIs);
         }
 
-        public void AddDefaultQueryTemplate(Stream xslIs)
+        public virtual void AddDefaultQueryTemplate(Stream xslIs)
         {
             defaultCompiledTemplates = GetTemplates(xslIs);
         }
 
-        public void AddQueryTemplate(string name, Stream xslIs)
+        public virtual void AddQueryTemplate(string name, Stream xslIs)
         {
             compiledTemplatesCache[name] = GetTemplates(xslIs);
         }
 
-        public string GetQueryAsXmlString(IDictionary<string, string> formProperties,
string queryTemplateName)
+        public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties,
string queryTemplateName)
         {
             XslCompiledTransform ts = compiledTemplatesCache[queryTemplateName];
             return GetQueryAsXmlString(formProperties, ts);
         }
 
-        public XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties,
string queryTemplateName)
+        public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties,
string queryTemplateName)
         {
             XslCompiledTransform ts = compiledTemplatesCache[queryTemplateName];
             return GetQueryAsDOM(formProperties, ts);
         }
 
-        public string GetQueryAsXmlString(IDictionary<string, string> formProperties)
+        public virtual string GetQueryAsXmlString(IDictionary<string, string> formProperties)
         {
             return GetQueryAsXmlString(formProperties, defaultCompiledTemplates);
         }
 
-        public XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties)
+        public virtual XmlDocument GetQueryAsDOM(IDictionary<string, string> formProperties)
         {
             return GetQueryAsDOM(formProperties, defaultCompiledTemplates);
         }


Mime
View raw message