Returns true if the name matches against the template that may contain the wildcard char '*'.

@param name
@param template
@return true if <code>name</code> matches <code>template</code>.
480018
private static boolean matchWildCards(String name, String template) {
        int wildcardIndex = template.indexOf("*");
        if (wildcardIndex == -1) {
            return name.equals(template);
        }

        boolean isBeginning = true;
        String beforeWildcard;
        String afterWildcard = template;
        while (wildcardIndex != -1) {
            beforeWildcard = afterWildcard.substring(0, wildcardIndex);
            afterWildcard = afterWildcard.substring(wildcardIndex + 1);

            int beforeStartIndex = name.indexOf(beforeWildcard);
            if ((beforeStartIndex == -1) || (isBeginning && beforeStartIndex != 0)) {
                return false;
            }
            isBeginning = false;

            name = name.substring(beforeStartIndex + beforeWildcard.length());
            wildcardIndex = afterWildcard.indexOf("*");
        }

        return name.endsWith(afterWildcard);
    }
267824
public boolean sourceExists(String name) {

        if (name != null && name.equals(getTemplateName())) {
            return true;
        }

        // Look for a .tea file
        return super.sourceExists(name);
    }
111602
public void registerTemplate(ITemplate template) {
        //TemplateResourceManager rm = resourceManager();
        String name;
        if (template instanceof JavaTagBase) {
            name = template.__getName();
        } else {
            name = template.__getTemplateClass(false).getTagName();
        }
        registerTemplate(name, template);
    }
1226023
protected boolean name_matches(String pattern) {
	pattern = pattern.toLowerCase().replaceAll("[*]{1}", ".*?");
	return name.toLowerCase().matches(pattern) || get_fully_qualified_name().toLowerCase().matches(pattern);
    }
427578
def template_exists(template_name):
    '''
    
    '''
    try:
        template.loader.get_template(template_name)
        return True
    except template.TemplateDoesNotExist:
        return False
1362850
public static boolean charValidate(String name) {
        if (name.matches("[0-9]+") || name.toLowerCase().equals("null")) {
            return false;
        } else {
            return name.matches("[a-zA-Z0-9-_.]+");
        }
    }
1031354
public static boolean matchesTypeName(Class<?> clazz, String typeName) {
        return (typeName != null &&
                (typeName.equals(clazz.getTypeName()) || typeName.equals(clazz.getSimpleName())));
    }
954098
public static String findTemplateName(org.teatrove.tea.compiler.Scanner scanner) {
        // System.out.println("<-- findTemplateName -->");
        Token token;
        String name = null;
        try {
            while (((token = scanner.readToken()).getID()) != Token.EOF) {
                /*
                System.out.println("Token [Code: " +
                                   token.getCode() + "] [Image: " +
                                   token.getImage() + "] [Value: " +
                                   token.getStringValue() + "] [Id: " +
                                   token.getID() + "]");
                */
                if (token.getID() == Token.TEMPLATE) {
                    token = scanner.readToken();
                    if (token.getID() == Token.IDENT) {
                        name = token.getStringValue();
                    }
                    break;
                }
            }
        }
        catch (IOException ioe) {
            ioe.printStackTrace();
        }

        return name;
    }
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));
   }
212352
@Ensures("result == isQualifiedName(name.replace('/', '.'))")
  public static boolean isBinaryName(String name) {
    if (name == null || name.isEmpty()) {
      return false;
    }
    String[] parts = name.split("/");
    for (String part : parts) {
      if (!isSimpleName(part)) {
        return false;
      }
    }
    return true;
  }
617400
public static boolean contains(String name, Iterable<String> patterns) {
        String nameUpper = name.toUpperCase();
        for (String pattern : patterns) {
            String patternUpper = pattern.toUpperCase();
            if (nameUpper.equals(patternUpper) || nameUpper.contains(patternUpper)) {
                return true;
            }
        }

        return false;
    }
283631
protected Template getTemplate(String name) {
    try {
      return configuration.getTemplate(name);
    } catch (IOException e) {
      throw new GenException(Message.DOMAGEN9001, e, e);
    }
  }
495681
def check_match(self, name):
        
        return any(pattern.match(name) for pattern in self.patterns)
140691
public boolean isMatchingName(String uri, String localPart) {
	// check and normalize arguments
	if (localPart == null)
	    throw new IllegalArgumentException("need non-null localPart");
	if (uri != null && uri.equals(""))
	    uri = null;

	// split name into uri/localPart if we haven't done so already
	if (this.localPart == null && this.uri == null)
	    parseStepName();

	// generic wildcard
	if (this.uri == null && this.localPart.equals("*"))
	    return true;

	// match will null namespace
	if (uri == null && this.uri == null
		&& localPart.equals(this.localPart))
	    return true;

	if (uri != null && this.uri != null && uri.equals(this.uri)) {
	    // exact match
	    if (localPart.equals(this.localPart))
		return true;

	    // namespace-specific wildcard
	    if (this.localPart.equals("*"))
		return true;
	}

	// no match
	return false;
    }
800465
public String renderIfTemplateExists(String template, Object... args) {
        boolean typeInferenceEnabled = conf().typeInferenceEnabled();
        if (typeInferenceEnabled) {
            ParamTypeInferencer.registerParams(this, args);
        }

        if (nonExistsTemplates.contains(template)) return "";

        String key = template;
        if (typeInferenceEnabled) {
            key += ParamTypeInferencer.uuid();
        }

        try {
            TemplateClass tc = classes().getByTemplate(template);
            if (null == tc) {
                ITemplateResource rsrc = resourceManager().getResource(template);
                if (rsrc.isValid()) {
                    tc = new TemplateClass(rsrc, this);
                    //classes().add(key, tc);
                } else {
                    nonExistsTemplates.add(template);
                    if (isDevMode() && nonExistsTemplatesChecker == null) {
                        nonExistsTemplatesChecker = new NonExistsTemplatesChecker();
                    }
                    return "";
                }
            }
            ITemplate t = tc.asTemplate(this);
            setRenderArgs(t, args);
            return t.render();
        } finally {
            renderCleanUp();
        }
    }
537669
def disable_template(name)
      name = name.to_sym

      return false if @disabled_templates.include?(name)

      if (template_dir = Template.templates[name])
        source_paths.delete(template_dir)

        @templates.delete_if { |template| template.path == template_dir }
        @enabled_templates.delete(name)
      end

      @disabled_templates << name
      return true
    end
121162
private static boolean isValid(String name) {
    return !name.isEmpty() && name.length() <= MAX_LENGTH && StringUtils.isPrintableString(name);
  }