net.sf.cb2java.copybook
Class Numeric

java.lang.Object
  extended bynet.sf.cb2java.copybook.Element
      extended bynet.sf.cb2java.copybook.Leaf
          extended bynet.sf.cb2java.copybook.Numeric
Direct Known Subclasses:
Binary, Decimal, Packed, SignedSeparate

public abstract class Numeric
extends net.sf.cb2java.copybook.Leaf


Method Summary
 java.lang.IllegalArgumentException createEx(java.math.BigDecimal data, java.lang.String reason)
           
 java.lang.IllegalArgumentException createEx(java.math.BigDecimal data, java.lang.String reason, java.lang.Throwable cause)
           
 int decimalPlaces()
           
abstract  int digits()
           
 java.util.List getChildren()
          gets the children of this element or null if there are none
 java.text.DecimalFormat getFormatObject()
           
protected  int getLength()
          returns the length of one instance of this element
protected  java.math.BigInteger getUnscaled(java.lang.Object data)
           
protected  Value getValue()
          the value for this element
 boolean signed()
           
 void validate(java.lang.Object data)
          validates the data with the given decimal (printed) length constraint.
 
Methods inherited from class net.sf.cb2java.copybook.Element
getBytes, getLevel, getName, getOccurs, getPosition, getString, toBytes, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

signed

public final boolean signed()

digits

public abstract int digits()

getLength

protected int getLength()
Description copied from class: Element
returns the length of one instance of this element

Specified by:
getLength in class Element
Returns:
the length of one instance of this element

decimalPlaces

public int decimalPlaces()

getFormatObject

public java.text.DecimalFormat getFormatObject()

validate

public void validate(java.lang.Object data)
validates the data with the given decimal (printed) length constraint. This is useful for types where the length in the application data is not the same as the logical length e.g. SignedSeparate.

Specified by:
validate in class Element
Parameters:
data -

getValue

protected Value getValue()
Description copied from class: Element
the value for this element

Specified by:
getValue in class Element
Returns:
the value set for this element or the default

getUnscaled

protected java.math.BigInteger getUnscaled(java.lang.Object data)

createEx

public java.lang.IllegalArgumentException createEx(java.math.BigDecimal data,
                                                   java.lang.String reason)

createEx

public java.lang.IllegalArgumentException createEx(java.math.BigDecimal data,
                                                   java.lang.String reason,
                                                   java.lang.Throwable cause)

getChildren

public java.util.List getChildren()
Description copied from class: Element
gets the children of this element or null if there are none

Specified by:
getChildren in class Element
Returns:
the children of this element or null if there are none