Tabnine Logo
org.jdom2.filter
Code IndexAdd Tabnine to your IDE (free)

How to use org.jdom2.filter

Best Java code snippets using org.jdom2.filter (Showing top 20 results out of 315)

origin: gocd/gocd

  public void validate(Element element, ConfigElementImplementationRegistry registry) throws Exception {
    XPathFactory xPathFactory = XPathFactory.instance();
    List<String> tasks = ConfigUtil.allTasks(registry);
    for (String task : tasks) {
      List<Element> taskNodes = xPathFactory.compile("//" + task, Filters.element()).evaluate(element);
      for (Element taskNode : taskNodes) {
        List<Element> list = xPathFactory.compile("oncancel", Filters.element()).evaluate(taskNode);
        if (list.size() > 1) {
          throw new Exception("Task [" + task + "] should not contain more than 1 oncancel task");
        }
      }
    }
  }
}
origin: org.jdom/jdom

/**
 * Set filtering mask.
 *
 * @param mask the new filtering mask
 */
public void setFilterMask(int mask) {
  setDefaultMask();
  filterMask &= mask;
}
origin: org.jdom/jdom

/**
 * Filter out JDOM objects according to a filtering mask.
 *
 * @param mask Mask of JDOM objects to allow.
 */
public ContentFilter(int mask) {
  setFilterMask(mask);
}
origin: org.jdom/jdom

/**
 * Return a Filter that matches any {@link Element} data with the specified
 * name and Namespace.
 * 
 * @param name The name of Elements to match.
 * @param ns The Namespace to match
 * @return a Filter that matches any {@link Element} data with the specified
 * name and Namespace.
 */
public static final Filter<Element> element(String name, Namespace ns) {
  return new ElementFilter(name, ns);
}
origin: org.jdom/jdom

/**
 * Return a Filter that matches any {@link Attribute} data with the 
 * specified name.
 * 
 * @param name The name for all the Attributes to have (these can be in any
 * Namespace).
 * @return a Filter that matches any {@link Attribute} data with the 
 * specified name.
 */
public static final Filter<Attribute> attribute(String name) {
  return new AttributeFilter(name);
}
origin: org.jdom/jdom

@Override
public final Filter<?> negate() {
  if (this instanceof NegateFilter) {
    return ((NegateFilter)this).getBaseFilter();
  }
  return new NegateFilter(this);
}
origin: org.jdom/jdom

  @Override
  public <R> Filter<R> refine(Filter<R> filter) {
    return new AndFilter<R>(this, filter);
  }
}
origin: org.jdom/jdom

@Override
public Object filter(Object content) {
  if (filter.matches(content)) {
    return null;
  }
  return content;
}
origin: org.jdom/jdom

@Override
public T filter(Object content) {
  Object o = base.filter(content);
  if (o != null) {
    return refiner.filter(content);
  }
  return null;
}

origin: org.jdom/jdom

@Override
public final boolean matches(Object content) {
  return filter(content) != null;
}
origin: org.jdom/jdom

/**
 * Return a Filter that matches any data of the specified Class.
 * 
 * @param <F> The generic type of the content returned by this Filter
 * @param clazz the Class type to match in the filter
 * @return a Filter that matches any data of the specified Class.
 */
public static final <F> Filter<F> fclass(Class<F> clazz) {
  return new ClassFilter<F>(clazz);
}
origin: gocd/gocd

XPathFactory xPathFactory = XPathFactory.instance();
for (String attributeName : encryptedAttributes) {
  XPathExpression<Element> xpathExpression = xPathFactory.compile(String.format("//*[@%s]", attributeName), Filters.element());
  List<Element> encryptedPasswordElements = xpathExpression.evaluate(document);
  for (Element element : encryptedPasswordElements) {
  XPathExpression<Element> xpathExpression = xPathFactory.compile(String.format("//%s", nodeName), Filters.element());
  List<Element> encryptedNode = xpathExpression.evaluate(document);
  for (Element element : encryptedNode) {
origin: org.jdom/jdom

/**
 * Return a Filter that matches any {@link Element} data with the specified
 * name.
 * 
 * @param name The name of Elements to match.
 * @return a Filter that matches any {@link Element} data with the specified
 * name.
 */
public static final Filter<Element> element(String name) {
  return new ElementFilter(name, Namespace.NO_NAMESPACE);
}
origin: org.jdom/jdom

/**
 * Return a Filter that matches any {@link Attribute} data with the
 * specified name and namespace.
 * 
 * @param name The name for all the Attributes to have.
 * @param ns The Namespace for all the Attributes to have.
 * @return a Filter that matches any {@link Attribute} data with the
 * specified name and namespace.
 */
public static final Filter<Attribute> attribute(String name, Namespace ns) {
  return new AttributeFilter(name, ns);
}
origin: org.jdom/jdom

/**
 * Default constructor that allows any legal JDOM objects.
 */
public ContentFilter() {
  setDefaultMask();
}
origin: org.jdom/jdom

@Override
public final Filter<T> and(Filter<?> filter) {
  return new AndFilter<T>(filter, this);
}
origin: org.jdom/jdom

@Override
public Content filter(Object obj) {
  if (left.matches(obj) || right.matches(obj)) {
    return (Content)obj;
  }
  return null;
}
origin: org.jdom/jdom

/**
 * Return a Filter that matches any {@link Element} data with the specified
 * Namespace.
 * 
 * @param ns The Namespace to match
 * @return a Filter that matches any {@link Element} data with the specified
 * Namespace.
 */
public static final Filter<Element> element(Namespace ns) {
  return new ElementFilter(null, ns);
}
origin: org.jdom/jdom

/**
 * Return a Filter that matches any {@link Attribute} data with the
 * specified namespace.
 * 
 * @param ns The Namespace for all the Attributes to have.
 * @return a Filter that matches any {@link Attribute} data with the
 * specified namespace.
 */
public static final Filter<Attribute> attribute(Namespace ns) {
  return new AttributeFilter(ns);
}
origin: org.jdom/jdom

/**
 * Set whether all JDOM objects are visible or not.
 *
 * @param allVisible <code>true</code> all JDOM objects are visible,
 *                   <code>false</code> all JDOM objects are hidden.
 */
public ContentFilter(boolean allVisible) {
  if (allVisible) {
    setDefaultMask();
  }
  else {
    filterMask &= ~filterMask;
  }
}
org.jdom2.filter

Most used classes

  • Filters
    Factory class of convenience methods to create Filter instances of common types. Methods that return
  • ElementFilter
    A Filter that only matches org.jdom2.Element objects.
  • ContentFilter
    A general purpose Filter able to represent all legal JDOM objects or a specific subset. Filtering is
  • AttributeFilter
    A Filter that only matches org.jdom2.Attribute objects.
  • Filter
    A generalized filter to restrict visibility or mutability on a list.
  • AndFilter,
  • ClassFilter,
  • NegateFilter,
  • OrFilter
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