Returns whether the given property can possibly be set on the given type.
558691
public PropDefinitionKind canPropertyBeDefined(JSType type, String propertyName) {
    if (type.isStruct()) {
      // We are stricter about "struct" types and only allow access to
      // properties that to the best of our knowledge are available at creation
      // time and specifically not properties only defined on subtypes.

      switch (type.getPropertyKind(propertyName)) {
        case KNOWN_PRESENT:
          return PropDefinitionKind.KNOWN;
        case MAYBE_PRESENT:
          // TODO(johnlenz): return LOOSE_UNION here.
          return PropDefinitionKind.KNOWN;
        case ABSENT:
          return PropDefinitionKind.UNKNOWN;
      }
    } else {
      if (!type.isEmptyType() && !type.isUnknownType()) {
        switch (type.getPropertyKind(propertyName)) {
          case KNOWN_PRESENT:
            return PropDefinitionKind.KNOWN;
          case MAYBE_PRESENT:
            // TODO(johnlenz): return LOOSE_UNION here.
            return PropDefinitionKind.KNOWN;
          case ABSENT:
            // check for loose properties below.
            break;
        }
      }

      if (typesIndexedByProperty.containsKey(propertyName)) {
        for (JSType alternative : typesIndexedByProperty.get(propertyName)) {
          JSType greatestSubtype = alternative.getGreatestSubtype(type);
          if (!greatestSubtype.isEmptyType()) {
            // We've found a type with this property. Now we just have to make
            // sure it's not a type used for internal bookkeeping.
            RecordType maybeRecordType = greatestSubtype.toMaybeRecordType();
            if (maybeRecordType != null && maybeRecordType.isSynthetic()) {
              continue;
            }

            return PropDefinitionKind.LOOSE;
          }
        }
      }

      if (type.toMaybeRecordType() != null) {
        RecordType rec = type.toMaybeRecordType();
        boolean mayBeInUnion = false;
        for (String pname : rec.getPropertyMap().getOwnPropertyNames()) {
          if (this.propertiesOfSupertypesInUnions.contains(pname)) {
            mayBeInUnion = true;
            break;
          }
        }

        if (mayBeInUnion && this.droppedPropertiesOfUnions.contains(propertyName)) {
          return PropDefinitionKind.LOOSE;
        }
      }
    }
    return PropDefinitionKind.UNKNOWN;
  }
244460
protected function _propertyTypeAllowed($property, $type)
    {
        $definedType = $this->_getPropertyType($property);
        if (!$definedType) {
            return true;
        }
        if (is_object($type) && class_exists($definedType, false)) {
            return ($type instanceof $definedType);
        }
        return gettype($type) == $definedType;
    }
928243
public boolean isWritable(Class<?> type) {
        return Finder.class.isAssignableFrom(type)
                || Query.class.isAssignableFrom(type)
                || ExpressionList.class.isAssignableFrom(type)
                || FutureList.class.isAssignableFrom(type);
    }
978276
public boolean isThrowable() {
        if (isEnum() || isInterface() || isAnnotationType()) {
            return false;
        }
        for (Type t = type; t.hasTag(CLASS); t = env.types.supertype(t)) {
            if (t.tsym == env.syms.throwableType.tsym) {
                return true;
            }
        }
        return false;
    }
110170
public static boolean isSingle(Class<?> type) {
        for (Class<?> reactiveType : SINGLE_TYPES) {
            if (reactiveType.isAssignableFrom(type)) {
                return true;
            }
        }
        return false;
    }
263266
private boolean isSerializableType(Class<?> type) {
    Boolean serializable = cache.get(type);
    if (serializable != null) {
      return serializable;
    }

    if (type == Object.class) {
      return true;
    }

    if (primitiveTypes.contains(type)) {
      cache.put(type, true);
      return true;
    }

    if (JsonSerializable.class.isAssignableFrom(type)) {
      cache.put(type, true);
      return true;
    }

    for (Class<?> clazz : serializableTypes) {
      if (clazz.isAssignableFrom(type)) {
        cache.put(type, true);
        return true;
      }
    }
    cache.put(type, false);
    return false;
  }
43988
static boolean isSafeReturnType(Class<?> type) { 
        return !ConnectionPoolDataSource.class.isAssignableFrom(type)
               && !CommonDataSource.class.isAssignableFrom(type) 
               && !XADataSource.class.isAssignableFrom(type)
               && !DataSource.class.isAssignableFrom(type)
               && !PooledConnection.class.isAssignableFrom(type) // implies XAConnection
               && !Connection.class.isAssignableFrom(type)
               && !DatabaseMetaData.class.isAssignableFrom(type)
               && !Statement.class.isAssignableFrom(type) // implies prepared & callable
               && !ResultSet.class.isAssignableFrom(type)
               && !XAResource.class.isAssignableFrom(type);
    }
14064
public boolean isListableType() {
        return (type == ItemType.ARRAY || type == ItemType.LIST || type == ItemType.SET);
    }
235414
public function isAssignableFrom(Type $type)
    {
        if ($type->getName() === $this->getName())
            return true;

        if (!($type instanceof ClassType))
            return false;

        return $type->isSubtypeOf($this);
    }
1223457
public static boolean canAccept(String headerValue, boolean strict, String type) {
    if(headerValue != null && type != null)  {
      String availableTypes[] = headerValue.split(",");
      for(String availableType : availableTypes) {
        String typeParams[] = availableType.split(";");
        double qValue = 1.0d;
        if(typeParams.length > 0) {
          for(int i=1; i<typeParams.length; i++) {
            if(typeParams[i].trim().startsWith("q=")) {
              String qString = typeParams[i].substring(2).trim();
              if(qString.matches("\\A\\d+(\\.\\d*){0,1}\\Z")){
                qValue = Double.parseDouble(qString);
                break;
              } 
            }
          }
        }
        boolean matches = false;
        if(typeParams[0].equals("*") || typeParams[0].equals("*/*")) {
          matches = true;
        } else {
          matches = hasMatch(typeParams, type);
        }
        if(qValue == 0 && matches) {
          return false;
        } else if(matches){
          return true;
        }
      }
    }
    return !strict;
  }
1141532
public <A> SetPath<A, PathBuilder<A>> getSet(String property, Class<A> type) {
        return this.<A, PathBuilder<A>>getSet(property, type, PathBuilder.class);
    }
727659
public static <T,V extends Object> void type(V value, Class<T> type) {
		if(!validation) return;
		notNull(value);
		notNull(type);
		if(!type.isAssignableFrom(value.getClass())){
			throw new TypeException(type.getCanonicalName());
		}
	}
723183
public static boolean
supportedType(int type) {
	Type.check(type);
	return (type == Type.PTR || type == Type.CNAME || type == Type.DNAME ||
		type == Type.A || type == Type.AAAA || type == Type.NS);
}
599871
private static boolean isAccessible(final Class<?> type) {
        Class<?> cls = type;
        while (cls != null) {
            if (!Modifier.isPublic(cls.getModifiers())) {
                return false;
            }
            cls = cls.getEnclosingClass();
        }
        return true;
    }
73274
public static boolean isParameterizedType(final Type type) {
        return type != null && type instanceof ParameterizedType && ((ParameterizedType) type).getActualTypeArguments().length > 0;
    }
31993
private boolean isPropertyDeclaredConstant(
      ObjectType objectType, String prop) {
    if (enforceCodingConventions
        && compiler.getCodingConvention().isConstant(prop)) {
      return true;
    }
    for (; objectType != null; objectType = objectType.getImplicitPrototype()) {
      JSDocInfo docInfo = objectType.getOwnPropertyJSDocInfo(prop);
      if (docInfo != null && docInfo.isConstant()) {
        return true;
      }
    }
    return false;
  }
1120930
public void setCalculationType(CalculationType type) {
        cType = type;

        // ensure civil property is up-to-date
        if(cType == CalculationType.ISLAMIC_CIVIL)
            civil = true;
        else
            civil = false;
    }