public class PaddingConverter extends AbstractStateHolder implements javax.faces.convert.Converter, Serializable
Constructor and Description |
---|
PaddingConverter() |
Modifier and Type | Method and Description |
---|---|
Object |
getAsObject(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
String value)
Converts the supplied String value to a new padded String.
|
String |
getAsString(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
Object value)
Converts the supplied value to a String, by calling toString() on it.
|
char |
getCharacter()
Gets the pad character.
|
int |
getLength()
Gets the length to pad to.
|
int |
getMinLength()
Gets the minimum length to pad from.
|
PadPosition |
getPosition()
Gets the pad position.
|
void |
restoreState(javax.faces.context.FacesContext facesContext,
Object state)
Restores the state saved by
saveState(FacesContext) . |
Object |
saveState(javax.faces.context.FacesContext facesContext)
Saves the state of this converter.
|
void |
setCharacter(char character)
Sets the pad character.
|
void |
setLength(int length)
Sets the length to pad to.
|
void |
setMinLength(int minLength)
Sets the minimum length to pad from.
|
void |
setPosition(PadPosition position)
Sets the pad position.
|
isTransient, setTransient
public char getCharacter()
public void setCharacter(char character)
character
- The pad character.public PadPosition getPosition()
public void setPosition(PadPosition position)
position
- The pad position.public int getMinLength()
public void setMinLength(int minLength)
minLength
- The minimum length to pad from.public int getLength()
public void setLength(int length)
length
- The length to pad to.public Object getAsObject(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String value)
getAsObject
in interface javax.faces.convert.Converter
facesContext
- Faces Context.component
- The UI component that stores the String value.value
- The value to convert.public String getAsString(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object value)
getAsString
in interface javax.faces.convert.Converter
facesContext
- Faces Context.component
- The UI component that stores the String value.value
- The value to convert to a String.String
.public Object saveState(javax.faces.context.FacesContext facesContext)
saveState
in interface javax.faces.component.StateHolder
facesContext
- The FacesContext.public void restoreState(javax.faces.context.FacesContext facesContext, Object state)
saveState(FacesContext)
.restoreState
in interface javax.faces.component.StateHolder
facesContext
- The FacesContext.state
- The state saved by saveState(FacesContext)
.Copyright © 2008–2018. All rights reserved.