Beispiel #1
0
  void nextSibling() {
    if (LOG.isLoggable(Level.FINER)) {
      LOG.finer("Next sibling");
    }

    nodePath.push(nodePath.pop() + 1);
  }
Beispiel #2
0
  void start(XMLEntity entity) {
    if (LOG.isLoggable(Level.FINER)) {
      LOG.finer("Start of " + entity);
    }

    final boolean parentIncluded = (inclusionContext.isEmpty() ? true : inclusionContext.peek());
    inclusionContext.push(
        parentIncluded ? !configuration.excluded(entity) : configuration.included(entity));

    spacePreservationContext.push(
        spacePreservationContext.isEmpty() ? false : spacePreservationContext.peek());
    final Object xmlSpace = entity.getAttributes().get(TextConstants.XML_SPACE_ATTR_NAME);
    if (xmlSpace != null) {
      spacePreservationContext.pop();
      spacePreservationContext.push("preserve".equalsIgnoreCase(xmlSpace.toString()));
    }

    nodePath.set(entity.getAttributes());
    nodePath.push(0);

    elementContext.push(entity);

    for (XMLTransformerModule<T> m : modules) {
      m.start(this, entity);
    }
  }
Beispiel #3
0
  void start() {
    if (LOG.isLoggable(Level.FINER)) {
      LOG.finer("Start of document");
    }

    elementContext.clear();
    inclusionContext.clear();
    spacePreservationContext.clear();
    nodePath.clear();

    textBuffer = new FileBackedOutputStream(configuration.getTextBufferSize(), true);
    textStartOffset = -1;
    lastChar = (configuration.isRemoveLeadingWhitespace() ? ' ' : 0);

    sourceOffset = 0;
    textOffset = 0;

    sourceOffsetRange = TextRange.NULL;
    textOffsetRange = TextRange.NULL;

    this.nodePath.push(0);
    for (XMLTransformerModule<T> m : modules) {
      m.start(this);
    }
  }
Beispiel #4
0
  void end(XMLEntity entity) {
    if (LOG.isLoggable(Level.FINER)) {
      LOG.finer("End of " + entity);
    }

    for (XMLTransformerModule<T> m : modules) {
      m.end(this, entity);
    }

    elementContext.pop();
    nodePath.pop();
    spacePreservationContext.pop();
    inclusionContext.pop();
  }