Package org.apache.abdera.filter

Examples of org.apache.abdera.filter.TextFilter


  }
 
  public void testTextFilter() throws Exception {
   
    TextFilter filter = new TextFilter() {
      @Override
      public String filterText(String text, Element parent) {
        QName qname = parent.getQName();
        Base elparent = parent.getParentElement();
        if (Constants.NAME.equals(qname)) {
View Full Code Here


  }
 
  private OMNode applyTextFilter(int type) {
    if (parserOptions != null) {
      if (parser.isWhiteSpace() && parserOptions.getIgnoreWhitespace()) return createOMText("",type);
      TextFilter filter = parserOptions.getTextFilter();
      if (filter != null) {
        String value = parser.getText();
        if (!lastNode.isComplete())
          value = filter.filterText(value, (Element)lastNode);
        return createOMText(value, type);
      }
    }
    return createOMText(type);
  }
View Full Code Here

    return createOMText(type);
  }
 
  private String applyAttributeTextFilter(String value, QName attribute, Element parent) {
    if (parserOptions != null) {
      TextFilter filter = parserOptions.getTextFilter();
      if (filter != null) {
        return filter.filterAttributeText(value, attribute, parent);
      }
    }
    return value;
  }
View Full Code Here

public class TextFilterExample {

  public static void main(String[] args) throws Exception {
   
    // First create the text filter
    TextFilter filter = new TextFilter() {
      @Override
      public String filterText(String text, Element element) {
        QName qname = element.getQName();
        Base elparent = element.getParentElement();
        if (Constants.NAME.equals(qname)) {
View Full Code Here

TOP

Related Classes of org.apache.abdera.filter.TextFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.