Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Seam UI JSF2 support 2.3.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.seam.ui.converter
Class ConverterChain

    java.lang.Object
      org.jboss.seam.ui.converter.ConverterChain

All Implemented Interfaces:
  javax.faces.component.StateHolder, javax.faces.convert.Converter

    public class ConverterChain

extends Object
implements javax.faces.convert.Converter, javax.faces.component.StateHolder

This class provides a chainable converter for JSF. Any JSF converter can be placed at the end of the chain. A converter that is placed higher up the chain should return ConverterChain.CONTINUE if conversion has failed. If the all converters run return ConverterChain.CONTINUE an unconverted value will be returned. A converter can be placed in the chain with a priority, the order in which converters with the same priority is run is not specified.

Field Summary
`static int` | `CHAIN_END` This places the converter at the end of the chain.
`static int` | `CHAIN_START` This places the converter at the head of the chain.
`static String` | `CONTINUE`

Constructor Summary
`ConverterChain()`
`ConverterChain(javax.faces.component.UIComponent component)` Set up a ConverterChain for this component.

Method Summary
`boolean` | `addConverterToChain(javax.faces.convert.Converter c)` Add a converter to the end of the chain
`boolean` | `addConverterToChain(javax.faces.convert.Converter c, int priority)` Add a converter to the chain with a defined priority
`boolean` | `addConverterToChain(javax.el.ValueExpression c)` Add a converter to the end of the chain
`boolean` | `addConverterToChain(javax.el.ValueExpression c, int priority)` Add a converter to the chain with a defined priority
`boolean` | `containsConverterType(javax.faces.convert.Converter converter)`
`Object` | `getAsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String value)`
`String` | `getAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)`
`boolean` | `isTransient()`
`void` | `restoreState(javax.faces.context.FacesContext context, Object state)`
`Object` | `saveState(javax.faces.context.FacesContext context)`
`void` | `setTransient(boolean newTransientValue)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CONTINUE

    public static final String CONTINUE

See Also:
  Constant Field Values

### CHAIN_END

    public static final int CHAIN_END

  This places the converter at the end of the chain. No garuntee is made about the order converters which are placed on the queue with this priority will be run

  See Also:
    Constant Field Values

### CHAIN_START

    public static final int CHAIN_START

  This places the converter at the head of the chain. No garuntee is made about the order converters which are placed on the queue with this priority will be run

  See Also:
    Constant Field Values

Constructor Detail

### ConverterChain

    public ConverterChain()

### ConverterChain

    public ConverterChain(javax.faces.component.UIComponent component)

  Set up a ConverterChain for this component. This replaces any existing converter with a ConverterChain with the existing Converter at the end of the chain

  Parameters:
    `component` -

Method Detail

### getAsObject

    public Object getAsObject(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component,
                              String value)
                       throws javax.faces.convert.ConverterException

  Specified by:
    `getAsObject` in interface `javax.faces.convert.Converter`
  Throws:
    `javax.faces.convert.ConverterException`

### getAsString

    public String getAsString(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component,
                              Object value)
                       throws javax.faces.convert.ConverterException

  Specified by:
    `getAsString` in interface `javax.faces.convert.Converter`
  Throws:
    `javax.faces.convert.ConverterException`

### addConverterToChain

    public boolean addConverterToChain(javax.faces.convert.Converter c)

  Add a converter to the end of the chain

### addConverterToChain

    public boolean addConverterToChain(javax.el.ValueExpression c)

  Add a converter to the end of the chain

### addConverterToChain

    public boolean addConverterToChain(javax.faces.convert.Converter c,
                                       int priority)

  Add a converter to the chain with a defined priority

### addConverterToChain

    public boolean addConverterToChain(javax.el.ValueExpression c,
                                       int priority)

  Add a converter to the chain with a defined priority

### isTransient

    public boolean isTransient()

  Specified by:
    `isTransient` in interface `javax.faces.component.StateHolder`

### restoreState

    public void restoreState(javax.faces.context.FacesContext context,
                             Object state)

  Specified by:
    `restoreState` in interface `javax.faces.component.StateHolder`

### saveState

    public Object saveState(javax.faces.context.FacesContext context)

  Specified by:
    `saveState` in interface `javax.faces.component.StateHolder`

### setTransient

    public void setTransient(boolean newTransientValue)

  Specified by:
    `setTransient` in interface `javax.faces.component.StateHolder`

### containsConverterType

    public boolean containsConverterType(javax.faces.convert.Converter converter)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Seam UI JSF2 support 2.3.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 Seam Framework. All Rights Reserved.