/*! Method check if event with such name already exists.
@param name
name of event, case non-sensitive
@return
true if event with such name registered, false otherwise
346264
public function exist($name){
		$name=strtolower($name);
		return (isset($this->events[$name]) && sizeof($this->events[$name]));
	}
1304700
protected boolean isEndTagEvent(XMLEvent event, QName tagName) {
        return event.isEndElement()
                && event.asEndElement().getName().equals(tagName);
    }
389702
@Override
    public final boolean propertyExists(String name) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "propertyExists", name);

        boolean result = false;

        /* Got to check Maelstrom's transportVersion first as performance for it */
        /* is critical. */
        if (name.equals(MfpConstants.PRP_TRANSVER) && isTransportVersionSet()) {
            result = true;
        }

        /* Next try the user property map as the most likely */
        else if ((mayHaveJmsUserProperties()) && (getJmsUserPropertyMap().containsKey(name))) {
            result = true;
        }

        /* If name starts with JMS it may be a smoke-and-mirrors property */
        else if (name.startsWith(JMS_PREFIX)) {

            /* If it is a JMSX property.... */
            if (name.charAt(JMS_LENGTH) == JMSX_EXTRA_PREFIX) {
                int count = name.length() - JMSX_LENGTH;

                if (name.regionMatches(JMSX_LENGTH, SIProperties.JMSXDeliveryCount, JMSX_LENGTH, count)) {
                    if (isSent())
                        result = true;
                }
                else if (name.regionMatches(JMSX_LENGTH, SIProperties.JMSXAppID, JMSX_LENGTH, count)) {
                    if (getHdr2().getChoiceField(JsHdr2Access.XAPPID) != JsHdr2Access.IS_XAPPID_EMPTY)
                        result = true;
                }
                else if (name.regionMatches(JMSX_LENGTH, SIProperties.JMSXUserID, JMSX_LENGTH, count)) {
                    if (getUserid() != null)
                        result = true;
                }
                /* The other supported JMSX properties just live in the system map */
                else if (mayHaveMappedJmsSystemProperties()) {
                    result = getJmsSystemPropertyMap().containsKey(name);
                }

            }
            /* All the remaining header properties start with JMS_IBM_ */
            else if (name.startsWith(JMS_IBM_EXTRA_PREFIX, JMS_LENGTH)) {
                int count;

                /* First check for the Report ones */
                if (name.regionMatches(JMS_IBM_LENGTH, REPORT, 0, REPORT_LENGTH)) {

                    count = name.length() - REPORT_OFFSET;

                    if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Expiration, REPORT_OFFSET, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.REPORTEXPIRY) != JsHdr2Access.IS_REPORTEXPIRY_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_COA, REPORT_OFFSET, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.REPORTCOA) != JsHdr2Access.IS_REPORTCOA_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_COD, REPORT_OFFSET, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.REPORTCOD) != JsHdr2Access.IS_REPORTCOD_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Exception, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTEXCEPTION) != JsApiAccess.IS_REPORTEXCEPTION_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_PAN, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTPAN) != JsApiAccess.IS_REPORTPAN_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_NAN, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTNAN) != JsApiAccess.IS_REPORTNAN_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Pass_Msg_ID, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTPASSMSGID) != JsApiAccess.IS_REPORTPASSMSGID_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Pass_Correl_ID, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTPASSCORRELID) != JsApiAccess.IS_REPORTPASSCORRELID_UNSET)
                            result = true;
                    }
                    else if (name.regionMatches(REPORT_OFFSET, SIProperties.JMS_IBM_Report_Discard_Msg, REPORT_OFFSET, count)) {
                        if (getApi().getChoiceField(JsApiAccess.REPORTDISCARDMSG) != JsApiAccess.IS_REPORTDISCARDMSG_UNSET)
                            result = true;
                    }

                }
                else {
                    /* Then try the other smoke-and-mirrors ones */
                    count = name.length() - JMS_IBM_LENGTH;

                    if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionReason, JMS_IBM_LENGTH, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionTimestamp, JMS_IBM_LENGTH, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionMessage, JMS_IBM_LENGTH, count)) {
                        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionProblemDestination, JMS_IBM_LENGTH, count)) {
                        if (getExceptionProblemDestination() != null)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ExceptionProblemSubscription, JMS_IBM_LENGTH, count)) {
                        if (getExceptionProblemSubscription() != null)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_Feedback, JMS_IBM_LENGTH, count)) {
                        if ((getApi().getChoiceField(JsApiAccess.REPORTFEEDBACK) != JsApiAccess.IS_REPORTFEEDBACK_UNSET) ||
                            (getApi().getChoiceField(JsApiAccess.REPORTFEEDBACKINT) != JsApiAccess.IS_REPORTFEEDBACKINT_UNSET))
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_System_MessageID, JMS_IBM_LENGTH, count)) {
                        if (getSystemMessageId() != null)
                            result = true;
                    }
                    else if (name.regionMatches(JMS_IBM_LENGTH, SIProperties.JMS_IBM_ArmCorrelator, JMS_IBM_LENGTH, count)) {
                        if (getARMCorrelator() != null)
                            result = true;
                    }

                    /* The other supported JMS_IBM_ properties just live in one (or both) of the maps */
                    else {
                        if (mayHaveMappedJmsSystemProperties()) {
                            result = getJmsSystemPropertyMap().containsKey(name);
                        }
                        if (result == false) {
                            result = getMQMDSetPropertiesMap().containsKey(name);
                        }
                    }
                } // end of else of if Report
            } // end of if JMS_IBM_

            // JMS_TOG_ARM_Correlator
            else if (name.equals(SIProperties.JMS_TOG_ARM_Correlator)) {
                if (getARMCorrelator() != null)
                    result = true;
            }

        } // end of if JMS

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "propertyExists", Boolean.valueOf(result));
        return result;

    }
426513
protected boolean isExcluded(String name) {
        ensureNonPatternSetsReady();

        if (isCaseSensitive()
            ? excludeNonPatterns.contains(name)
            : excludeNonPatterns.contains(name.toUpperCase())) {
            return true;
        }
        for (int i = 0; i < excludePatterns.length; i++) {
            if (matchPath(excludePatterns[i], name, isCaseSensitive())) {
                return true;
            }
        }
        return false;
    }
463837
function(name) {
    name = name || '';

    // TODO optimize with RegExp

    var nameChain = name.split('.');
    for(var i=0; i<nameChain.length; i++) {
      if(!nameChain[i].match(/[a-zA-Z0-9_]+/)) {
        return false;
      }
    }

    return true;
  }
1044032
def event(self, name):
        
        events = self.events()
        if name not in events:
            events[name] = Event(name, self, 0)
        return events[name]
657907
static boolean isNameReferenced(Node node, String name, Predicate<Node> traverseChildrenPred) {
    return has(node, new MatchNameNode(name), traverseChildrenPred);
  }
1300285
protected boolean isValidEventNameForScope(String eventName, Element listenerElement) {
    if (eventName != null && eventName.trim().length() > 0) {
      if ("start".equals(eventName) || "end".equals(eventName)) {
        return true;
      } else {
        addError("Attribute 'event' must be one of {start|end}", listenerElement);
      }
    } else {
      addError("Attribute 'event' is mandatory on listener", listenerElement);
    }
    return false;
  }
542385
function ensureEvents(obj, name) {
  obj._events = obj._events || {};
  obj._events[name] = obj._events[name] || [];
}
512572
public boolean isOwner(String name) {
        boolean result = false;
        if (aclList.containsKey(name)) {
            result = aclList.get(name).isOwner();
        }
        return result;
    }
466514
public boolean containsField(String name) {
      if (StringUtils.isNullOrBlank(name)) {
         return false;
      }
      return ClassDescriptorCache.getInstance()
                                 .getClassDescriptor(clazz)
                                 .getFields(accessAll)
                                 .stream()
                                 .anyMatch(f -> f.getName().equals(name));
   }
318404
@VisibleForTesting
	public boolean onlyKeyExists(String name) {
		String[] names = handleDeprecation(deprecationContext.get(), name);
		for(String n : names) {
			if ( getProps().getProperty(n,DEFAULT_STRING_CHECK)
					.equals(DEFAULT_STRING_CHECK) ) {
				return true;
			}
		}
		return false;
	}
1132263
public boolean valueExists(String name) {
        IntByReference pType, lpcbData;
        byte[] lpData = new byte[1];

        pType = new IntByReference();
        lpcbData = new IntByReference();

        OUTER:
        while(true) {
            int r = Advapi32.INSTANCE.RegQueryValueEx(handle, name, null, pType, lpData, lpcbData);
            switch(r) {
            case WINERROR.ERROR_MORE_DATA:
                lpData = new byte[lpcbData.getValue()];
                continue OUTER;
            case WINERROR.ERROR_FILE_NOT_FOUND:
                return false;
            case WINERROR.ERROR_SUCCESS:
                return true;
            default:
                throw new JnaException(r);
            }
        }
    }
888154
public boolean contains(String name) {
        if (name == null) {
            throw new IllegalArgumentException("Other cannot be null");
        }

        if (this.name.equals(name)) {
            return true;
        }

        if (hasReferences()) {
            for (Marker ref : referenceList) {
                if (ref.contains(name)) {
                    return true;
                }
            }
        }
        return false;
    }
393461
function(name) {
                        this._checkObject(name);

                        return (this._hasObject([name]) && this._removeObject([name])) || (this._hasObjectCreator([name]) && this._removeObjectCreator([name]));
                    }
142190
function(event, name) {

            var eventListeners = this.__getEventListeners(event);

            if (!(name in eventListeners)) {
                throw new Error('Event listener for event "' + event + '" with name "' + name + '" does not exist!');
            }

            return eventListeners[event][name];
        }
58859
public boolean containsName(final String name) {
        for (final T i : this) {
            if (i.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }