Matches a constructor declaration in a specific enclosing class.

@param className The fully-qualified name of the enclosing class, e.g.
"com.google.common.base.Preconditions"
976701
public static Matcher<MethodTree> constructorOfClass(final String className) {
    return new Matcher<MethodTree>() {
      @Override
      public boolean matches(MethodTree methodTree, VisitorState state) {
        Symbol symbol = ASTHelpers.getSymbol(methodTree);
        return symbol.getEnclosingElement().getQualifiedName().contentEquals(className)
            && symbol.isConstructor();
      }
    };
  }
1189182
public static Matcher constructor(final String name) {
    return new Matcher() {
      @Override public boolean matches(Node node, NodeMetadata metadata) {
        JSDocInfo info = node.getJSDocInfo();
        if (info != null && info.isConstructor()) {
          Node firstChild = node.getFirstChild();
          // TODO(mknichel): Make sure this works with the following cases:
          // ns = {
          //   /** @constructor */
          //   name: function() {}
          // }
          if (name == null) {
            return true;
          }
          if ((firstChild.isGetProp() || firstChild.isName())
              && firstChild.matchesQualifiedName(name)) {
            return true;
          }
        }
        return false;
      }
    };
  }
915274
public void addMatch(String name, PseudoClassType pseudoClass)
    {
        if (names == null)
            names = new HashMap<String, Set<PseudoClassType>>();
        
        Set<PseudoClassType> classes = names.get(name);
        if (classes == null)
        {
            classes = new HashSet<PseudoClassType>(2);
            names.put(name, classes);
        }
        classes.add(pseudoClass);
    }
1262477
static ReferenceTypeSignature parseClassBound(final Parser parser, final String definingClassName)
            throws ParseException {
        parser.expect(':');
        // May return null if there is no signature after ':' (class bound signature may be empty)
        return parseReferenceTypeSignature(parser, definingClassName);
    }
417060
protected boolean isDecomposableBuilder(ClassName t) {
    return t.equals(ClassName.get(DecomposableMatchBuilder0.class))
        || t.equals(ClassName.get(DecomposableMatchBuilder1.class))
        || t.equals(ClassName.get(DecomposableMatchBuilder2.class))
        || t.equals(ClassName.get(DecomposableMatchBuilder3.class));
  }
643970
public boolean hasClass(String className) {
        for (Element element : this) {
            if (element.hasClass(className))
                return true;
        }
        return false;
    }
583031
@Override
    public String fromClassNameToShortComponentName(final String className) {
        if (LdiStringUtil.isEmpty(className)) {
            throw new EmptyRuntimeException("className");
        }
        String s = LdiStringUtil.decapitalize(LdiClassUtil.getShortClassName(className));
        if (s.endsWith(implementationSuffix)) {
            return s.substring(0, s.length() - implementationSuffix.length());
        }
        return s;
    }
582923
private boolean matches(String classname, AccessFlags flags) {
        if (options.apiOnly && !flags.is(AccessFlags.ACC_PUBLIC)) {
            return false;
        } else if (options.includePattern != null) {
            return options.includePattern.matcher(classname.replace('/', '.')).matches();
        } else {
            return true;
        }
    }
290424
public static ConstructorNode findConstructor(ClassNode classNode,Parameter[] constructorParams) {
        List<ConstructorNode> declaredConstructors = classNode.getDeclaredConstructors();
        for (ConstructorNode declaredConstructor : declaredConstructors) {
            if (parametersEqual(constructorParams, declaredConstructor.getParameters())) {
                return declaredConstructor;
            }
        }
        return null;
    }
1117088
function(element, className) {
        var re = new RegExp('(\\s|^)'+className+'(\\s|$)');
        if (re.test(element.className)) return;
        element.className += ' ' + className;
      }
386836
private boolean isExcluded(String className) {
    if (excludes == null || excludes.size() == 0) {
      return false;
    }
    return excludes.stream()
        .filter(pattern -> SelectorUtils.matchPath(pattern, className, ".", true))
        .count() == 0;
  }
481198
@Override
  public Description matchNewClass(NewClassTree tree, VisitorState state) {
    if (!HAS_MUST_BE_CLOSED_ANNOTATION.matches(tree, state)) {
      return NO_MATCH;
    }
    return matchNewClassOrMethodInvocation(tree, state);
  }
1320500
@Override
  public Description matchClass(ClassTree tree, VisitorState state) {
    // TODO(b/36395371): filter here to exclude some classes (e.g. not immutable)
    if (TEST_CLASS.matches(tree, state)) {
      return NO_MATCH;
    }

    for (Tree member : tree.getMembers()) {
      if (isSuppressed(member)) {
        continue;
      }
      if ((member instanceof MethodTree
              && Matchers.methodIsConstructor().matches((MethodTree) member, state))
          || (member instanceof BlockTree && !((BlockTree) member).isStatic())
          || (member instanceof VariableTree && !Matchers.isStatic().matches(member, state))) {
        traverse(member, state);
      }
    }
    return NO_MATCH;
  }
1073002
private static boolean hasConflictingClassName(DescriptorProto messageDesc, String name) {
    if (name.equals(messageDesc.getName())) {
      return true;
    }
    for (EnumDescriptorProto enumDesc : messageDesc.getEnumTypeList()) {
      if (name.equals(enumDesc.getName())) {
        return true;
      }
    }
    for (DescriptorProto nestedMessageDesc : messageDesc.getNestedTypeList()) {
      if (hasConflictingClassName(nestedMessageDesc, name)) {
        return true;
      }
    }
    return false;
  }
253114
@Override
  public Description matchNewClass(NewClassTree newClassTree, VisitorState state) {
    if (state.getPath().getParentPath().getLeaf().getKind() != Kind.EXPRESSION_STATEMENT) {
      return Description.NO_MATCH;
    }
    if (newClassTree.getClassBody() == null) {
      return Description.NO_MATCH;
    }
    if (!newClassTree.getArguments().isEmpty()) {
      return Description.NO_MATCH;
    }
    for (Tree def : newClassTree.getClassBody().getMembers()) {
      switch (def.getKind()) {
        case VARIABLE:
          {
            VariableTree variableTree = (VariableTree) def;
            if (variableTree.getInitializer() != null) {
              return Description.NO_MATCH;
            }
            break;
          }
        case BLOCK:
          return Description.NO_MATCH;
        default:
          break;
      }
    }
    if (!sideEffectFreeConstructor(((JCTree) newClassTree.getIdentifier()).type.tsym, state)) {
      return Description.NO_MATCH;
    }
    return describeMatch(newClassTree);
  }
3948
public static Class<?> classForNameOrNull(final String className) {
        try {
            return Class.forName(className);
        } catch (final ReflectiveOperationException | LinkageError e) {
            return null;
        }
    }
621832
public static boolean isClassDeclaration(Node n) {
    return n.isClass() && isDeclarationParent(n.getParent()) && isNamedClass(n);
  }