org.joox.Match.get()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.joox.Match.get()方法的一些代码示例,展示了Match.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Match.get()方法的具体详情如下:
包路径:org.joox.Match
类名称:Match
方法名:get

Match.get介绍

[英]Get an the set of matched elements
[中]从匹配的元素集合中获取一个

代码示例

代码示例来源:origin: org.jooq/joox-java-6

/**
 * Transform an {@link Match}[] into an {@link Element}[], removing duplicates.
 */
static final Element[] elements(Match... content) {
  Set<Element> result = new LinkedHashSet<Element>();
  for (Match x : content)
    result.addAll(x.get());
  return result.toArray(new Element[result.size()]);
}

代码示例来源:origin: org.jooq/joox-java-6

/**
 * Find the index among siblings of the same tag name
 */
private static final int siblingIndex(Element element) {
  // The document element has index 0
  if (element.getParentNode() == element.getOwnerDocument())
    return 0;
  // All other elements are compared with siblings with the same name
  // TODO: How to deal with namespaces here? Omit or keep?
  else
    return $(element).parent().children(element.getTagName()).get().indexOf(element);
}

代码示例来源:origin: stackoverflow.com

final Document doc = ...

// Iterate over <R/> elements
for (Match r : $(doc).find("R").each()) {

 // Iterate over <C/> children and rename nodes
 Match c = r.children("C");
 for (int i = 0; i < c.size(); i++) {
  doc.renameNode(c.get(i), "", "Name" + (i + 1));
 }
}

// Check results
System.out.println($(doc));

代码示例来源:origin: org.jooq/joox-java-6

@Override
public final Impl add(Match... e) {
  Impl x = copy();
  for (Match element : e)
    x.addUniqueElements(element.get());
  return x;
}

代码示例来源:origin: org.jboss.windup.addon/config-impl

@Override
public Or processElement(ParserContext handlerManager, Element element)
{
 List<Condition> conditions = new ArrayList<>();
 List<Element> children = $(element).children().get();
 for (Element child : children)
 {
   Condition condition = handlerManager.processElement(child);
   conditions.add(condition);
 }
 return Or.any(conditions.toArray(new Condition[conditions.size()]));
}

代码示例来源:origin: org.jboss.windup.config/windup-config-xml

@Override
public Or processElement(ParserContext handlerManager, Element element)
{
 List<Condition> conditions = new ArrayList<>();
 List<Element> children = $(element).children().get();
 for (Element child : children)
 {
   Condition condition = handlerManager.processElement(child);
   conditions.add(condition);
 }
 return Or.any(conditions.toArray(new Condition[conditions.size()]));
}

代码示例来源:origin: org.jboss.windup.config/windup-config-xml

@Override
public And processElement(ParserContext handlerManager, Element element)
{
 List<Condition> conditions = new ArrayList<>();
 List<Element> children = $(element).children().get();
 for (Element child : children)
 {
   Condition condition = handlerManager.processElement(child);
   conditions.add(condition);
 }
 return And.all(conditions.toArray(new Condition[conditions.size()]));
}

代码示例来源:origin: windup/windup

@Override
public Or processElement(ParserContext handlerManager, Element element)
{
 List<Condition> conditions = new ArrayList<>();
 List<Element> children = $(element).children().get();
 for (Element child : children)
 {
   Condition condition = handlerManager.processElement(child);
   conditions.add(condition);
 }
 return Or.any(conditions.toArray(new Condition[conditions.size()]));
}

代码示例来源:origin: org.jboss.windup.addon/config-impl

@Override
public And processElement(ParserContext handlerManager, Element element)
{
 List<Condition> conditions = new ArrayList<>();
 List<Element> children = $(element).children().get();
 for (Element child : children)
 {
   Condition condition = handlerManager.processElement(child);
   conditions.add(condition);
 }
 return And.all(conditions.toArray(new Condition[conditions.size()]));
}

代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-ee

private Iterable<Element> findLocalBeanById(Document doc, String id)
{
  List<Element> elements = new LinkedList<>();
  elements.addAll($(doc).children().filter(attr("id", id)).get());
  if (elements.isEmpty())
  {
    elements.addAll($(doc).children().filter(attr("name", id)).get());
  }
  return elements;
}

代码示例来源:origin: windup/windup

private Iterable<Element> findLocalBeanById(Document doc, String id)
{
  List<Element> elements = new LinkedList<>();
  elements.addAll($(doc).children().filter(attr("id", id)).get());
  if (elements.isEmpty())
  {
    elements.addAll($(doc).children().filter(attr("name", id)).get());
  }
  return elements;
}

代码示例来源:origin: org.jboss.windup.config/windup-config-xml

@Override
public Void processElement(ParserContext handlerManager, Element element)
{
  List<Element> children = $(element).children().get();
  for (Element child : children)
  {
    handlerManager.processElement(child);
  }
  return null;
}

代码示例来源:origin: org.jboss.windup.addon/config-impl

@Override
public Not processElement(ParserContext handlerManager, Element element)
{
 Element child = $(element).children().get().get(0);
 Condition condition = handlerManager.processElement(child);
 return Not.any(condition);
}

代码示例来源:origin: org.jboss.windup.addon/config-impl

@Override
public Void processElement(ParserContext handlerManager, Element element)
{
 List<Element> children = $(element).children().get();
 for (Element child : children)
 {
   handlerManager.processElement(child);
 }
 return null;
}

代码示例来源:origin: windup/windup

@Override
public Void processElement(ParserContext handlerManager, Element element)
{
  List<Element> children = $(element).children().get();
  for (Element child : children)
  {
    handlerManager.processElement(child);
  }
  return null;
}

代码示例来源:origin: windup/windup

@Override
public Not processElement(ParserContext handlerManager, Element element)
{
 Element child = $(element).children().get().get(0);
 Condition condition = handlerManager.processElement(child);
 return Not.any(condition);
}

代码示例来源:origin: org.jboss.windup.config/windup-config-xml

@Override
public Not processElement(ParserContext handlerManager, Element element)
{
 Element child = $(element).children().get().get(0);
 Condition condition = handlerManager.processElement(child);
 return Not.any(condition);
}

代码示例来源:origin: windup/windup

@Override
public ToFileModel processElement(ParserContext context, Element element) throws ConfigurationException
{
  List<Element> children = JOOX.$(element).children().get();
  validateChildren(children);
  Element firstChild = children.get(0);
  GraphCondition wrappedCondition = (GraphCondition) context.processElement(firstChild);
  validateWrappedCondition(wrappedCondition);
  return ToFileModel.withWrappedCondition(wrappedCondition);
}

代码示例来源:origin: org.jboss.windup.addon/config-impl

@Override
  public Operation processElement(ParserContext handlerManager, Element element) throws ConfigurationException
  {
   OperationBuilder result = Operations.create();
   List<Element> children = $(element).children().get();
   for (Element child : children)
   {
     Operation operation = handlerManager.processElement(child);
     result = result.and(operation);
   }
   return result;
  }
}

代码示例来源:origin: org.jboss.windup.config/windup-config-xml

@Override
  public Operation processElement(ParserContext handlerManager, Element element) throws ConfigurationException
  {
    OperationBuilder result = Operations.create();
    List<Element> children = $(element).children().get();
    for (Element child : children)
    {
      Operation operation = handlerManager.processElement(child);
      result = result.and(operation);
    }
    return result;
  }
}

相关文章