Class TagAdapter

java.lang.Object
jodd.lagarto.TagAdapter
All Implemented Interfaces:
TagVisitor
Direct Known Subclasses:
StripHtmlTagAdapter, UrlRewriterTagAdapter

public class TagAdapter extends Object implements TagVisitor
Tag adapter. Usually, an adapter changes the input contents for the wrapped visitor.
  • Field Details

  • Constructor Details

    • TagAdapter

      public TagAdapter(TagVisitor target)
  • Method Details

    • getTarget

      public TagVisitor getTarget()
      Returns target tag visitor. It may be another nested TagAdapter or TagWriter.
    • start

      public void start()
      Description copied from interface: TagVisitor
      Invoked on very beginning of the visiting.
      Specified by:
      start in interface TagVisitor
    • end

      public void end()
      Description copied from interface: TagVisitor
      Invoked at the end, after all content is visited.
      Specified by:
      end in interface TagVisitor
    • tag

      public void tag(Tag tag)
      Description copied from interface: TagVisitor
      Invoked on tag (open, close or empty).

      Warning: the passed tag instance should not be kept beyond this method as the parser reuse it!

      Specified by:
      tag in interface TagVisitor
    • script

      public void script(Tag tag, CharSequence body)
      Description copied from interface: TagVisitor
      Invoked on script tag.
      Specified by:
      script in interface TagVisitor
    • comment

      public void comment(CharSequence comment)
      Description copied from interface: TagVisitor
      Invoked on comment.
      Specified by:
      comment in interface TagVisitor
    • text

      public void text(CharSequence text)
      Description copied from interface: TagVisitor
      Invoked on text i.e. anything other than a tag.
      Specified by:
      text in interface TagVisitor
    • cdata

      public void cdata(CharSequence cdata)
      Description copied from interface: TagVisitor
      Invoked on CDATA sequence.
      Specified by:
      cdata in interface TagVisitor
    • xml

      public void xml(CharSequence version, CharSequence encoding, CharSequence standalone)
      Description copied from interface: TagVisitor
      Invoked on xml declaration.
      Specified by:
      xml in interface TagVisitor
    • doctype

      public void doctype(Doctype doctype)
      Description copied from interface: TagVisitor
      Invoked on DOCTYPE directive.
      Specified by:
      doctype in interface TagVisitor
    • condComment

      public void condComment(CharSequence expression, boolean isStartingTag, boolean isHidden, boolean isHiddenEndTag)
      Description copied from interface: TagVisitor
      Invoked on IE conditional comment. By default, the parser does not process the conditional comments, so you need to turn them on. Once conditional comments are enabled, this even will be fired.

      The following conditional comments are recognized: <!--[if IE 6]>one<![endif]--> <!--[if IE 6]><!-->two<!---<![endif]--> <!--[if IE 6]>three<!--xx<![endif]--> <![if IE 6]>four<![endif]>

      Specified by:
      condComment in interface TagVisitor
    • error

      public void error(String message)
      Description copied from interface: TagVisitor
      Warn about parsing error. Usually, parser will try to continue.
      Specified by:
      error in interface TagVisitor
      Parameters:
      message - parsing error message