Default implementation of Message interface. For Native Language Support (NLS), system of software internationalization.
Inheritance: IMessage
Ejemplo n.º 1
0
 public void TestMessageLoading_ja()
 {
     IMessage invalidSyntax = new MessageImpl(
         MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
     assertEquals("構文エラー: XXX", invalidSyntax
         .GetLocalizedMessage(new CultureInfo("ja")));
 }
Ejemplo n.º 2
0
        public void TestMessageLoading_ja()
        {
            IMessage invalidSyntax = new MessageImpl(
                MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");

            assertEquals("構文エラー: XXX", invalidSyntax
                         .GetLocalizedMessage(new CultureInfo("ja")));
        }
Ejemplo n.º 3
0
 public void TestMessageLoading()
 {
     IMessage invalidSyntax = new MessageImpl(
         MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
     /* 
      * if the default locale is ja, you get ja as a fallback:
      * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader)
      */
     if (!CultureInfo.CurrentUICulture.Equals(new CultureInfo("ja")))
         assertEquals("Syntax Error: XXX", invalidSyntax.GetLocalizedMessage(new CultureInfo("en")));
 }
Ejemplo n.º 4
0
        public void TestMessageLoading()
        {
            IMessage invalidSyntax = new MessageImpl(
                MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");

            /*
             * if the default locale is ja, you get ja as a fallback:
             * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader)
             */
            if (!CultureInfo.CurrentUICulture.Equals(new CultureInfo("ja")))
            {
                assertEquals("Syntax Error: XXX", invalidSyntax.GetLocalizedMessage(new CultureInfo("en")));
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Parses a query string, returning a <see cref="IQueryNode"/>.
 /// </summary>
 /// <param name="query">the query string to be parsed.</param>
 /// <param name="field"></param>
 /// <returns></returns>
 /// <exception cref="ParseException">if the parsing fails</exception>
 public IQueryNode Parse(string query, string field)
 {
     ReInit(new FastCharStream(new StringReader(query)));
     try
     {
         // TopLevelQuery is a Query followed by the end-of-input (EOF)
         IQueryNode querynode = TopLevelQuery(field);
         return querynode;
     }
     catch (ParseException tme)
     {
         tme.SetQuery(query);
         throw tme;
     }
     catch (Exception tme)
     {
         IMessage message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, tme.Message);
         QueryNodeParseException e = new QueryNodeParseException(tme);
         e.SetQuery(query);
         e.SetNonLocalizedMessage(message);
         throw e;
     }
 }