Checks if object has a property with specified name..

@param obj  an object to introspect.
@param name a name of the property to check.
@return true if the object has the property and false if it doesn't.
431032
public static boolean hasProperty(Object obj, String name) {
		if (obj == null)
			throw new NullPointerException("Object cannot be null");
		if (name == null)
			throw new NullPointerException("Property name cannot be null");

		Class<?> objClass = obj.getClass();

		// Search in fields
		for (Field field : objClass.getFields()) {
			if (matchField(field, name))
				return true;
		}

		// Search in properties
		name = "get" + name;
		for (Method method : objClass.getMethods()) {
			if (matchPropertyGetter(method, name))
				return true;
		}

		return false;
	}
126715
def _has_name(soup_obj):
    """"""
    try:
        name = soup_obj.name
        if name == None:
            return False
        return True
    except AttributeError:
        return False
653816
function (obj) {
        return Boolean(obj) && ((obj instanceof Header) ||
            _.inSuperChain(obj.constructor, '_postman_propertyName', Header._postman_propertyName));
    }
68152
function isPlainObject(obj) {
    return (
        typeof obj === 'object' &&
        obj !== null &&
        obj.constructor === Object &&
        Object.prototype.toString.call(obj) === '[object Object]'
    );
}
979695
function hasNestedProperty(obj, propertyPath, returnVal = false) {
  if (!propertyPath) return false;

  // strip the leading dot
  propertyPath = propertyPath.replace(/^\./, '');
  const properties = propertyPath.split('.');

  for (var i = 0; i < properties.length; i++) {
    var prop = properties[i];

    if (!obj || !obj.hasOwnProperty(prop)) {
      return returnVal ? null : false;
    } else {
      obj = obj[prop];
    }
  }

  return returnVal ? obj : true;
}
837284
def check_obj(keys, name, obj):
    """"""
    msg = validate_obj(keys, obj)

    if msg:
        raise aomi.exceptions.AomiData("object check : %s in %s" % (msg, name))
322153
@Override
    public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "hasObjectWithPrefix (" + namespace + ", " + name + ")");

        if (name == null) {
            throw new InvalidNameException();
        }

        boolean result = false;
        // This helper only provides support for java:comp/env
        if (namespace == JavaColonNamespace.COMP && name.isEmpty()) {
            result = true;
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "hasObjectWithPrefix", result);
        return result;
    }
519741
function hasProperty(node, name) {
  var props
  var value

  if (!node || !name || typeof node !== 'object' || node.type !== 'element') {
    return false
  }

  props = node.properties
  value = props && own.call(props, name) && props[name]

  return value !== null && value !== undefined && value !== false
}
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;

    }
758344
public boolean hasProperty(String name) {
		if (StringUtils.isBlank(name)) {
			return false;
		}
		return getProperties().containsKey(name);
	}
288206
def has(self, name):
        
        for a in self.all_annotations:
            if a.name == name:
                return True
        return False
28978
public function hasProperty($name)
    {
        static $vars = null;
        if (! $vars) {
            $vars = get_object_vars($this);
        }

        return array_key_exists($name, $vars);
    }
1248919
@Override
    public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
        ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        J2EEName j2eeName = cmd.getJ2EEName();

        boolean b;
        try {
            b = (JavaColonNamespace.APP.equals(namespace) || JavaColonNamespace.GLOBAL.equals(namespace)) &&
                clientSupportFactory.getRemoteClientSupport().hasRemoteObjectWithPrefix(j2eeName.getApplication(), j2eeName.getModule(), j2eeName.getComponent(), namespace.toString(), name);
        } catch (RemoteException ex) {
            //ffdc
            b = false;
        }
        return b;
    }
312819
@Override
    public boolean hasRemoteObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
        return hasObjectWithPrefix(namespace, name);
    }
1341068
public static String getStringFor(String name, Object obj)
	{
		if(obj == null)
			throw new NullPointerException("obj is null");
		return getStringFor(name,obj.getClass());
	}
1006865
function(name) {
      var props = this.jCal[PROPERTY_INDEX];
      var len = props.length;

      var i = 0;
      for (; i < len; i++) {
        // 0 is property name
        if (props[i][NAME_INDEX] === name) {
          return true;
        }
      }

      return false;
    }
705159
public static void register( String name,
                                 Object obj ) {
        register(name, obj, null, null, null, null);
    }