Пример #1
0
 public virtual bool ContainsKey(string key)
 {
     foreach (IResolver scriptResolver in scriptResolvers)
     {
         if (scriptResolver.ContainsKey(key))
         {
             return(true);
         }
     }
     return(wrappedBindings.ContainsKey(key));
 }
Пример #2
0
        /// <summary>
        /// Retrieves the value of the attribute with the given name in
        /// the scope occurring earliest in the search order.  The order
        /// is determined by the numeric value of the scope parameter (lowest
        /// scope values first.)
        /// </summary>
        /// <param name="name"> The name of the the attribute to retrieve. </param>
        /// <returns> The value of the attribute in the lowest scope for
        /// which an attribute with the given name is defined.  Returns
        /// null if no attribute with the name exists in any scope. </returns>
        /// <exception cref="NullPointerException"> if the name is null. </exception>
        /// <exception cref="IllegalArgumentException"> if the name is empty. </exception>
        public virtual object GetAttribute(string name)
        {
            if (engineScope.ContainsKey(name))
            {
                return(GetAttribute(name, ScriptContext_Fields.ENGINE_SCOPE));
            }
            else if (globalScope != null && globalScope.ContainsKey(name))
            {
                return(GetAttribute(name, ScriptContext_Fields.GLOBAL_SCOPE));
            }

            return(null);
        }
Пример #3
0
 /// <summary>
 /// Dedicated implementation which does not fall back on the <seealso cref="#calculateBindingMap()"/> for performance reasons
 /// </summary>
 public virtual bool ContainsKey(string key)
 {
     if (wrappedBindings.ContainsKey(key))
     {
         return(true);
     }
     if (key is string)
     {
         return(variableContext.ContainsVariable((string)key));
     }
     else
     {
         return(false);
     }
 }