org.swixml.converters

## Class BorderConverter

- java.lang.Object
- - org.swixml.converters.BorderConverter

- All Implemented Interfaces:
    Converter

      public class BorderConverter
      extends Object
      implements Converter

  The `BorderConverter` class defines a converter that creates Border objects based on a provided String. The BorderConverter internally uses the `javax.swing.BorderFactory` and its static create.. methods to instantiate different kinds of borders, based on the given String.
  Additional parameters to create a border need to be comma separated and enclosed in parentheses.
  Parameter types get converted through the `ConverterLibrary`. Therefore, only parameter classes are supported that have registered converters in the ConverLibrary.

  ### Examples for Valid XML attribute notations:

       border="MatteBorder(4,4,4,4,red)"
       border="EmptyBorder(5,5,5,5)"
       border="TitledBorder(My Title)"
       border="RaisedBevelBorder"
       border="TitledBorder(TitledBorder, myTitle, TitledBorder.CENTER, TitledBorder.BELOW_BOTTOM, VERDANA-BOLD-18, blue)"
       border="TitledBorder(LineBorder(red,2), myTitle, TitledBorder.CENTER, TitledBorder.ABOVE_TOP)"
       border="CompoundBorder(LineBorder(blue,5), CompoundBorder(EmptyBorder(2,2,2,2), RaisedBevelBorder))"

  Version:
    $Revision: 1.1 $
  Author:
    Wolf Paulus
  See Also:
    `BorderFactory`, `AbstractBorder`, `ConverterLibrary`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Class` | `TEMPLATE` converter's return type

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BorderConverter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `convert(Class type, Attribute attr, Localizer localizer)` Returns a `javax.swing Border`
    `Class` | `convertsTo()` A `Converters` conversTo method informs about the Class type the converter is returning when its `convert` method is called

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

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

- - ### Field Detail

    - #### TEMPLATE

          public static final Class TEMPLATE

      converter's return type

  - ### Constructor Detail

    - #### BorderConverter

          public BorderConverter()

  - ### Method Detail

    - #### convert

          public Object convert(Class type,
                       Attribute attr,
                       Localizer localizer)

      Returns a `javax.swing Border`
      Specified by:
        `convert` in interface `Converter`
      Parameters:
        `type` - `Class` not used
        `attr` - `Attribute` value needs to provide Border type name and optional parameter
      Returns:
        `Object` runtime type is subclass of `AbstractBorder`

    - #### convertsTo

          public Class convertsTo()

      A `Converters` conversTo method informs about the Class type the converter is returning when its `convert` method is called
      Specified by:
        `convertsTo` in interface `Converter`
      Returns:
        `Class` - the Class the converter is returning when its convert method is called

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