Examples of CharactersEvent


Examples of com.bea.xml.stream.events.CharactersEvent

  }



  public Characters createCharacters(String content){
    return new CharactersEvent(content);
  }
View Full Code Here

Examples of com.bea.xml.stream.events.CharactersEvent

  public Characters createCharacters(String content){
    return new CharactersEvent(content);
  }
  public Characters createCData(String content) {
    return new CharactersEvent(content,true);
  }
View Full Code Here

Examples of com.bea.xml.stream.events.CharactersEvent

                                               EntityDeclaration declaration) {
    return new EntityReferenceEvent(name,declaration);
  }

  public Characters createSpace(String content) {
    CharactersEvent c = new CharactersEvent(content);
    c.setSpace(true);
    return c;
  }
View Full Code Here

Examples of com.bea.xml.stream.events.CharactersEvent

    c.setSpace(true);
    return c;
  }

  public Characters createIgnorableSpace(String content) {
    CharactersEvent c = new CharactersEvent(content);
    c.setSpace(true);
    c.setIgnorable(true);
    return c;
  }
View Full Code Here

Examples of com.topologi.diffx.event.impl.CharactersEvent

    if (seq.length() == 0) return Collections.emptyList();
    int x = TokenizerUtils.getLeadingWhiteSpace(seq);
    int y = TokenizerUtils.getTrailingWhiteSpace(seq);
    // no leading or trailing spaces return a singleton in all configurations
    if (x == 0 && y == 0) {
      TextEvent e = new CharactersEvent(seq);
      return Collections.singletonList(e);
    }
    // The text node is only white space (white space = trailing space)
    if (x == seq.length()) {
      switch (this.whitespace) {
        case COMPARE:
          return Collections.singletonList((TextEvent)SpaceEvent.getInstance(seq.toString()));
        case PRESERVE:
          return Collections.singletonList((TextEvent)new IgnorableSpaceEvent(seq.toString()));
        case IGNORE:
          return Collections.emptyList();
        default:
      }
      TextEvent e = new CharactersEvent(seq);
      return Collections.singletonList(e);
    }
    // some trailing or leading whitespace, behaviour changes depending on whitespace processing
    List<TextEvent> events = null;
    switch (this.whitespace) {
      case COMPARE:
        events = new ArrayList<TextEvent>(1 + (x > 0 ? 1 : 0) + (y > 0 ? 1 : 0));
        if (x > 0) {
          events.add(SpaceEvent.getInstance(seq.subSequence(0, x)));
        }
        events.add(new CharactersEvent(seq.subSequence(x, seq.length()-y)));
        if (y > 0) {
          events.add(SpaceEvent.getInstance(seq.subSequence(seq.length()-y, seq.length())));
        }
        break;
      case PRESERVE:
        events = new ArrayList<TextEvent>(1 + (x > 0 ? 1 : 0) + (y > 0 ? 1 : 0));
        if (x > 0) {
          events.add(new IgnorableSpaceEvent(seq.subSequence(0, x)));
        }
        events.add(new CharactersEvent(seq.subSequence(x, seq.length()-y)));
        if (y > 0) {
          events.add(new IgnorableSpaceEvent(seq.subSequence(seq.length()-y, seq.length())));
        }
        break;
      case IGNORE:
        TextEvent e = new CharactersEvent(seq.subSequence(x, seq.length()-y));
        events = Collections.singletonList(e);
        break;
      default:
    }
    return events;
View Full Code Here

Examples of com.topologi.diffx.event.impl.CharactersEvent

      TextEvent e = this.recycling.get(c);
      if (e == null) {
        if (Character.isWhitespace(c.charValue())) {
          e = SpaceEvent.getInstance(c);
        } else {
          e = new CharactersEvent(c+"");
        }
      }
      events.add(e);
    }
    return events;
View Full Code Here

Examples of javanet.staxutils.events.CharactersEvent

                break;
            case XMLStreamConstants.CDATA :
                events.add(new CDataEvent(getText(), getLocation()));
                break;
            case XMLStreamConstants.CHARACTERS :
                events.add(new CharactersEvent(getText(), getLocation()));
                break;
            case XMLStreamConstants.COMMENT :
                events.add(new CommentEvent(getText(), getLocation()));
                break;
            case XMLStreamConstants.DTD :
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.