org.x2jb.bind.spi.handler
Interface AttributeHandler


public interface AttributeHandler

Users that wish to write their own X2JB Attribute Handler have to implement this interface.

Each attribute handler implementation have to:

Author:
Richard Opalka
See Also:
ElementHandler, BindingException

Method Summary
 java.lang.Object bind(org.w3c.dom.Attr attribute, java.lang.Class<?> clazz)
          Processes the XML attribute and returns the object wrapping its content.
 java.lang.Object getDefault(java.lang.String defaultValue, java.lang.Class<?> clazz)
          Returns default value associated with clazz type.
 

Method Detail

bind

java.lang.Object bind(org.w3c.dom.Attr attribute,
                      java.lang.Class<?> clazz)
Processes the XML attribute and returns the object wrapping its content.

Parameters:
attribute - XML attribute to be wrapped
clazz - class type which instance to return
Returns:
object wrapping XML attribute

getDefault

java.lang.Object getDefault(java.lang.String defaultValue,
                            java.lang.Class<?> clazz)
Returns default value associated with clazz type.

Parameters:
defaultValue - default value (can be null)
clazz - class type which default instance have to be returned
Returns:
object representing default value of class clazz