com.cc.framework.taglib.convert
Class ConvertNumberTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.cc.framework.taglib.convert.ConverterTag
          extended bycom.cc.framework.taglib.convert.ConvertNumberTag
All Implemented Interfaces:
InnerTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class ConvertNumberTag
extends ConverterTag
implements InnerTag

Complex Number Converter as used in the JSF Specification

Version:
$Revision$
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  java.lang.String currencyCode_
           
private  java.lang.String currencySymbol_
           
private  boolean groupingUsed_
           
private  boolean integerOnly_
           
private  java.lang.String locale_
           
private  int maxFractionDigits_
           
private  boolean maxFractionDigitsSpecified
           
private  int maxIntegerDigits_
           
private  boolean maxIntegerDigitsSpecified
           
private  int minFractionDigits_
           
private  boolean minFractionDigitsSpecified
           
private  int minIntegerDigits_
           
private  boolean minIntegerDigitsSpecified
           
private  java.lang.String pattern_
           
private static long serialVersionUID
          Serial Version UID
private  java.lang.String type_
           
 
Fields inherited from class com.cc.framework.taglib.convert.ConverterTag
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ConvertNumberTag()
          Constructor
 
Method Summary
 Converter doCreateConverter()
          Template method is called to create the concrete Converter instance
private  void init()
          Initializes all internal members
 void release()
           
 void setCurrencyCode(java.lang.String currencyCode)
          ISO 4217 currency code, applied only when formatting currencies.
 void setCurrencySymbol(java.lang.String currencySymbol)
          Currency symbol, applied only when formatting currencies.
 void setGroupingUsed(java.lang.String groupingUsed)
          Flag specifying whether formatted output will contain grouping separators.
 void setIntegerOnly(java.lang.String integerOnly)
          Flag specifying whether only the integer part of the value will be formatted and parsed.
 void setLocale(java.lang.String locale)
          Locale whose predefined styles for numbers are used during formatting and parsing.
 void setMaxFractionDigits(java.lang.String maxFractionDigits)
          Maximum number of digits that will be formatted in the fractional portion of the output.
 void setMaxIntegerDigits(java.lang.String maxIntegerDigits)
          Maximum number of digits that will be formatted in the integer portion of the output.
 void setMinFractionDigits(java.lang.String minFractionDigits)
          Minimum number of digits that will be formatted in the fractional portion of the output.
 void setMinIntegerDigits(java.lang.String minIntegerDigits)
          Minimum number of digits that will be formatted in the integer portion of the output.
 void setPattern(java.lang.String pattern)
          Custom formatting pattern which determins how the number string should be formatted and parsed.
 void setType(java.lang.String type)
          Specifies how the number string will be formatted and parsed.
 
Methods inherited from class com.cc.framework.taglib.convert.ConverterTag
doStartTag, setConverterId
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

currencyCode_

private java.lang.String currencyCode_

currencySymbol_

private java.lang.String currencySymbol_

groupingUsed_

private boolean groupingUsed_

integerOnly_

private boolean integerOnly_

maxFractionDigitsSpecified

private boolean maxFractionDigitsSpecified

maxFractionDigits_

private int maxFractionDigits_

maxIntegerDigitsSpecified

private boolean maxIntegerDigitsSpecified

maxIntegerDigits_

private int maxIntegerDigits_

minFractionDigitsSpecified

private boolean minFractionDigitsSpecified

minFractionDigits_

private int minFractionDigits_

minIntegerDigitsSpecified

private boolean minIntegerDigitsSpecified

minIntegerDigits_

private int minIntegerDigits_

locale_

private java.lang.String locale_

pattern_

private java.lang.String pattern_

type_

private java.lang.String type_
Constructor Detail

ConvertNumberTag

public ConvertNumberTag()
Constructor

Method Detail

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class ConverterTag
See Also:
Tag.release()

init

private void init()
Initializes all internal members


doCreateConverter

public Converter doCreateConverter()
                            throws ConverterException
Description copied from class: ConverterTag
Template method is called to create the concrete Converter instance

Overrides:
doCreateConverter in class ConverterTag
Returns:
Converter instance
Throws:
ConverterException - If an error occurred while creating the Converter
See Also:
ConverterTag.doCreateConverter()

setCurrencyCode

public void setCurrencyCode(java.lang.String currencyCode)
ISO 4217 currency code, applied only when formatting currencies.

Parameters:
currencyCode - Currency Code

setCurrencySymbol

public void setCurrencySymbol(java.lang.String currencySymbol)
Currency symbol, applied only when formatting currencies.

Parameters:
currencySymbol - Currency Symbol

setGroupingUsed

public void setGroupingUsed(java.lang.String groupingUsed)
                     throws javax.servlet.jsp.JspException
Flag specifying whether formatted output will contain grouping separators. Expressions must evaluate to a boolean. Default value is true.

Parameters:
groupingUsed - "true" whether formatted output should contain grouping separators
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an Boolean value

setIntegerOnly

public void setIntegerOnly(java.lang.String integerOnly)
                    throws javax.servlet.jsp.JspException
Flag specifying whether only the integer part of the value will be formatted and parsed. Expressions must evaluate to a boolean. Default value is false.

Parameters:
integerOnly - "true" when only the integer part of the value will be formatted and parsed
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an Boolean value

setLocale

public void setLocale(java.lang.String locale)
Locale whose predefined styles for numbers are used during formatting and parsing. If not specified, the Locale returned by FacesContext.getViewRoot().getLocale() will be used. Expressions must evaluate to a java.util.Locale.

Parameters:
locale - The locale

setMaxFractionDigits

public void setMaxFractionDigits(java.lang.String maxFractionDigits)
                          throws javax.servlet.jsp.JspException
Maximum number of digits that will be formatted in the fractional portion of the output. Expressions must evaluate to an int.

Parameters:
maxFractionDigits - Maximum Number of fraction digits
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an integer value

setMaxIntegerDigits

public void setMaxIntegerDigits(java.lang.String maxIntegerDigits)
                         throws javax.servlet.jsp.JspException
Maximum number of digits that will be formatted in the integer portion of the output. Expressions must evaluate to an int.

Parameters:
maxIntegerDigits - Maximum Number of integer digits
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an integer value

setMinFractionDigits

public void setMinFractionDigits(java.lang.String minFractionDigits)
                          throws javax.servlet.jsp.JspException
Minimum number of digits that will be formatted in the fractional portion of the output. Expressions must evaluate to an int.

Parameters:
minFractionDigits - Mimimum Number of fraction digits
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an integer value

setMinIntegerDigits

public void setMinIntegerDigits(java.lang.String minIntegerDigits)
                         throws javax.servlet.jsp.JspException
Minimum number of digits that will be formatted in the integer portion of the output. Expressions must evaluate to an int.

Parameters:
minIntegerDigits - Minimum Number of integer digits
Throws:
javax.servlet.jsp.JspException - If the argument can not be converted into an integer value

setPattern

public void setPattern(java.lang.String pattern)
Custom formatting pattern which determins how the number string should be formatted and parsed.

Parameters:
pattern - The Formatting pattern

setType

public void setType(java.lang.String type)
Specifies how the number string will be formatted and parsed. Valid values are "number", "currency", and "percentage". Default value is "number".

Parameters:
type - "number" (default) , "currency", and "percentage"


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.