[page Tag Handlers] [t1]Tag Handlers[t1] [section] A tag handler is an arbitrary piece of Java code that implements interface [javadoc hoglet,org.hoglet.handlers.TagHandler,lastid=y /]. A tag handler can do anything you want it to. hoglet has a number of [link core-tag-handlers.html]core tag handlers[link] built in that perform certain actions on the content of tags, anything from formatting Java code to creating tables. A tag handler can do more than that though, for instance you may want to create a tag handler that will replace the tag in the source text with a table of the current currency exchange rate. A tag handler can also support options. Options are there to modify the behaviour of the tag handler, or they can be used to actually generate the content to replace the tag. The action taken and options supported is down to the tag handler implementation. [/section] [t2]Processing content[t2] [section] When the [javadoc hoglet,org.hoglet.handlers.TagHandler#convert(org.hoglet.data.Tag\, java.lang.String),lastid=y /] method is called for the tag handler, the [javadoc hoglet,org.hoglet.handlers.TagHandler#isAutoExpandContent(),lastid=y /] method is called first. The result of this call will tell the processor what to do with the content. If true is returned then the child tags (if any) within the tag will be expanded first and then passed as the content parm to the convert method. If false is returned then null will be passed and the tag handler should process it's child tags itself to generate the content of the tag. It is up to the tag handler implementation to decide whether the value returned from the isAutoExpandContent method is respected. [/section] [t2]Default Handler[t2] [section] You can customize how hoglet processes plain text (i.e. content of tags or text without a tag) by specifying a tag handler that maps to tag: _default. If a handler is provided for that tag then hoglet will use that handler to process the text. If no handler is provided then hoglet will use it's [link tags.html#Content]built-in processing method[link] to process the text. [/section] [/page]