org.swixml

## Class TagLibrary

- java.lang.Object
- - org.swixml.TagLibrary

- Direct Known Subclasses:
    SwingTagLibrary

      public abstract class TagLibrary
      extends Object

  A skeletal impementation of a TagLibrary
  A TagLibrary has a collection of Factories. Every Tag is mapped to a Factory which is used to build the java object during document parsing. Date: Dec 9, 2002
  Version:
    $Revision: 1.1 $
  Author:
    Wolf Paulus

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TagLibrary()` Constructs a new TagLibrary and regisiters all factories.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Factory` | `getFactory(Class template)` Returns the Factory that is currently registered for the given Tag name
    `Factory` | `getFactory(String name)` Returns the Factory that is currently registered for the given Tag name
    `protected Method` | `getSetter(Class template, String name)` Returns a setter method by name for a specified template class
    `Map` | `getTagClasses()`
    `protected Method` | `guessSetter(Class template, String name)` Returns a setter method by name for a specified template class
    `void` | `registerTag(String name, Class template)` Registers a class for the given tag name
    `void` | `registerTag(String name, Factory factory)` Registers a factory for the given tag name
    `protected abstract void` | `registerTags()` Registers all factories for the TagLibrary.
    `boolean` | `unregisterTag(String name)` Un-registers (removes) a registered tag.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TagLibrary

          public TagLibrary()

      Constructs a new TagLibrary and regisiters all factories.

  - ### Method Detail

    - #### registerTags

          protected abstract void registerTags()

      Registers all factories for the TagLibrary.

    - #### registerTag

          public void registerTag(String name,
                         Class template)

      Registers a class for the given tag name
      Parameters:
        `name` - `String` the tag's name
        `template` - `Class` the java class that represents the tag

    - #### registerTag

          public void registerTag(String name,
                         Factory factory)

      Registers a factory for the given tag name
      Parameters:
        `name` - `String` the tag's name
        `factory` - `FactoryFactory` factory to create an Instance of the tag

    - #### unregisterTag

          public boolean unregisterTag(String name)

      Un-registers (removes) a registered tag.
      Parameters:
        `name` - `String` the tag's name
      Returns:
        `boolean` true if tag was registered befoire and now successfuly removed.

    - #### getTagClasses

          public Map getTagClasses()

      Returns:
        `Map` - all registered tags.

            Use athe tag names to get to the factories

    - #### getFactory

          public Factory getFactory(String name)

      Returns the Factory that is currently registered for the given Tag name
      Parameters:
        `name` - `String`
      Returns:
        `Factory` - regsitered for the given tag name

    - #### getFactory

          public Factory getFactory(Class template)

      Returns the Factory that is currently registered for the given Tag name
      Parameters:
        `template` - `Class`
      Returns:
        `Factory` - regsitered for the given tag name

    - #### getSetter

          protected Method getSetter(Class template,
                         String name)

      Returns a setter method by name for a specified template class
      Parameters:
        `template` - `Class` template class
        `name` - `Sting` method name
      Returns:
        `Method` - a setter method for the given class.
      See Also:
        `guessSetter(Class, String)`, `Factory.getSetter(String)`

    - #### guessSetter

          protected Method guessSetter(Class template,
                           String name)

      Returns a setter method by name for a specified template class
      Parameters:
        `template` - `Class` template class
        `name` - `Sting` attribute name
      Returns:
        `Method` - a setter method for the given class, able to modify the property.
      See Also:
        `getSetter(Class, String)`, `Factory.guessSetter(String)`

Copyright © 2002 - 2013 - Wolf Paulus - wolfpaulus.com. All rights reserved.