当前位置: 首页>>代码示例>>Java>>正文


Java LSParserFilter.FILTER_ACCEPT属性代码示例

本文整理汇总了Java中org.w3c.dom.ls.LSParserFilter.FILTER_ACCEPT属性的典型用法代码示例。如果您正苦于以下问题:Java LSParserFilter.FILTER_ACCEPT属性的具体用法?Java LSParserFilter.FILTER_ACCEPT怎么用?Java LSParserFilter.FILTER_ACCEPT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.w3c.dom.ls.LSParserFilter的用法示例。


在下文中一共展示了LSParserFilter.FILTER_ACCEPT属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: characters

public void characters(char[] c, int off, int len)
  throws SAXException
{
  if (rejecting || interrupted)
    {
      return;
    }
  Text text = createText(c, off, len);
  short decision = getDecision(text, false);
  switch (decision)
    {
    case LSParserFilter.FILTER_ACCEPT:
      ctx.appendChild(text);
      break;
    case LSParserFilter.FILTER_INTERRUPT:
      interrupted = true;
      break;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:FilteredSAXEventSink.java

示例2: processingInstruction

public void processingInstruction(String target, String data)
  throws SAXException
{
  if (rejecting || interrupted || inDTD)
    {
      return;
    }
  Node pi = createProcessingInstruction(target, data);
  short decision = getDecision(pi, false);
  switch (decision)
    {
    case LSParserFilter.FILTER_ACCEPT:
      ctx.appendChild(pi);
      break;
    case LSParserFilter.FILTER_INTERRUPT:
      interrupted = true;
      break;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:FilteredSAXEventSink.java

示例3: endDTD

public void endDTD()
  throws SAXException
{
  if (interrupted)
    {
      return;
    }
  Node doctype = (Node) nodes.removeLast();
  decisions.removeLast();
  inDTD = false;
  ctx = doc;
  short decision = getDecision(doctype, false);
  switch (decision)
    {
    case LSParserFilter.FILTER_ACCEPT:
      ctx.appendChild(doctype);
      break;
    case LSParserFilter.FILTER_INTERRUPT:
      interrupted = true;
      break;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:22,代码来源:FilteredSAXEventSink.java

示例4: endElement

public void endElement(String uri, String localName, String qName)
  throws SAXException
{
  if (rejecting || interrupted)
    {
      return;
    }
  super.endElement(uri, localName, qName);

  Element element = (Element) nodes.removeLast();
  Node parent = nodes.isEmpty() ? doc : (Node) nodes.getLast();
  ctx = parent;
  short decision = ((Short) decisions.removeLast()).shortValue();
  switch (decision)
    {
    case LSParserFilter.FILTER_SKIP:
      // Add all children of element to parent
      for (Node child = element.getFirstChild(); child != null;
           child = child.getNextSibling())
        {
          parent.insertBefore(child, element);
        }
      return;
    case LSParserFilter.FILTER_REJECT:
      rejecting = false;
      break;
    }
  decision = getDecision(element, false);
  switch (decision)
    {
    case LSParserFilter.FILTER_ACCEPT:
      parent.appendChild(element);
      break;
    case LSParserFilter.FILTER_INTERRUPT:
      interrupted = true;
      break;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:38,代码来源:FilteredSAXEventSink.java

示例5: endElement

public void endElement(String uri, String localName, String qName)
  throws SAXException
{
  if (rejecting || interrupted)
    {
      return;
    }
  super.endElement(uri, localName, qName);
  
  Element element = (Element) nodes.removeLast();
  Node parent = nodes.isEmpty() ? doc : (Node) nodes.getLast();
  ctx = parent;
  short decision = ((Short) decisions.removeLast()).shortValue();
  switch (decision)
    {
    case LSParserFilter.FILTER_SKIP:
      // Add all children of element to parent
      for (Node child = element.getFirstChild(); child != null;
           child = child.getNextSibling())
        {
          parent.insertBefore(child, element);
        }
      return;
    case LSParserFilter.FILTER_REJECT:
      rejecting = false;
      break;
    }
  decision = getDecision(element, false);
  switch (decision)
    {
    case LSParserFilter.FILTER_ACCEPT:
      parent.appendChild(element);
      break;
    case LSParserFilter.FILTER_INTERRUPT:
      interrupted = true;
      break;
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:38,代码来源:FilteredSAXEventSink.java

示例6: acceptNode

@Override
public short acceptNode(Node nodeArg) {
  String textContent = nodeArg.getTextContent();
  if (textContent.trim().isEmpty()) {
    return LSParserFilter.FILTER_REJECT;
  } else {
    return LSParserFilter.FILTER_ACCEPT;
  }
}
 
开发者ID:languagetool-org,项目名称:languagetool,代码行数:9,代码来源:IgnoreWhitespaceFilter.java

示例7: getDecision

short getDecision(Node node, boolean start)
{
  boolean show = (whatToShow == NodeFilter.SHOW_ALL);
  if (!show)
    {
      switch (node.getNodeType())
        {
        case Node.ATTRIBUTE_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ATTRIBUTE) != 0);
          break;
        case Node.TEXT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_TEXT) != 0);
          break;
        case Node.CDATA_SECTION_NODE:
          show = ((whatToShow & NodeFilter.SHOW_CDATA_SECTION) != 0);
          break;
        case Node.ELEMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ELEMENT) != 0);
          break;
        case Node.COMMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_COMMENT) != 0);
          break;
        case Node.DOCUMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_DOCUMENT) != 0);
          break;
        case Node.PROCESSING_INSTRUCTION_NODE:
          show = ((whatToShow & NodeFilter.SHOW_PROCESSING_INSTRUCTION) != 0);
          break;
        case Node.DOCUMENT_FRAGMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_DOCUMENT_FRAGMENT) != 0);
          break;
        case Node.DOCUMENT_TYPE_NODE:
          show = ((whatToShow & NodeFilter.SHOW_DOCUMENT_TYPE) != 0);
          break;
        case Node.ENTITY_REFERENCE_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ENTITY_REFERENCE) != 0);
          break;
        case Node.ENTITY_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ENTITY) != 0);
          break;
        case Node.NOTATION_NODE:
          show = ((whatToShow & NodeFilter.SHOW_NOTATION) != 0);
          break;
        }
    }
  if (!show)
    {
      return LSParserFilter.FILTER_ACCEPT;
    }
  if (start)
    {
      return filter.startElement((Element) node);
    }
  return filter.acceptNode(node);
}
 
开发者ID:vilie,项目名称:javify,代码行数:55,代码来源:FilteredSAXEventSink.java

示例8: getDecision

short getDecision(Node node, boolean start)
{
  boolean show = (whatToShow == NodeFilter.SHOW_ALL);
  if (!show)
    {
      switch (node.getNodeType())
        {
        case Node.ATTRIBUTE_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ATTRIBUTE) != 0);
          break;     
        case Node.TEXT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_TEXT) != 0);
          break;     
        case Node.CDATA_SECTION_NODE:
          show = ((whatToShow & NodeFilter.SHOW_CDATA_SECTION) != 0);
          break;     
        case Node.ELEMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ELEMENT) != 0);
          break;     
        case Node.COMMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_COMMENT) != 0);
          break;     
        case Node.DOCUMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_DOCUMENT) != 0);
          break;     
        case Node.PROCESSING_INSTRUCTION_NODE:
          show = ((whatToShow & NodeFilter.SHOW_PROCESSING_INSTRUCTION) != 0);
          break;     
        case Node.DOCUMENT_FRAGMENT_NODE:
          show = ((whatToShow & NodeFilter.SHOW_DOCUMENT_FRAGMENT) != 0);
          break;     
        case Node.DOCUMENT_TYPE_NODE:
          show = ((whatToShow & NodeFilter.SHOW_DOCUMENT_TYPE) != 0);
          break;     
        case Node.ENTITY_REFERENCE_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ENTITY_REFERENCE) != 0);
          break;     
        case Node.ENTITY_NODE:
          show = ((whatToShow & NodeFilter.SHOW_ENTITY) != 0);
          break;     
        case Node.NOTATION_NODE:
          show = ((whatToShow & NodeFilter.SHOW_NOTATION) != 0);
          break;     
        }
    }
  if (!show)
    {
      return LSParserFilter.FILTER_ACCEPT;
    }
  if (start)
    {
      return filter.startElement((Element) node);
    }
  return filter.acceptNode(node);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:55,代码来源:FilteredSAXEventSink.java

示例9: acceptNode

public short acceptNode(Node nodeArg) {
    return LSParserFilter.FILTER_ACCEPT;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:3,代码来源:DOMParserImpl.java

示例10: startElement

public short startElement(Element elementArg) {
    return LSParserFilter.FILTER_ACCEPT;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:3,代码来源:DOMParserImpl.java

示例11: startElement

/**
 * @see org.w3c.dom.ls.LSParserFilter#startElement(Element)
 */
public short startElement(Element elt) {
	return LSParserFilter.FILTER_ACCEPT;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:6,代码来源:DOM3.java

示例12: startElement

@Override
public short startElement(Element elementArg) {
  return LSParserFilter.FILTER_ACCEPT;
}
 
开发者ID:languagetool-org,项目名称:languagetool,代码行数:4,代码来源:IgnoreWhitespaceFilter.java


注:本文中的org.w3c.dom.ls.LSParserFilter.FILTER_ACCEPT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。