Tabnine Logo
SearchHandlerManager.getClauseHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
getClauseHandler
method
in
com.atlassian.jira.issue.search.managers.SearchHandlerManager

Best Java code snippets using com.atlassian.jira.issue.search.managers.SearchHandlerManager.getClauseHandler (Showing top 14 results out of 315)

origin: com.atlassian.jira/jira-core

  private Collection<ClauseHandler> getHandlersForClauseName(final QueryCreationContext queryCreationContext, final String primaryClauseName)
  {
    if (queryCreationContext.isSecurityOverriden())
    {
      return searchHandlerManager.getClauseHandler(primaryClauseName);
    }
    else
    {
      return searchHandlerManager.getClauseHandler(queryCreationContext.getApplicationUser(), primaryClauseName);
    }
  }
}
origin: com.atlassian.jira/jira-core

  private ClauseValuesGenerator getClauseValuesGeneratorForField(final String fieldName)
  {
    final ApplicationUser searcher = authenticationContext.getUser();
    final Collection<ClauseHandler> clauseHandlers = searchHandlerManager.getClauseHandler(searcher, fieldName);
    if (clauseHandlers != null && clauseHandlers.size() == 1)
    {
      ClauseHandler clauseHandler = clauseHandlers.iterator().next();

      if (clauseHandler instanceof ValueGeneratingClauseHandler)
      {
        return ((ValueGeneratingClauseHandler) clauseHandler).getClauseValuesGenerator();
      }
    }
    return null;
  }
}
origin: com.atlassian.jira/jira-api

  public String getUniqueClauseName(final ApplicationUser user, final String primaryName, final String fieldName)
  {
    // we must check that the name of the field is not something that would cause it to not be registered in the
    // SearchHandlerManager, for this would mean that the name is potentially not unique
    if (!SystemSearchConstants.isSystemName(fieldName))
    {
      if (!JqlCustomFieldId.isJqlCustomFieldId(fieldName))
      {
        if (searchHandlerManager.getClauseHandler(user, fieldName).size() == 1)
        {
          return fieldName;
        }
      }
    }
    return primaryName;
  }
}
origin: com.atlassian.jira/jira-core

public Collection<ClauseValidator> getClauseValidator(final ApplicationUser searcher, final TerminalClause clause)
{
  notNull("clause", clause);
  Collection<ClauseHandler> clauseHandlers = manager.getClauseHandler(searcher, clause.getName());
  // Collect the factories.
  // JRA-23141 : We avoid using a lazy transformed collection here because it gets accessed multiple times
  // and size() in particular is slow.
  List<ClauseValidator> clauseValidators = new ArrayList<ClauseValidator>(clauseHandlers.size());
  for (ClauseHandler clauseHandler : clauseHandlers)
  {
    clauseValidators.add(clauseHandler.getValidator());
  }
  return clauseValidators;
}
origin: com.atlassian.jira/jira-rest-plugin

public Iterable<Result> getAutoCompleteResultsForField(final String fieldName, final String fieldValue)
{
  checkNotNull(fieldName);
  checkNotNull(fieldValue);
  final ApplicationUser searcher = getSearcher();
  final Collection<ClauseHandler> clauseHandlers = searchHandlerManager.getClauseHandler(searcher, fieldName);
  if (clauseHandlers.size() == 1)
  {
    ClauseHandler clauseHandler = clauseHandlers.iterator().next();
    if (clauseHandler instanceof ValueGeneratingClauseHandler)
    {
      final ClauseValuesGenerator clauseValuesGenerator =  ((ValueGeneratingClauseHandler) (clauseHandler))
          .getClauseValuesGenerator();
      return generateResults(clauseValuesGenerator, searcher, fieldName, fieldValue);
    }
  }
  return ImmutableList.of();
}
origin: com.atlassian.jira/jira-core

private boolean stringValueExists(PossibleValuesHolder possibleValuesHolder, ApplicationUser searcher, String fieldName, String rawValue)
  final Collection<ClauseHandler> clauseHandlers = searchHandlerManager.getClauseHandler(searcher, fieldName);
  if (clauseHandlers != null && clauseHandlers.size() == 1)
origin: com.atlassian.jira/jira-core

public Clause visit(TerminalClause clause)
{
  // if we don't get any handlers back, this means the user does not have permission to use the clause, so just
  // return the input
  final Collection<ClauseHandler> handlers = searchHandlerManager.getClauseHandler(user, clause.getName());
  if (handlers.isEmpty())
  {
    return clause;
  }
  // first, we want to sanitise all operands with the DefaultOperandSanitisingVisitor, as it uses a strategy that
  // should be applied across all fields
  clause = sanitiseOperands(clause);
  // we only care about unique sanitised clauses, so use a set
  final Set<Clause> newClauses = new LinkedHashSet<Clause>();
  for (ClauseHandler clauseHandler : handlers)
  {
    newClauses.add(clauseHandler.getPermissionHandler().sanitise(user, clause));
  }
  return newClauses.size() == 1 ? newClauses.iterator().next() : new OrClause(newClauses);
}
origin: com.atlassian.jira/jira-core

  public Collection<ClauseQueryFactory> getClauseQueryFactory(final QueryCreationContext queryCreationContext, final TerminalClause clause)
  {
    notNull("clause", clause);
    final Collection<ClauseHandler> handlers;
    if (!queryCreationContext.isSecurityOverriden())
    {
      handlers = manager.getClauseHandler(queryCreationContext.getApplicationUser(), clause.getName());
    }
    else
    {
      handlers = manager.getClauseHandler(clause.getName());
    }
    // Collect the factories.
    // JRA-23141 : We avoid using a lazy transformed collection here because it gets accessed multiple times
    // and size() in particular is slow.
    final List<ClauseQueryFactory> clauseQueryFactories = new ArrayList<ClauseQueryFactory>(handlers.size());
    for (ClauseHandler clauseHandler : handlers)
    {
      clauseQueryFactories.add(clauseHandler.getFactory());
    }
    return clauseQueryFactories;
  }
}
origin: com.atlassian.jira/jira-core

final Collection<ClauseHandler> handlers = searchHandlerManager.getClauseHandler(user, sort.getField());
origin: com.atlassian.jira/jira-core

final Collection<ClauseHandler> handlers = searchHandlerManager.getClauseHandler(user, customField.getClauseNames().getPrimaryName());
for (ClauseHandler handler : handlers)
origin: com.atlassian.jira/jira-core

for (SearchSort newSort : newSorts)
  final Collection<ClauseHandler> newHandlers = searchHandlerManager.getClauseHandler(user, newSort.getField());
  if (newHandlers.size() != 1)
  for (SearchSort oldSort : oldSorts)
    final Collection<ClauseHandler> oldHandlers = searchHandlerManager.getClauseHandler(user, oldSort.getField());
    if (oldHandlers.size() == 1)
origin: com.atlassian.jira/jira-core

final Collection<ClauseHandler> handlers = searchHandlerManager.getClauseHandler(searcher, clauseName);
final Set<ClauseContext> fullClauseContexts = new HashSet<ClauseContext>();
final Set<ClauseContext> simpleClauseContexts = new HashSet<ClauseContext>();
origin: com.atlassian.jira/jira-core

List<ClauseContextFactory> getAllSystemFieldFactories(final ApplicationUser searcher)
{
  final List<String> systemFieldClauseNames = CollectionBuilder.newBuilder(
      SystemSearchConstants.forComments().getJqlClauseNames().getPrimaryName(),
      SystemSearchConstants.forDescription().getJqlClauseNames().getPrimaryName(),
      SystemSearchConstants.forEnvironment().getJqlClauseNames().getPrimaryName(),
      SystemSearchConstants.forSummary().getJqlClauseNames().getPrimaryName()
  ).asList();
  final List<ClauseContextFactory> factories = Lists.newArrayListWithCapacity(systemFieldClauseNames.size());
  for (String clauseName : systemFieldClauseNames)
  {
    final Collection<ClauseHandler> handlers = searchHandlerManager.getClauseHandler(searcher, clauseName);
    for (ClauseHandler handler : handlers)
    {
      factories.add(handler.getClauseContextFactory());
    }
  }
  return factories;
}
origin: com.atlassian.jira/jira-core

Collection<ClauseHandler> clauseHandler = searchHandlerManager.getClauseHandler(searchSort.getField());
clauseHandler.stream()
    .filter((handler) -> handler.getInformation() instanceof AliasClauseInformation)
com.atlassian.jira.issue.search.managersSearchHandlerManagergetClauseHandler

Javadoc

Return a collection of com.atlassian.jira.jql.ClauseHandlers registered against the passed JQL clause name. This will only return the handlers that the user has permission to see as specified by the com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(User)method. The reason this is returning a collection is that custom fields can have the same JQL clause name and therefore resolve to multiple clause handlers, this will never be the case for System fields, we don't allow it!

Popular methods of SearchHandlerManager

  • getJqlClauseNames
    Get the com.atlassian.jira.issue.search.ClauseNames associated with the provided field name. A colle
  • getFieldIds
    Gets the field ids that are associated with the provided jqlClauseName. The reason this returns a co
  • getSearcher
    Get a searcher by the searchers name.
  • getAllSearchers
    Return all the active searchers in JIRA. It will not return the searchers unless they are associated
  • getSearcherGroups
    Get all searcher groups with the IssueSearcher that are applicable for the context. * com.atlassian.
  • getSearchers
    Get searchers that are applicable for a given context. This is found through the * com.atlassian.jir
  • getSearchersByClauseName
    Return a collection of com.atlassian.jira.issue.search.searchers.IssueSearchers registered against t
  • getVisibleClauseHandlers
    Get all the available clause handlers that the searcher can see.
  • refresh
    Refreshes the com.atlassian.jira.issue.search.managers.SearchHandlerManager.

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now